AppleTalk Kernel Module for Red Hat Enterprise Linux 4

  1. Determining kernel version details
  2. Pre-compiled kernel modules
  3. Compile the kernel module on your own
 

Red Hat does not provide AppleTalk kernel modules for Red Hat Enterprise Linux 4. For common systems pre-compiled kernel modules from HELIOS are available. Optionally you may compile kernel modules on your own.


Note: This description covers Red Hat Enterprise Linux 4 but should be similar on other distributions.


1. Determining kernel version details

To check your kernel version and patch details enter the following command on a shell:

# uname -r
2.6.9-55.ELsmp


 

To check the processor architecture enter the following command on a shell:

# uname -m
i386



   i386 or i686   

   x86_64



32-bit architecture

64-bit architecture

 


2. Pre-compiled kernel modules

Pre-compiled kernel modules should fit for most customers. The installation is straightforward.
 
There are three modules available for download:
 
Red Hat Enterprise Linux 4 32-bit (single CPU)
Red Hat Enterprise Linux 4 32-bit SMP*
Red Hat Enterprise Linux 4 64-bit SMP*

* Symmetric Multiprocessing

 
Note: We compiled the modules for kernel version 2.6.9-55, which is the current version. Other or upcoming kernel patch levels, superseding level 55, have not been tested yet and may need to be compiled manually.
 
Download the pre-compiled kernel modules from:
 
User Name: tools
Password: tools
 
  1. Login, go to “HELIOS Tools” > “RHEL4 AppleTalk modules”, select the “.tar” file that contains the appropriate kernel module for your machine and click the “Download” button.

  2. To extract the archive, enter the following commands:
    # cd /usr/local/helios
    # tar xf <archive_name>


  3. Two files are extracted from the archive:
    • The kernel module (“HELIOSDIR/etc/kernel/appletalk.ko”)
    • The pre-start script that loads the kernel module when starting the HELIOS services (“HELIOSDIR/etc/startstop/31helatalk”)

3. Compile the kernel module on your own

