Loading AFS into the Linux Kernel

The insmod program is the dynamic kernel loader for Linux. Linux does not support incorporation of AFS modifications during a kernel build. For AFS to function correctly, the insmod program must run each time the machine reboots, so the AFS initialization script (included on the AFS CD-ROM) invokes it automatically. The script also includes commands that select the appropriate AFS library file automatically. In this section you run the script.

  1. Access the AFS distribution by changing directory as indicated. Substitute "i386_linux22" for the sysname variable.

    • If you copied the contents of the root.client directory into AFS (in Step 6 of Storing Binaries in AFS), change directory as indicated.

         # cd /afs/cellname/sysname/usr/afsws/root.client    

    • If copying files from the CD-ROM, mount the CD-ROM for this machine's system type on the local /cdrom directory. For instructions on mounting CD-ROMs (either locally or remotely via NFS), consult the operating system documentation. Then change directory as indicated.

         # cd /cdrom/sysname/root.client     

    • If accessing the distribution electronically, you possibly already downloaded it in Storing Binaries in AFS. If so, it is still in the temp_afs36_dir directory. If not, download it and run any commands necessary to uncompress or unpack the distribution. Place it in a temporary location (temp_afs36_dir), and change directory to the indicated subdirectory.

         # cd temp_afs36_dir/root.client     

  2. Copy the AFS kernel library files to the local /usr/vice/etc/modload directory. The filenames for the libraries have the format libafs-version.o, where version indicates the kernel build level. The string .mp in the version indicates that the file is appropriate for use with symmetric multiprocessor (SMP) kernels.

       # cd usr/vice/etc
       
       # cp -rp modload /usr/vice/etc   

  3. The AFS 3.6 distribution includes a new AFS initialization file that can select automatically from the kernel extensions included in AFS 3.6. Copy it to the /etc/rc.d/init.d directory, removing the .rc extension as you do.

       # cp -p afs.rc /etc/rc.d/init.d/afs    
    The afsd options file possibly already exists as /etc/sysconfig/afs from running a previous version of AFS on this machine. Compare it to the version in the root.client/usr/vice/etc directory of the AFS 3.6 distribution to see if any changes are needed. If the options file is not already in place, copy it now. Note the removal of the .conf extension as you copy.
       # cp -p afs.conf /etc/sysconfig/afs    
    If necessary, edit the options file to invoke the desired arguments on the afsd command in the initialization script. For further information, see the section titled Configuring the Cache Manager in the OpenAFS Quick Beginnings chapter about configuring client machines.

  4. Issue the chkconfig command to activate the afs configuration variable, if it is not already. Based on the instruction in the AFS initialization file that begins with the string "#chkconfig", the command automatically creates the symbolic links that incorporate the script into the Linux startup and shutdown sequence.

       # /sbin/chkconfig --add afs   

  5. (Optional) If the machine is configured as a client, there are now copies of the AFS initialization file in both the /usr/vice/etc and /etc/init.d directories, and copies of the afsd options file in both the /usr/vice/etc and /etc/sysconfig directories. If you want to avoid potential confusion by guaranteeing that the two copies of each file are always the same, create a link between them. You can always retrieve the original script or options file from the AFS distribution if necessary.

       # cd /usr/vice/etc
       
       # rm afs.rc afs.conf
        
       # ln -s  /etc/rc.d/init.d/afs  afs.rc
       
       # ln -s  /etc/sysconfig/afs  afs.conf   

  6. Reboot the machine.

       # shutdown -r now     

  7. If you are upgrading a server machine, login again as the local superuser root, then return to Step 6 in Upgrading Server Machines.

       login: root
       Password: root_password