Loading HIPL for OpenWRT on La Fonera

This part is just for La Fonera. For WGT634U, please refer to the section called “Loading HIPL on Netgear WGT634U”.

For building HIPL on the kamikaze release 7.09. 

NEW preferred way to build and install HIPL on OpenWRT:

NOTE: Automatic package dependency selection is only verified for hipfw! Please report missing dependencies for the other packages.

  1. Get and extract OpenWRT kamikaze 7.09 source, untar it and create the download directory for packages that should be built.

      $ wget http://downloads.openwrt.org/kamikaze/7.09/kamikaze_7.09.tar.bz2
      $ tar xzf kamikaze_7.09.tar.gz
      $ mkdir -p path/to/kamikaze/dl
      
  2. Get the newest hipl source tree from the hipl repository and place the tarball that you are going to create in the kamikaze download directory.

      $ tla get hipl--main--2.6 hipl--main--2.6
      $ cd hipl--main--2.6
      $ ./autogen.sh
      $ make dist
      $ cp hipl-main.tar.gz path/to/kamikaze/dl
      

    NOTE: The "main" repository contains the most stable sources. If you encounter problems when running HIPL on OpenWRT, you may want to try the "userspace" repository instead. However, "userspace" is more experimental and might not compile for OpenWRT.

  3. Apply patches for HIPL on OpenWRT into the kamikaze_7.09 source tree, which produce Makefiles and configuration files for the required packages.

      $ cd /path/to/kamikaze
      $ patch -p1 < /path/to/hipl/patches/openwrt/2.6.23/kamikaze_7.09-kernel.patch
      $ patch -p1 < /path/to/hipl/patches/openwrt/2.6.23/kamikaze_7.09-hipl.patch
      

  4. Select the packages, which you want to build for OpenWRT. The following command will allow you to do this in a similar way to configuring a custom kernel.

      $ make menuconfig
      

    Ensure that you select the HIPL-package that you require to run. You might only need the hipfw or only hipd. Your selection will automatically select all necessary dependencies. Below we give an example on how to select hipfw only, the hipd will not be installed.

      Network  --->
      <*> hipl-hipfw
      

    NOTE: Due to dependency issues with the build system, you still have to select kmod-ipsec4 and kmod-ipsec6 manually.

    Kernel modules  ---> 
     Network Support  ---> 
      <*>  kmod-ipsec4 
      <*>  kmod-ipsec6
      

  5. Now build OpenWRT.

      $ make V=99
      

  6. Load the images on La Fonera and reboot.

