Zaurus SL6000 and LIVSIX stack HOWTO ------------------------------------ Romain KUNTZ kuntz@sfc.wide.ad.jp Table Of Content : ------------------ 1. Install cross compiling environment 2. Kernel compilation 3. Livsix compilation 4. Livsix installation 5. Livsix tests 6. Livsix and Mobility 7. IPv6 (and IPv4) Router [issues] 8. Bugs 9. Useful Links !!WARNING!! I recommand to make a backup of all files you have on the Zaurus, because the update will erase all data. !!WARNING!! 1. Install cross compiling environment : ---------------------------------------- * [Debian users] At the moment (2004-04-22), emdebian crosscompiler is not xscale compliant, so don't use it for kernel compilation. * Download a toolchain, for example this one (it works fine) : http://www.openzaurus.org/official/toolchain/cross-2.95.3.tar.bz2 * Unpack cross-2.95.3.tar.bz2 in /usr/local/arm/ * You need to export a new PATH for compilation: $ export PATH=/usr/local/arm/2.95.3/bin:$PATH 2. Kernel compilation : ----------------------- * Thanks to http://software.nautilus6.org/packages/zaurus/HOWTO/wide-memo-nautilus6-zaurus-ipv6-setup-00.txt * Download these following files (for zaurus SL6000) : - Sharp source tree (2.4.18) : linux-sl6000-20040311-rom1_11.tar.bz2 http://developer.ezaurus.com/sl_j/source/6000/20040311/linux-sl6000-20040311-rom1_11.tar.bz2 - LIVSIX (portable IPv6 stack from motorola labs) http://www.nal.motlabs.com/livsix/ http://www.nal.motlabs.com/livsix/sources/livsix-pre-2.1.tar.bz2 * Make source tree : If it is not already done, add arm binary directory to your PATH $ export PATH=/usr/local/arm/2.95.3/bin:$PATH Let's go : $ tar jxvf linux-sl6000-20040311-rom1_11.tar.bz2 $ cd linux In order to use LIVSIX we need to patch the zaurus' kernel with the patch corresponding to the kernel (you will find it in the linux-gnu-kernel/patches directory of livsix directory) : $ cp /path/to/patch/patch-2.4.18-livsix . $ patch -p1 < patch-2.4.18-livsix * Prepare kernel configuration file $ make menuconfig (You need the libncurses5-dev package to execute this command) * select "Load an alternate configuration file" at the bottom of the menu * write arch/arm/def-configs/tosa-j and choose OK (tosa-j is the config file for SL6000.) * Configure the kernel without any IPv6 option networking option->deactivate IPv6 protocole if activated. That's all for configuration. Exit and save the configuration. * Compilation : $ make dep $ make clean $ make zImage * The zImage file is in arch/arm/boot, we will need it later. 3. Livsix compilation : --------------------- * Get the archive on http://www.nal.motlabs.com/livsix/ Either tarball or cvs : $ cvs -d :pserver:guest@cvs.nal.motlabs.com:/cvsroot login [password is guest] $ cvs -d :pserver:guest@cvs.nal.motlabs.com:/cvsroot co livsix [to get livsix] * First, unpack the archive if you have downloaded a tarball : $ tar jxvf livsix-pre-2.1.tar.bz2 * Then, export the new path : $ export PATH=/usr/local/arm/2.95.3/bin:$PATH * Patch livsix sources : You can get the patches here : http://software.nautilus6.org/packages/zaurus/SL6000/LIVSIX-ZAURUS.tar.bz2 Modify the patch Makefile.am.patch and configure.in.patch : $ tar jxvf LIVSIX-ZAURUS.tar.bz2 $ cd LIVSIX-ZAURUS/patchs/ $ ./update-patch "my\/path" [where "my\/path" is the path to your zaurus kernel source tree. Don't forget the "" and \ before /] for example : $ ./update-patch "\/usr\/local\/src\/zaurus\/linux" Apply patches : $ patch /path/to/livsix/linux-gnu-kernel/Makefile.am Makefile.am.patch $ patch /path/to/livsix/linux-gnu-kernel/configure.in configure.in.patch $ patch /path/to/livsix/linux-gnu-user/livsix.sh livsix.sh.patch * Compilation : $ cd path/to/livsix/ $ ./WRAPUP $ CC=/usr/local/arm/2.95.3/bin/arm-linux-gcc ./configure --enable-debug --host arm-linux Check whether the compiler is recognised as a cross-compiler in the output of the ./configure script. If not, you path is not good ! Compile the stack : $ make 4. Livsix installation : ------------------------ * Update zaurus with the new kernel Get the following files for SL6000 : -> consolescroll http://developer.ezaurus.com/sl_j/source/6000/consolescroll -> updater.sh.6000 http://developer.ezaurus.com/sl_j/source/6000/20040311/updater.sh.6000 Make them executable : $ chmod u+x consolescroll updater.sh.6000 Put these files at the root of the CF card (or SD card) : **WARNING** SD or CF card filesystem must be fat $ scp /path/to/sharp/kernel/sources/arch/arm/boot/zImage root@:/mnt/cf $ scp consolescroll root@:/mnt/cf $ scp updater.sh.6000 root@:/mnt/cf/updater.sh Flash the zaurus : -> Connect the AC adaptor on the Zaurus and verify that power is supplied -> Reboot the zaurus via the menu (green button) -> Press and hold the OK button while the zaurus is rebooting. You should access the Maintenance Menu. -> Select 4. to update the kernel -> Select the card where you put the files (CF card in this example) and answer yes (Y) -> After the system update, [Please reset] message is displayed. Reset the SL6000 using the reset button on the back. Press and hold the OK button while turn on the zaurus . -> Select 3. in the menu in order to format the system, then yes (Y). The zaurus will then reboot on the new kernel. * Zaurus in english It can be very useful because after the update the zaurus will be in japanese. -> Get a terminal (qpe-terminal, see http://www.killefiz.de/zaurus/) -> Install it -> Launch it then type "su" to enter super-user mode -> Type "vi /home/root/Settings/locale.conf" in order to edit the locale.conf file -> Change the line "Language = jp" to "Language = en" (press "i" to edit the file) -> Then press the cancel button of the keyboard, then ":x" then press enter to save the file -> Reboot the Zaurus (menu->green icon) and select Yes (the left box) -> After the reboot, the zaurus is in english ! * Install livsix on zaurus Copy livsix directory on zaurus (for example SD card) $ scp -r livsix root@:/mnt/card Or you can just also just copy the "plt" directory (with only the livsix.o file) and the "userspace" (with only the livconfig and livsix.sh files) directory, Then, on zaurus, execute (as root) : # cd /path/to/livsix/ # cd userspace Edit the livsix.sh file and modify parameters to suit to your configuration. For instance, if the zaurus starts in a foreign network, fill the following fileds : HOMEADDRESS= HOMEAGENT= If the zaurus starts in the Home Network, do not fill the HOMEADDRESS field ! See section 6. for more informations about mobility features. * Test livsix To start livsix stack, use (in userspace directory): # ./livsix.sh start To stop, use : # ./livsix.sh stop You can use ifconfig or ./livconfig to see your devices and check their IPv6 addresses. livconfig has also some intesting options : Print the Neighbor Cache # livconfig -n Print the Destination Cache # livconfig -d Print the Binding Cache # livconfig -b Print the Default Router List # livconfig -r Print the Prefix List # livconfig -p Add an entry to the Binding Cache # livconfig -a Clear an entry from the Binding Cache # livconfig -c Configure LIVSIX as a Mobile Node # livconfig -m mn Configure LIVSIX as a Home Agent (without restarting livsix !) # livconfig -m ha Bring up/down the device # livconfig up/down 5. Livsix tests : ----------------- * Ping A little ping6 test from a laptop to the zaurus : 5182 packets transmitted, 5133 received, 0% packet loss, time 5236037ms rtt min/avg/max/mdev = 4.187/55.759/1279.607/34.193 ms, pipe 2 Download the following package and install it : http://software.nautilus6.org/packages/zaurus/IPKS/usagi-tools_0.0.0-4_arm.ipk Then you can ping6 a computer from the zaurus. * Install konqueror (IPv6 compliant) Download the following packages and install them : http://software.nautilus6.org/packages/zaurus/IPKS/libstdc++2.10-glibc2.2_2.95.4-0.010407-fam1_arm.ipk http://software.nautilus6.org/packages/zaurus/IPKS/konqueror-ja_cvs20021215-1_arm.ipk Launch konqueror and access http://www.kame.net : you will see the dancing kame. * Install IPv6 ssh client : Download the following packages and install them : http://software.nautilus6.org/packages/zaurus/IPKS/openssh-client_3.6.1p1-rebuild_arm.ipk http://software.nautilus6.org/packages/zaurus/IPKS/openssh-addon_3.6.1p1-rebuild_arm.ipk Then try to connect to a remote host from the zaurus : $ ssh -6 @ Then try to copy a file to remote host from the zaurus (put the IPv6 address in square brackets) $ scp -6 /path/to/file @[ipv6_address]: 6. Livsix and mobility : ------------------------ * Edit livsix stack : ./livsix.sh stop * Edit livsix.sh file : If the zaurus starts in a foreign network, fill the following fileds : HOMEADDRESS= HOMEAGENT= If the zaurus starts in the Home Network, do not fill HOMEADDRESS field ! If the zaurus acts as a Home Agent, dot not fill neither the HOMEADDRESS fiel nor the HOMEAGENT field. You can now start livsix : ./livsix.sh start You can see the Binding Update list with the "./livconfig --bulist" command 7. IPv6 (and IPv4) Router [issues] ---------------------------------- * You need at least two network interfaces on the Zaurus. For exemple a wireless card (wlan0) and a ethernet card (eth0) * You can only configure set-up network device at the same time with the network software on the zaurus. The second device has to be configured by hand. * You can "wake-up" a device with the cardctl command. # cardctl status Socket 0: 3.3V 16-bit PC Card [suspended] Socket 1: no card # cardctl scheme CardResume checking: eth0 Changing scheme from 'CardSuspend' to 'CardResume'... # cardctl status Socket 0: 3.3V 16-bit PC Card function 0: [ready] Socket 1: no card * It has no connection with Livsix, but to set up an IPv4 router you can do the following : Configure interfaces : # ifconfig eth0 netmask Activate forwarding : # echo 1 > /proc/sys/net/ipv4/ip_forward * For an IPv6 router, first let's configure the Zaurus as a Router Advertisement sender : Start LIVSIX as usual : # ./livsix.sh start Configure the advertising interface (it is eth0 in this exemple) : # ifconfig eth0 inet6 add / Launch the zaurus as a router # echo 1 > /proc/sys/net/livsix/isrouter Advertise RAs : # echo > /proc/sys/net/livsix/conf/eth0/ra_prefix_00/ra_pfl_prefix # echo > /proc/sys/net/livsix/conf/eth0/ra_prefix_00/ra_pfl_prefixlen # echo 1 > /proc/sys/net/livsix/conf/eth0/ra_send_ras Please see "HOWTO use LIVSIX Router Advertisement (RA) Functions" for more informations. * RA are advertised, but the Zaurus does not act as a router :( The routing table is empty (netstat --inet6), we can fill it with the route command : # route --inet6 add / dev Once the routing table is filled, the Zaurus still does not forward packets. When the Zaurus receives a packet to forward, it sends first a Neighbor Sollicitation (NS) to the recipient, which replies with a Neighbor Advertisement, and then the zaurus does not forward the packet... and restart sending NA. 8. Bugs : --------- * The IPv6 routing table empty, before and after we launch the zaurus as a router with the following command : echo 1 > /proc/sys/net/livsix/isrouter * IPv6 routing does not work. * The Zaurus freezes when we try to eject a CF card, even if we stopped livsix and shutdown the network interface. * We cannot ping6 the ethernet device link-local address 9. Useful Links : ----------------- LIVSIX homepage : http://www.nal.motlabs.com/livsix/ Zaurus kernel sources : http://developer.ezaurus.com/sl_j/source/source_dl.htm Feed your Zaurus : http://www.killefiz.de/zaurus/ Documentations and IPv6-enabled software for Zaurus : http://software.nautilus6.org/zaurus.php Patches and documentations for livsix on zaurus : http://software.nautilus6.org/packages/zaurus/SL6000/LIVSIX-ZAURUS.tar.bz2 -- Any request or comment ? Please mail me : Romain KUNTZ kuntz@sfc.wide.ad.jp