home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / doc / HOWTO / mini / Modules < prev    next >
Text File  |  1997-09-03  |  9KB  |  292 lines

  1.  
  2.                      LINUX MODULES INSTALLATION MINI-HOWTO
  3.                                        
  4. Contents
  5.  
  6.    
  7.        
  8.      * Purpose of this document
  9.      * Pre-requisites
  10.      * Recompiling the kernel for modules
  11.      * Configuring Debian or RedHat for modules
  12.      * Configuring Slackware for modules
  13.      * Configuring other distributions for modules
  14.      * Copyright and other Legalities
  15.        
  16.    
  17.      _________________________________________________________________
  18.    
  19.    
  20.    
  21. Purpose of this document
  22.  
  23.    
  24.    
  25.    My experience with Linux and modules has been that the existing
  26.    documents fail to provide a satisfactory explanation as to how to
  27.    successfully set up Linux with modules configured and working. The
  28.    procedure explained in this document has been successfully used
  29.    several times, both on my own system and over the Internet to give
  30.    directions to somebody trying to get some feature to work which
  31.    requires a driver supplied only in module form.
  32.    
  33.    My own system runs from a RedHat 4.2 distribution of Linux, and it was
  34.    on this setup that I developed the procedure. I have since
  35.    successfully installed it on systems running from various Slackware
  36.    distributions, and on one system running from a Debian distribution,
  37.    and the necessary procedure to correctly configure modules under Linux
  38.    in all three is documented herein.
  39.    
  40.    
  41.      _________________________________________________________________
  42.    
  43.    
  44.    
  45. Pre-requisites
  46.  
  47.    
  48.        
  49.        
  50.      * Before the steps in this document can be applied, the reader MUST
  51.        have a working Linux installation in which one can get to the
  52.        Linux prompt as user root since the majority of the steps involved
  53.        can only be undertaken by the said user.
  54.        
  55.        
  56.      * The existing kernel may be compiled either to use modules or not
  57.        to use modules, and can even display error messages during the
  58.        boot-up procedure as a result of modules being configured which
  59.        aren't available at the moment, providing the above condition is
  60.        met.
  61.        
  62.        
  63.      * The source tree for the current kernel is assumed to be found
  64.        rooted at /usr/src/linux and that is also assumed to be the
  65.        current directory throughout this document at the start of any
  66.        sequence of commands to be issued.
  67.        
  68.    
  69.      _________________________________________________________________
  70.    
  71.    
  72.    
  73. Recompiling the kernel for modules
  74.  
  75.    
  76.    
  77.    The kernel needs to be reconfigured to use modules for everything
  78.    other than the file system mounted as root (in most cases, this is the
  79.    ext2 file system), and should then be recompiled. The following
  80.    sequence appears to work best:
  81.    
  82.    
  83.  
  84.          cd /usr/src/linux
  85.          make menuconfig
  86.          make dep
  87.          make clean
  88.          make modules
  89.          make modules_install
  90.          make zImage
  91.  
  92.  
  93.    
  94.    
  95.    Having done that, the module dependencies need to be mapped out. This
  96.    is done with the following command:
  97.    
  98.    
  99.  
  100.          depmod -a
  101.  
  102.  
  103.    
  104.    
  105.    The new kernel now needs to be inserted in the boot chain. I am
  106.    assuming the reader is using LILO for this purpose, since this is the
  107.    only loader I have any experience with.
  108.    
  109.    I recommend that one does NOT automatically insert the newly compiled
  110.    kernel as the default Linux kernel since if it should fail, it is then
  111.    extremely difficult to recover one's Linux setup without doing a
  112.    complete reinstallation, which is not to be recommended. For this
  113.    reason, I have the following entry in my /etc/lilo.conf file:
  114.    
  115.    
  116.  
  117.         image=/boot/newlinux
  118.             label=new
  119.             alias=n
  120.             read-only
  121.             vga=ask
  122.             optional
  123.  
  124.  
  125.    
  126.    
  127.    This entry says that there is an OPTIONAL boot option (which will be
  128.    ignored if the image in question does not exist) which boots the file
  129.    /boot/newlinux if selected, and allows one to select the video mode it
  130.    is to be booted in.
  131.    
  132.    Assuming the existence of the above entry in /etc/lilo.conf the
  133.    revised kernel can be installed via the following two steps:
  134.    
  135.    
  136.  
  137.         cp arch/i386/boot/vmimage /boot/newlinux
  138.         lilo
  139.  
  140.  
  141.    
  142.    
  143.    Having done that, the reader needs to follow the further steps
  144.    relevant to their selected distribution, as follows:
  145.    
  146.      * Configuring Debian or RedHat for modules
  147.      * Configuring Slackware for modules
  148.      * Configuring other distributions for modules
  149.        
  150.    
  151.      _________________________________________________________________
  152.    
  153.    
  154.    
  155. Configuring Debian or RedHat for Modules
  156.  
  157.    
  158.    
  159.    Prior to carrying out the steps listed here, the steps listed in
  160.    Recompiling the kernel for modules are assumed to have been carried
  161.    out.
  162.    
  163.    The Debian and RedHat distributions have identical boot procedures, so
  164.    also have identical procedures for configuring modules into them.
  165.    
  166.        
  167.     1. Having logged in as root, use your favourite text editor to create
  168.        a new file called _/etc/rc.d/init.d/modules.init_ with the
  169.        following contents therein:
  170.        
  171.  
  172.          # Modules initialisation.
  173.          #
  174.          # Start up the module auto-loading daemon.
  175.          /sbin/kerneld
  176.  
  177.          # Mount all currently unmounted auto-mounted partitions.
  178.          /sbin/mount -a
  179.    
  180.        
  181.     2. Having created the above file, perform the following steps whilst
  182.        logged on as root:
  183.        
  184.  
  185.          cd /etc/rc.d
  186.          chmod 755 init.d/*
  187.          cd rc3.d
  188.          ln -s ../init.d/modules.init 05modules.init
  189.  
  190.    
  191.    
  192.    The system can now be rebooted, and on doing so, it will be found that
  193.    modules are fully implemented
  194.      _________________________________________________________________
  195.    
  196.    
  197.    
  198. Configuring Slackware for Modules
  199.  
  200.    
  201.    
  202.    Prior to carrying out the steps listed here, the steps listed in
  203.    Recompiling the kernel for modules are assumed to have been carried
  204.    out.
  205.    
  206.        
  207.     1. The file _/etc/rc.d/rc.M_ needs to be edited as follows:
  208.         
  209.             
  210.          1. Around line 18, there is a section reading as follows:
  211.             
  212.  
  213.          # Screen blanks after 15 minutes idle time.
  214.          /bin/setterm -blank 15
  215.         
  216.             
  217.             Immediately after this, insert the following paragraph, with
  218.             the usual blank lines either side of it:
  219.             
  220.  
  221.          # Load the kernel module auto-loader.
  222.          /sbin/kerneld
  223.         
  224.             
  225.          2. About 12 lines further down is the following:
  226.             
  227.  
  228.          # if there is no /etc/HOSTNAME, fall back on this default:
  229.         Immediately prior to this, insert the following paragraph, again
  230.             with the usual blank lines either side of it:
  231.             
  232.  
  233.          # Mount remaining unmounted auto-mount drives.
  234.          /sbin/mount -a
  235.    
  236.        
  237.        When those changes have been made, save the file.
  238.        
  239.    
  240.    
  241.    No further modifications are required for Slackware.
  242.      _________________________________________________________________
  243.    
  244.    
  245.    
  246. Configuring other distributions for Modules
  247.  
  248.    
  249.    
  250.    Prior to carrying out the steps listed here, the steps listed in
  251.    Recompiling the kernel for modules are assumed to have been carried
  252.    out.
  253.    
  254.    The precice procedure for other distributions has not been
  255.    ascertained, but is probably one of the above. To determine which one,
  256.    display a directory of the contents of the _/etc/rc.d_ directory, as
  257.    follows:
  258.    
  259.  
  260.          cd /etc/rc.d
  261.          ls -l *.d rc.*
  262.    
  263.        
  264.     1. If this list includes a directory named _init.d_ and some
  265.        directories with names matching _rc?.d_ where the question mark is
  266.        replaced by single digits, and does _NOT_ include a file with the
  267.        name _rc.M_, that distribution can be configured for modules by
  268.        following the procedure listed above for the Debian and RedHat
  269.        Distributions.
  270.        
  271.     2. If this list does not include a directory named _init.d_ but
  272.        includes a file named _rc.M_ then that distribution can be
  273.        configured for modules by following the procedure listed above for
  274.        the Slackware distribution.
  275.        
  276.     3. If this list matches neither of the above criteria, then the
  277.        distribution has a boot script not covered by this HowTo. In that
  278.        case, you are invited to contact the author of this document for
  279.        advice.
  280.        
  281.    
  282.      _________________________________________________________________
  283.    
  284.    
  285.    
  286. Copyright and other Legalities
  287.  
  288.    
  289.    
  290.    This document is covered by the terms of the GNU General Public
  291.    Licence. The author may be contacted by email at rhw@bigfoot.com. 
  292.