2011-03-29 13:51:07 +03:00
|
|
|
1. Obtain u-boot's mkimage
|
|
|
|
|
|
|
|
wget ftp://ftp.denx.de/pub/u-boot/u-boot-2009.11.tar.bz2
|
|
|
|
tar xfj u-boot-2009.11.tar.bz2
|
|
|
|
cd u-boot-2009.11
|
|
|
|
touch include/config.{h,mk}
|
|
|
|
make SUBDIRS=tools BIN_FILES-y=mkimage tools
|
|
|
|
cp tools/mkimage /usr/local/bin
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
2. Build the kernel
|
|
|
|
|
|
|
|
git clone git://projects.qi-hardware.com/qi-kernel.git
|
|
|
|
cd qi-kernel
|
|
|
|
git checkout ben-wpan
|
|
|
|
cp ../ben-wpan-config-2.6.38 .config
|
2011-10-25 09:26:04 +03:00
|
|
|
patch -p1 -s < ../qi_lb60-NAND-add-data-partition.patch
|
2011-03-29 13:51:07 +03:00
|
|
|
OWRT make ARCH=mips CROSS_COMPILE=mipsel-openwrt-linux- vmlinux.bin
|
|
|
|
Jlime make ARCH=mips CROSS_COMPILE=mipsel-linux- vmlinux.bin
|
2011-03-29 15:51:51 +03:00
|
|
|
gzip -9 -f arch/mips/boot/vmlinux.bin
|
|
|
|
OWRT mkimage -A mips -O linux -T kernel -a 0x80010000 \
|
2011-03-29 13:51:07 +03:00
|
|
|
-C gzip -e 0x`mipsel-openwrt-linux-nm vmlinux | \
|
|
|
|
grep " kernel_entry" | cut -f1 -d ' '` \
|
|
|
|
-n 'Ben NanoNote Linux Kernel' \
|
|
|
|
-d arch/mips/boot/vmlinux.bin.gz uImage
|
2011-03-29 15:51:51 +03:00
|
|
|
Jlime mkimage -A mips -O linux -T kernel -a 0x80010000 \
|
|
|
|
-C gzip -e 0x`mipsel-linux-nm vmlinux | \
|
|
|
|
grep " kernel_entry" | cut -f1 -d ' '` \
|
|
|
|
-n 'Ben NanoNote Linux Kernel' \
|
|
|
|
-d arch/mips/boot/vmlinux.bin.gz uImage
|
2011-03-29 13:51:07 +03:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
3. Install the kernel
|
|
|
|
|
2011-10-25 09:26:04 +03:00
|
|
|
Using u-boot without reflash:
|
|
|
|
|
|
|
|
- set up TCP/IP networking with the Ben
|
|
|
|
- copy uImage to Ben /boot/uImage
|
|
|
|
- hold F4 when poweron
|
|
|
|
|
2011-03-29 13:51:07 +03:00
|
|
|
Using usbboot:
|
|
|
|
|
|
|
|
- remove battery and USB
|
|
|
|
- wait 15 seconds
|
|
|
|
- press the "U" key on the Ben
|
|
|
|
- insert USB while keeping "U" pressed
|
|
|
|
- release the "U" key
|
|
|
|
- on the host, run
|
|
|
|
usbboot -c "boot;nprog 1024 qi-kernel/uImage 0 0 -n"
|
|
|
|
- disconnect USB
|
|
|
|
- wait 15 seconds
|
|
|
|
- connect USB again
|
|
|
|
|
|
|
|
Using nandwrite:
|
|
|
|
|
|
|
|
- set up TCP/IP networking with the Ben
|
|
|
|
- get the Ben's IPv4 address:
|
|
|
|
NN=`ifconfig usb0 |
|
|
|
|
sed '/.*inet addr:\([^ ]*\).*/{s//\1/;s/100$/101/;s/200$/202/;p;};d'`
|
2011-03-29 15:51:51 +03:00
|
|
|
# should be NN=192.168.254.101 for OpenWRT,
|
|
|
|
# NN=192.168.1.202 for Jlime
|
2011-03-29 13:51:07 +03:00
|
|
|
- copy the kernel:
|
|
|
|
scp qi-kernel/uImage $NN:
|
|
|
|
- flash the kernel, clean up, and reboot:
|
|
|
|
ssh $NN 'PATH=$PATH:/usr/sbin;
|
|
|
|
flash_eraseall /dev/mtd1 && nandwrite -p /dev/mtd1 uImage &&
|
|
|
|
rm -f uImage && sync && sleep 1 && sync && sleep 1 &&
|
|
|
|
/sbin/reboot -f'
|
2011-03-29 15:51:51 +03:00
|
|
|
- press ^C to return to the shell
|
2011-03-29 13:51:07 +03:00
|
|
|
|
|
|
|
4. Set up the user space on the Ben
|
|
|
|
|
2011-03-29 15:51:51 +03:00
|
|
|
- connect to the Ben
|
|
|
|
ssh $NN
|
|
|
|
- run the following commands:
|
|
|
|
OWRT opkg install ip
|
|
|
|
OWRT opkg install ldconfig
|
|
|
|
mkdir -p /usr/local/var/run
|
|
|
|
exit
|
2011-03-29 13:51:07 +03:00
|
|
|
|
|
|
|
5. Build libnl-1 for cross-development and install the run-time library
|
|
|
|
|
|
|
|
wget http://www.infradead.org/~tgr/libnl/files/libnl-1.1.tar.gz
|
|
|
|
tar xfz libnl-1.1.tar.gz
|
|
|
|
cd libnl-1.1
|
2011-03-29 15:51:51 +03:00
|
|
|
OWRT gcc=`readlink -f \`which mipsel-openwrt-linux-gcc\``
|
2011-03-29 13:51:07 +03:00
|
|
|
OWRT ./configure --prefix=${gcc%/bin/*} --host=mipsel-openwrt-linux
|
2011-03-29 15:51:51 +03:00
|
|
|
Jlime patch -p1 -s <../libnl-1.1-limits.patch
|
|
|
|
Jlime inc=`mipsel-linux-cpp -v </dev/null 2>&1 | grep usr/include | tr -d \ `
|
|
|
|
Jlime ./configure --prefix=${inc%/include} --host=mipsel-linux
|
2011-03-29 13:51:07 +03:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
|
|
|
|
scp lib/libnl.so.1.1 $NN:/usr/lib
|
|
|
|
ssh $NN /sbin/ldconfig
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
6. Build the user space tools of the linux-zigbee project
|
|
|
|
|
2011-07-05 13:24:59 +03:00
|
|
|
git clone git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee/linux-zigbee
|
|
|
|
cd linux-zigbee
|
|
|
|
OWRT ./autogen.sh --host=mipsel-openwrt-linux
|
|
|
|
JLime ./autogen.sh --host=mipsel-linux
|
2011-03-29 13:51:07 +03:00
|
|
|
make
|
|
|
|
|
|
|
|
scp src/iz src/izcoordinator src/izchat $NN:/usr/sbin/
|
2011-05-12 23:07:01 +03:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
7. Build dirtpan, a crude IPv4-over-IEEE 802.15.4 tunnel
|
|
|
|
|
|
|
|
git clone git://projects.qi-hardware.com/ben-wpan.git
|
|
|
|
|
|
|
|
# If compiling dirtpan.c fails due a missing ieee802145.h header,
|
|
|
|
# copy it over from lowpan-tools:
|
|
|
|
|
|
|
|
cp lowpan-tools-0.2.2/include/ieee802154.h tools/dirtpan/
|
|
|
|
|
|
|
|
cd ben-wpan/tools
|
|
|
|
OWRT make TARGET=ben_openwrt
|
|
|
|
OWRT make -C dirtpan TARGET=ben_openwrt
|
|
|
|
JLime make TARGET=ben_jlime
|
|
|
|
JLime make -C dirtpan TARGET=ben_jlime
|
|
|
|
scp dirtpan/dirtpan $NN:/usr/sbin
|