Root/install/INSTALL-Ben

Source at commit b3b037e18d4ac2018cbef505b6ee3e01bfd24896 created 12 years 9 months ago.
By Werner Almesberger, TODO: update for switch to spi_atben
11. Obtain u-boot's mkimage
2
3    wget ftp://ftp.denx.de/pub/u-boot/u-boot-2009.11.tar.bz2
4    tar xfj u-boot-2009.11.tar.bz2
5    cd u-boot-2009.11
6    touch include/config.{h,mk}
7    make SUBDIRS=tools BIN_FILES-y=mkimage tools
8    cp tools/mkimage /usr/local/bin
9    cd ..
10
112. Build the kernel
12
13    git clone git://projects.qi-hardware.com/qi-kernel.git
14    cd qi-kernel
15    git checkout ben-wpan
16    cp ../ben-wpan-config-2.6.38 .config
17      patch -p1 -s <../openwrt-preinit-hack.patch
18  OWRT make ARCH=mips CROSS_COMPILE=mipsel-openwrt-linux- vmlinux.bin
19  Jlime make ARCH=mips CROSS_COMPILE=mipsel-linux- vmlinux.bin
20    gzip -9 -f arch/mips/boot/vmlinux.bin
21  OWRT mkimage -A mips -O linux -T kernel -a 0x80010000 \
22        -C gzip -e 0x`mipsel-openwrt-linux-nm vmlinux | \
23        grep " kernel_entry" | cut -f1 -d ' '` \
24        -n 'Ben NanoNote Linux Kernel' \
25        -d arch/mips/boot/vmlinux.bin.gz uImage
26  Jlime mkimage -A mips -O linux -T kernel -a 0x80010000 \
27        -C gzip -e 0x`mipsel-linux-nm vmlinux | \
28        grep " kernel_entry" | cut -f1 -d ' '` \
29        -n 'Ben NanoNote Linux Kernel' \
30        -d arch/mips/boot/vmlinux.bin.gz uImage
31    cd ..
32
333. Install the kernel
34
35    Using usbboot:
36
37    - remove battery and USB
38    - wait 15 seconds
39    - press the "U" key on the Ben
40    - insert USB while keeping "U" pressed
41    - release the "U" key
42    - on the host, run
43      usbboot -c "boot;nprog 1024 qi-kernel/uImage 0 0 -n"
44    - disconnect USB
45    - wait 15 seconds
46    - connect USB again
47
48   Using nandwrite:
49
50    - set up TCP/IP networking with the Ben
51    - get the Ben's IPv4 address:
52      NN=`ifconfig usb0 |
53      sed '/.*inet addr:\([^ ]*\).*/{s//\1/;s/100$/101/;s/200$/202/;p;};d'`
54      # should be NN=192.168.254.101 for OpenWRT,
55      # NN=192.168.1.202 for Jlime
56    - copy the kernel:
57      scp qi-kernel/uImage $NN:
58    - flash the kernel, clean up, and reboot:
59      ssh $NN 'PATH=$PATH:/usr/sbin;
60        flash_eraseall /dev/mtd1 && nandwrite -p /dev/mtd1 uImage &&
61        rm -f uImage && sync && sleep 1 && sync && sleep 1 &&
62        /sbin/reboot -f'
63    - press ^C to return to the shell
64
654. Set up the user space on the Ben
66
67    - connect to the Ben
68      ssh $NN
69    - run the following commands:
70  OWRT opkg install ip
71  OWRT opkg install ldconfig
72      mkdir -p /usr/local/var/run
73      exit
74
755. Build libnl-1 for cross-development and install the run-time library
76
77    wget http://www.infradead.org/~tgr/libnl/files/libnl-1.1.tar.gz
78    tar xfz libnl-1.1.tar.gz
79    cd libnl-1.1
80  OWRT gcc=`readlink -f \`which mipsel-openwrt-linux-gcc\``
81  OWRT ./configure --prefix=${gcc%/bin/*} --host=mipsel-openwrt-linux
82  Jlime patch -p1 -s <../libnl-1.1-limits.patch
83  Jlime inc=`mipsel-linux-cpp -v </dev/null 2>&1 | grep usr/include | tr -d \ `
84  Jlime ./configure --prefix=${inc%/include} --host=mipsel-linux
85    make
86    make install
87
88    scp lib/libnl.so.1.1 $NN:/usr/lib
89    ssh $NN /sbin/ldconfig
90    cd ..
91
926. Build the user space tools of the linux-zigbee project
93
94    wget http://ufpr.dl.sourceforge.net/project/linux-zigbee/linux-zigbee-sources/0.2.2/lowpan-tools-0.2.2.tar.gz
95    tar xfz lowpan-tools-0.2.2.tar.gz
96    cd lowpan-tools-0.2.2
97  OWRT ./configure --host=mipsel-openwrt-linux
98  JLime ./configure --host=mipsel-linux
99    make
100
101    scp src/iz src/izcoordinator src/izchat $NN:/usr/sbin/
102    cd ..
103
1047. Build dirtpan, a crude IPv4-over-IEEE 802.15.4 tunnel
105
106    git clone git://projects.qi-hardware.com/ben-wpan.git
107
108    # If compiling dirtpan.c fails due a missing ieee802145.h header,
109    # copy it over from lowpan-tools:
110
111    cp lowpan-tools-0.2.2/include/ieee802154.h tools/dirtpan/
112
113    cd ben-wpan/tools
114  OWRT make TARGET=ben_openwrt
115  OWRT make -C dirtpan TARGET=ben_openwrt
116  JLime make TARGET=ben_jlime
117  JLime make -C dirtpan TARGET=ben_jlime
118    scp dirtpan/dirtpan $NN:/usr/sbin
119

Archive Download this file



interactive