Root/install/INSTALL-Ben

Source at commit 153b9e3af84f275e21d9e34e7c8afd90f5294da5 created 12 years 5 months ago.
By Xiangfu, INSTALL-Ben: update
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 < ../qi_lb60-NAND-add-data-partition.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 u-boot without reflash:
36
37    - set up TCP/IP networking with the Ben
38    - copy uImage to Ben /boot/uImage
39    - hold F4 when poweron
40
41    Using usbboot:
42
43    - remove battery and USB
44    - wait 15 seconds
45    - press the "U" key on the Ben
46    - insert USB while keeping "U" pressed
47    - release the "U" key
48    - on the host, run
49      usbboot -c "boot;nprog 1024 qi-kernel/uImage 0 0 -n"
50    - disconnect USB
51    - wait 15 seconds
52    - connect USB again
53
54   Using nandwrite:
55
56    - set up TCP/IP networking with the Ben
57    - get the Ben's IPv4 address:
58      NN=`ifconfig usb0 |
59      sed '/.*inet addr:\([^ ]*\).*/{s//\1/;s/100$/101/;s/200$/202/;p;};d'`
60      # should be NN=192.168.254.101 for OpenWRT,
61      # NN=192.168.1.202 for Jlime
62    - copy the kernel:
63      scp qi-kernel/uImage $NN:
64    - flash the kernel, clean up, and reboot:
65      ssh $NN 'PATH=$PATH:/usr/sbin;
66        flash_eraseall /dev/mtd1 && nandwrite -p /dev/mtd1 uImage &&
67        rm -f uImage && sync && sleep 1 && sync && sleep 1 &&
68        /sbin/reboot -f'
69    - press ^C to return to the shell
70
714. Set up the user space on the Ben
72
73    - connect to the Ben
74      ssh $NN
75    - run the following commands:
76  OWRT opkg install ip
77  OWRT opkg install ldconfig
78      mkdir -p /usr/local/var/run
79      exit
80
815. Build libnl-1 for cross-development and install the run-time library
82
83    wget http://www.infradead.org/~tgr/libnl/files/libnl-1.1.tar.gz
84    tar xfz libnl-1.1.tar.gz
85    cd libnl-1.1
86  OWRT gcc=`readlink -f \`which mipsel-openwrt-linux-gcc\``
87  OWRT ./configure --prefix=${gcc%/bin/*} --host=mipsel-openwrt-linux
88  Jlime patch -p1 -s <../libnl-1.1-limits.patch
89  Jlime inc=`mipsel-linux-cpp -v </dev/null 2>&1 | grep usr/include | tr -d \ `
90  Jlime ./configure --prefix=${inc%/include} --host=mipsel-linux
91    make
92    make install
93
94    scp lib/libnl.so.1.1 $NN:/usr/lib
95    ssh $NN /sbin/ldconfig
96    cd ..
97
986. Build the user space tools of the linux-zigbee project
99
100    git clone git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee/linux-zigbee
101    cd linux-zigbee
102  OWRT ./autogen.sh --host=mipsel-openwrt-linux
103  JLime ./autogen.sh --host=mipsel-linux
104    make
105
106    scp src/iz src/izcoordinator src/izchat $NN:/usr/sbin/
107    cd ..
108
1097. Build dirtpan, a crude IPv4-over-IEEE 802.15.4 tunnel
110
111    git clone git://projects.qi-hardware.com/ben-wpan.git
112
113    # If compiling dirtpan.c fails due a missing ieee802145.h header,
114    # copy it over from lowpan-tools:
115
116    cp lowpan-tools-0.2.2/include/ieee802154.h tools/dirtpan/
117
118    cd ben-wpan/tools
119  OWRT make TARGET=ben_openwrt
120  OWRT make -C dirtpan TARGET=ben_openwrt
121  JLime make TARGET=ben_jlime
122  JLime make -C dirtpan TARGET=ben_jlime
123    scp dirtpan/dirtpan $NN:/usr/sbin
124

Archive Download this file



interactive