Building AFS into the HP-UX Kernel

On HP-UX machines, you must build AFS modifications into a new kernel; HP-UX does not support dynamic loading. If the machine's hardware and software configuration exactly matches another HP-UX machine on which AFS 3.6 is already built into the kernel, you can choose to copy the kernel from that machine to this one. In general, however, it is better to build AFS modifications into the kernel on each machine according to the following instructions.

  1. Move the existing kernel-related files to a safe location.

       # cp -p  /stand/vmunix  /stand/vmunix.noafs
       
       # cp -p  /stand/system  /stand/system.noafs   

  2. Access the AFS distribution by changing directory as indicated. Substitute "hp_ux110" 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     

  3. Because you ran AFS 3.5 on this machine, the appropriate AFS initialization file possibly already exists as /sbin/init.d/afs. 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 initialization file is not already in place, copy it now. Note the removal of the .rc extension as you copy.

       # cp  -p  usr/vice/etc/afs.rc  /sbin/init.d/afs   

  4. Copy the file afs.driver to the local /usr/conf/master.d directory, changing its name to afs as you do so.

       # cp  -p  usr/vice/etc/afs.driver  /usr/conf/master.d/afs   

  5. Copy the AFS kernel module to the local /usr/conf/lib directory. HP-UX machines are not supported as NFS/AFS Translator machines, so AFS 3.6 includes only libraries called libafs.nonfs.a (for the 32-bit version of HP-UX) and libafs64.nonfs.a (for the 64-bit version of HP-UX). Change the library's name to libafs.a as you copy it.

    For the 32-bit version of HP-UX:

       # cp  -p   bin/libafs.nonfs.a   /usr/conf/lib/libafs.a
    For the 64-bit version of HP-UX:
       # cp  -p  bin/libafs64.nonfs.a   /usr/conf/lib/libafs.a

  6. Verify the existence of the symbolic links specified in the following commands, which incorporate the AFS initialization script into the HP-UX startup and shutdown sequence. If necessary, issue the commands to create the links.

       # ln -s ../init.d/afs /sbin/rc2.d/S460afs
      
       # ln -s ../init.d/afs /sbin/rc2.d/K800afs   

  7. (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 /sbin/init.d directories. If you want to avoid potential confusion by guaranteeing that they are always the same, create a link between them. You can always retrieve the original script from the AFS distribution if necessary.

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

  8. Incorporate the AFS driver into the kernel, either using the SAM program or a series of individual commands. Both methods reboot the machine, which loads the new kernel and starts the Cache Manager.

    • To use the SAM program:

      1. Invoke the SAM program, specifying the hostname of the local machine as local_hostname. The SAM graphical user interface pops up.

            # sam -display local_hostname:0   

      2. Choose the Kernel Configuration icon, then the Drivers icon. From the list of drivers, select afs.

      3. Open the pull-down Actions menu and choose the Add Driver to Kernel option.

      4. Open the Actions menu again and choose the Create a New Kernel option.

      5. Confirm your choices by choosing "Yes" and "OK" when prompted by subsequent pop-up windows. The SAM program builds the kernel and reboots the system.

      6. Login again as the superuser root.

           login: root
           Password: root_password   

    • To use individual commands:

      1. Edit the file /stand/system, adding an entry for afs to the Subsystems section.

      2. Change to the /stand/build directory and issue the mk_kernel command to build the kernel.

           # cd /stand/build
              
           # mk_kernel   

      3. Move the new kernel to the standard location (/stand/vmunix), reboot the machine to start using it, and login again as the superuser root.

           # mv /stand/build/vmunix_test /stand/vmunix
              
           # cd /
              
           # shutdown -r now		
           
           login: root
           Password: root_password   

  9. 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