Old way to build and install HIPL on OpenWRT (in case the above is not working):

  1. Get and extract OpenWRT kamikaze 7.09 source.

      $ tar xzf kamikaze_7.09.tar.gz
      
  2. Get all patches for HIPL on OpenWRT from http://hipl.hiit.fi/hipl/contrib/openwrt/7.09/patches/, which produce Makefiles and configuration files for necessary packages. And apply them into the kamikaze_7.09 source tree.

      $ ls
      64 etc_config_dhcp.diff      64 etc_firewall_user.diff
      64 etc_config_network.diff   64 etc_hostapd.diff
      64 etc_config_wireless.diff  64 hipl_openwrt-7.09.diff
      64 lib_wifi_madwifi.sh.diff  64 kamikaze_7.09
      $ cd kamikaze_7.09
      $ patch -p1 < ../hipl_openwrt-7.09.diff
      $ patch -p1 < ../etc_config_dhcp.diff
      $ patch -p1 < ../etc_config_network.diff
      $ patch -p1 < ../etc_config_wireless.diff
      $ patch -p1 < ../etc_firewall_user.diff
      $ patch -p1 < ../etc_hostapd.diff
      $ patch -p1 < ../lib_wifi_madwifi.sh.diff
      $ ls package/hipl/Makefile
      Makefile
      

    Note that you might also change the kernel version in <path_to_kamikaze>/target/linux/atheros-2.6/Makefile into 2.6.23 or a similar version number, especially if you are using vanilla kamikaze sources.

  3. Get the newest hipl source tree from the hipl repository, pack them as a tarball and place it under the dl directory.

      $ tla get hipl--main--2.6 hipl--main--2.6
      $ mkdir -p path/to/kamikaze/dl
      $ tar czf path/to/kamikaze/dl/hipl--openwrt--2.6.tar.gz --exclude=\{arch\} hipl--main--2.6
      

    An alternative to that is to get a hipl tarball from http://hipl.hiit.fi/hipl/contrib/openwrt/, and to place it in the directory kamikaze_7.09/dl/. However, this tarball is currently too old. Do that only when you get in trouble with the first method with the newest sources.

    $ wget http://hipl.hiit.fi/hipl/contrib/openwrt/hipl--openwrt--2.6.tar.gz -O kamikaze_7.09/dl/hipl--openwrt--2.6.tar.gz

  4. Copy our own kernel configuration file for atheros from http://hipl.hiit.fi/hipl/contrib/openwrt/7.09/config/target/linux/atheros-2.6/config/default and place it as kamikaze_7.09/target/linux/atheros-2.6/config/default.

  5. Enable hipl in the Networking menu by executing "make menuconfig".

      Network  --->
      <*> hipl
      

    Select the kernel modules kmod-ipsec, kmod-ipsec4 and kmod-ipsec6.

  6. Build OpenWRT, make a vmlinuz and a rootfs image.

      $ make V=99
      

    Or you can also build just the hipl packages.

      $ make package/hipl-install V=99
      

  7. Load the images on La Fonera and reboot.

  8. If you are able to reboot your device with your image, the next thing to do is to install kernel module packages needed for running hipl. Make sure first that the following packages are available in your kamikaze tree.

      $ cd bin/packages/
      $ ls -l kmod-crypto* kmod-ipsec* kmod-ipv6* kmod-tun*
      176 -rw-r--r-- 1 pisa users 169225 2008-06-18 11:41 kmod-crypto_2.6.21.3-atheros-1_mips.ipk
      36 -rw-r--r-- 1 pisa users  32461 2008-06-18 11:41 kmod-ipsec_2.6.21.3-atheros-1_mips.ipk
      16 -rw-r--r-- 1 pisa users  10813 2008-06-18 11:41 kmod-ipsec4_2.6.21.3-atheros-1_mips.ipk
      20 -rw-r--r-- 1 pisa users  13259 2008-06-18 11:41 kmod-ipsec6_2.6.21.3-atheros-1_mips.ipk
      172 -rw-r--r-- 1 pisa users 167391 2008-06-18 11:41 kmod-ipv6_2.6.21.3-atheros-1_mips.ipk
      12 -rw-r--r-- 1 pisa users   6800 2008-06-18 11:41 kmod-tun_2.6.21.3-atheros-1_mips.ipk
      

    If they are not available, configure your OpenWRT again to add them as packages.("<M>")

  9. Install the packages in your La Fonera device. On your device console:

      # scp user@srv:path/to/kamikaze_7.09/bin/packages/kmod-{crypto,ipsec,ipv6,tun}* .
      # ipkg install kmod-crypto* kmod-ipsec* kmod-ipv6* kmod-tun*
      

  10. Load the installed modules, unless you already have /etc/modules.d/35-hipl.

      # cd /lib/modules/2.6.21.3
      # insmod crypto_null.ko
      # insmod sha1.ko
      # insmod aes.ko
      # insmod crypto_hash.ko
      # insmod hmac.ko
      # insmod tun.ko
      # insmod ipv6.ko
      # insmod af_key.ko
      # insmod xfrm_user.ko
      # insmod ah4.ko
      # insmod esp4.ko
      # insmod ipcomp.ko
      # insmod xfrm_tunnel.ko
      # insmod ah6.ko
      # insmod esp6.ko
      # insmod ipcomp6.ko
      # insmod tunnel6.ko
      # insmod xfrm6_tunnel.ko
      

    Don't panic even though some of those modules do not exist. Chances are, the missing modules are already embedded in your kernel image. To know whether a certain object is configured as a module or not, refer to the configuration file kamikaze_7.09/target/linux/atheros-2.6/config/default.