Note: This section addresses experts.
   
  1. Log in on a shell as “root” (No “sudo” nor “su”!).

  2. Since Red Hat does not provide the complete kernel sources, you must download the source from www.kernel.org.

  3. Check your kernel version details (see “1. Determining kernel version details”).

  4. Go to: www.kernel.org and get the kernel source for kernel 2.6.9
  5. Direct download: www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.9.tar.gz

  6. Create a new directory for the kernel source and change into it:
    # mkdir /usr/src/kernel.org
    # cd /usr/src/kernel.org


  7. Copy the downloaded kernel to the newly created directory and extract it using the following command:
    # tar xzf linux-2.6.9.tar.gz

  8. Important: The kernel source directory needs to be available on path “/usr/src/linux”, so create a symbolic link, then go to the directory:
    # cd /usr/src
    # ln -s kernel.org/linux-2.6.9 linux
    # cd linux


  9. Copy the configuration file of the running Red Hat kernel (check uname -r) from the “/boot” directory into the current directory:
    # cp /boot/config-2.6.9-55.ELsmp .config

    Note: In most installations there are several configuration files. Make sure to copy the configuration file with the correct version string.

  10. Activate the AppleTalk module in the kernel configuration using the “menuconfig” option:
    # make menuconfig

    Navigate to “Device Drivers” > “Networking support” > “Networking options” and find the “Appletalk protocol support” entry. With the space bar you can toggle to “M” (for “module”). Select “Exit” until you will be asked to save the configuration. Save the configuration.

  11. The Makefile must now be adjusted for kernel version and function mapping.
    First make a backup of your Makefile:
    # cp Makefile Makefile.sav

    Open the Makefile and enter the kernel extra version (Red Hat Enterprise Linux patch level) as parameter EXTRAVERSION, like shown in the example below. Make sure that the specified version information matches exactly the one used for your current kernel (check uname -r):
    # uname -r
    2.6.9-55.ELsmp


    For the example given above the Makefile would look like this:
    VERSION = 2
    PATCHLEVEL = 6
    SUBLEVEL = 9
    EXTRAVERSION = -55.ELsmp


    If you use a 64-bit system, save the Makefile and continue with step 11.

    If you use a 32-bit system, due to optimized routines, you must map some functions, otherwise you will not be able to load the kernel module into the kernel later:

    Search for the line:
    MODFLAGS = -DMODULE

    Change it to:
    MODFLAGS = -DMODULE -Dcopy_from_user=__copy_from_user -Dcopy_to_user=__copy_to_user

    Save the edited Makefile.

  12. To create the files required for module compilation start make.

    Interrupt the build process (CTRL-C) after about 25 lines (Make sure that the "scripts" directory has been processed!), because at that time, the files you need will be ready.

    # make
     CHK     include/linux/version.h
     UPD     include/linux/version.h
     SYMLINK include/asm -> include/asm-i386
     SPLIT   include/linux/autoconf.h -> include/config/*
     HOSTCC  scripts/genksyms/genksyms.o
     SHIPPED scripts/genksyms/lex.c
     SHIPPED scripts/genksyms/parse.h
     SHIPPED scripts/genksyms/keywords.c
     HOSTCC  scripts/genksyms/lex.o
     SHIPPED scripts/genksyms/parse.c
     HOSTCC  scripts/genksyms/parse.o
     HOSTLD  scripts/genksyms/genksyms
     CC      scripts/mod/empty.o
     HOSTCC  scripts/mod/mk_elfconfig
     MKELF   scripts/mod/elfconfig.h
     HOSTCC  scripts/mod/file2alias.o
     HOSTCC  scripts/mod/modpost.o
     HOSTCC  scripts/mod/sumversion.o
     HOSTLD  scripts/mod/modpost
     HOSTCC  scripts/kallsyms
     HOSTCC  scripts/pnmtologo
     HOSTCC  scripts/conmakehash
     CC      arch/i386/kernel/asm-offsets.s
     CHK     include/asm-i386/asm_offsets.h
     UPD     include/asm-i386/asm_offsets.h
     CC      init/main.o
     CHK     include/linux/compile.h
     UPD     include/linux/compile.h
     CC      init/version.o
     CC      init/do_mounts.o
     CC      init/do_mounts_rd.o
    make[1]: *** [init/do_mounts_rd.o] Interrupt
    make:    *** wait: No child processes.  Stop.
    make:    *** Waiting for unfinished jobs....
    make:    *** wait: No child processes.  Stop.


  13. Compile the AppleTalk module:

    # make M=net/appletalk
     LD      net/appletalk/built-in.o
     CC [M]  net/appletalk/aarp.o
     CC [M]  net/appletalk/ddp.o
     CC [M]  net/appletalk/atalk_proc.o
     CC [M]  net/appletalk/sysctl_net_atalk.o
     LD [M]  net/appletalk/appletalk.o
     Building modules, stage 2
     MODPOST
     CC      net/appletalk/appletalk.mod.o
     LD [M]  net/appletalk/appletalk.ko


    The AppleTalk module has been created as “net/appletalk/appletalk.ko”.

  14. To test the new AppleTalk kernel module type:
    # insmod net/appletalk/appletalk.ko

    The following line should be written to the system messages:
    kernel: NET: Registered protocol family 5

  15. To unload the kernel module, enter rmmod appletalk. Make sure that the HELIOS services are not running when doing so.

  16. To get the kernel module loaded automatically when starting the HELIOS services, copy the module to "HELIOSDIR/etc/kernel" and use the "31helatalk" script.
    The script is available from:

    http://webshare.helios.de
    User Name: tools
    Password: tools

    Login, go to “HELIOS Tools” > “RHEL4 AppleTalk modules”, select “script-only.tar” and click the “Download” button. To extract the archive, enter the following commands:
    # cd /usr/local/helios
    # tar xf script-only.tar


    The module will now be loaded every time the HELIOS services are started.
 
Note: Feedback is appreciated!