|
This project try to implement a web failsafe mode in wr703n bootloader(u-boot). Most of the web failsafe code port from the https://dev.openwrt.org/browser/trunk/package/uboot-lantiq package.
I love the openwrt because it's use the bleeding edge package,so my project also should base on the latest u-boot source code,but it's need more time to do more work and test,so now i do it base on the u-boot in tp-link gpl release.some code maybe ugly,and not clean!But hope it's can work and useful for you.
If you want to compile the u-boot with web failsafe for wr703n from source code,just try below step(assume your compile host use x86/linux system):
1.check out the source code
svn checkout http://wr703n-uboot-with-web-failsafe.googlecode.com/svn/trunk/ wr703n-uboot-with-web-failsafe-read-only2.change to "wr703n-uboot-with-web-failsafe-read-only" directory:
cd wr703n-uboot-with-web-failsafe-read-only3.type "make"
makeyou will get the "tuboot.bin" in "wr703n-uboot-with-web-failsafe-read-only/u-boot" directory.
4.install you compiled u-boot from openwrt linux prompt,you can reference my install script(maybe you need some change base on it):
#! /bin/sh
#high chance need have a change ...
UBOOT_NAME=wr703n_tuboot_test_2012_06_06.bin
MD5SUM_SHOULD_BE="623dc0bba6fab68c22e5fb2f329d7d09"
UBOOT_IMAGE_URL=192.168.1.2
wget http://$UBOOT_IMAGE_URL/$UBOOT_NAME
#need check the md5sum,any one byte in bootloader shoud right ...
CURRENT_MD5SUM_VAL=$( md5sum $UBOOT_NAME |awk '{print $1 }' )
echo "$UBOOT_NAME md5sum : $CURRENT_MD5SUM_VAL"
if [ $MD5SUM_SHOULD_BE = $CURRENT_MD5SUM_VAL ]; then
echo "$UBOOT_NAME md5sum check pass"
else
echo "###############$UBOOT_NAME md5sum check fail###############"
exit
fi
RAW_UBOOT_LEN=`wc -c $UBOOT_NAME | awk '{print $1 }'`
NEED_PAD_LEN=$((0x1fc00-$RAW_UBOOT_LEN))
#Generate a file used as pad ...
dd if=/dev/zero of=pad.bin bs=1 count=$NEED_PAD_LEN
cat $UBOOT_NAME pad.bin >tuboot_0x1fc00.bin
echo "Backup some config first,just like MAC address ..."
dd if=/dev/mtd0 of=./config.bin bs=1 skip=$((0x1fc00))
cat ./tuboot_0x1fc00.bin ./config.bin >uboot_0x20000.bin
cat uboot_0x20000.bin >/dev/mtdblock0
sync
I use the cross-toolchain generated by the openwrt buildroot.
When you push the button on wr703n and power on(before this you need connect the ethernet cable between PC and wr703n),you first will see the LED on one second and then off,and you need push the button until the LED on again,now you can release the button,set your PC to 192.168.1.2,and web view 192.168.1.1,you will see the failsafe page.
|
|