小R科技-WIFI机器人网·机器人创意工作室

 找回密码
 立即注册
查看: 6993|回复: 1

编译刷不死的openwrt uboot

[复制链接]
发表于 2013-5-19 00:54:57 | 显示全部楼层 |阅读模式
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.
回复

使用道具 举报

发表于 2013-5-19 12:17:58 | 显示全部楼层
不懂,,,,等解释
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

新品特惠推荐上一条 /2 下一条

QQ|QQ技术咨询1|QQ技术咨询2|商务合作微信1:xiaorgeek001|商务合作微信2:XiaoRGEEK|诚聘英才|Archiver|手机版|小R科技-WIFI机器人网·机器人创意工作室 ( 粤ICP备15000788号-6 )

GMT+8, 2024-5-22 02:42 , Processed in 1.078623 second(s), 18 queries .

Powered by XiaoR GEEK X3.4

© 2014-2021 XiaoR GEEK

快速回复 返回顶部 返回列表