For building HIPL on the kamikaze development version. 

  1. Get OpenWRT source codes from the subversion repository.

    $ svn checkout https://svn.openwrt.org/openwrt/trunk
    

  2. Get all patches for hipl packages in OpenWRT http://hipl.hiit.fi/hipl/contrib/openwrt/devel/patches/, and apply them into the kamikaze source tree.

    $ ls
    64 hipl_openwrt_kernel-svn.diff  64 hipl_openwrt_packages-svn.diff
    64 kamikaze/
    $ cd kamikaze
    $ patch -p1 < ../hipl_openwrt_packages-svn.diff
    $ patch -p1 < ../hipl_openwrt_kernel-svn.diff
    

    Copy our own kernel configuration file for atheros from http://hipl.hiit.fi/hipl/contrib/openwrt/devel/config/target/linux/atheros/ and place it in kamikaze/target/linux/atheros/.

  3. Enable hipl in the Networking menu by executing "make menuconfig".

    Network  --->
     <*> hipl
    

  4. Get the newest hipl source tree from the hipl repository, pack them as a tarball and place it under the dl directory.

    $ tla get hipl--main--2.6 hipl--main--2.6
    $ mkdir -p path/to/kamikaze/dl
    $ tar czf path/to/kamikaze/dl/hipl--openwrt--2.6.tar.gz --exclude=\{arch\} hipl--main--2.6
    

    An alternative to that is to get a hipl tarball from http://hipl.hiit.fi/hipl/contrib/openwrt/, and to place it in the directory kamikaze_7.09/dl/. However, this tarball is currently too old. Do that only when you get in trouble with the first method with the newest sources.

    $ wget http://hipl.hiit.fi/hipl/contrib/openwrt/hipl--openwrt--2.6.tar.gz -O kamikaze/dl/hipl--openwrt--2.6.tar.gz
    

  5. Build OpenWRT, make a vmlinuz and a rootfs image.

    $ make V=99
    

    Or you can also build just a hipl package.

    $ make package/hipl-install V=99
    

  6. Load the images on La Fonera and reboot.

  7. If you are able to reboot your device with your image, the next thing to do is to install kernel module packages needed for running hipl. Make sure first that the following packages are available in your kamikaze tree.

    $ cd bin/packages/
    $ ls -l kmod-crypto* kmod-ipsec* kmod-ipv6* kmod-tun*
    176 -rw-r--r-- 1 pisa users 169225 2008-06-18 11:41 kmod-crypto_2.6.21.3-atheros-1_mips.ipk
     36 -rw-r--r-- 1 pisa users  32461 2008-06-18 11:41 kmod-ipsec_2.6.21.3-atheros-1_mips.ipk
     16 -rw-r--r-- 1 pisa users  10813 2008-06-18 11:41 kmod-ipsec4_2.6.21.3-atheros-1_mips.ipk
     20 -rw-r--r-- 1 pisa users  13259 2008-06-18 11:41 kmod-ipsec6_2.6.21.3-atheros-1_mips.ipk
    172 -rw-r--r-- 1 pisa users 167391 2008-06-18 11:41 kmod-ipv6_2.6.21.3-atheros-1_mips.ipk
     12 -rw-r--r-- 1 pisa users   6800 2008-06-18 11:41 kmod-tun_2.6.21.3-atheros-1_mips.ipk
    

    If they are not available, configure your OpenWRT again to add them as packages.("<M>")

  8. Install the packages in your La Fonera device. On your device console:

    # scp user@srv:path/to/kamikaze-svn/bin/packages/kmod-{crypto,ipsec,ipv6,tun}* .
    # ipkg install kmod-crypto* kmod-ipsec* kmod-ipv6* kmod-tun*
    

  9. Load the installed modules, unless you already have /etc/modules.d/35-hipl.

    # cd /lib/modules/2.6.21.3
    # insmod crypto_null.ko
    # insmod sha1.ko
    # insmod aes.ko
    # insmod crypto_hash.ko
    # insmod hmac.ko
    # insmod tun.ko
    # insmod ipv6.ko
    # insmod af_key.ko
    # insmod xfrm_user.ko
    # insmod ah4.ko
    # insmod esp4.ko
    # insmod ipcomp.ko
    # insmod xfrm_tunnel.ko
    # insmod ah6.ko
    # insmod esp6.ko
    # insmod ipcomp6.ko
    # insmod tunnel6.ko
    # insmod xfrm6_tunnel.ko
    

    Don't panic even though some of those modules do not exist. Chances are, the missing modules are already embedded in your kernel image. To know whether a particular object is already configured as a module or not, refer to the configuration file 'kamikaze/target/linux/atheros/config-2.6.21'.