Openwrt Uboot燒寫

 

Openwrt 燒uboot 須要慎重,通常買一個帶不死uboot的路由器再折騰會比較安全,由於html

openwrt firmware對uboot分區進行了保護,並且帶有不死uboot的路由器能夠經過web界面刷firmware。git

 

傳說中的不死uboot 原版能夠見下面的網址:github

https://github.com/pepe2k/u-boot_modweb

 

 

那麼uboot是如何燒寫的呢?我總結了下圖:編程

 

這裏總結了4個方法,前兩個方法是openwrt還能開起來的時候,後兩個辦法是openwrt掛掉的時候用的。安全

 

 

第1個方法是經過SSH鏈接來將firmware放入到可寫的文件系統,而且用命令將其刷人。ssh

由於SSH支持文件的傳輸,用winscp+putty能夠搞定。ide

 

第2個方法經過在電腦上搭建了一個http server,用ssh命令讓openwrt從電腦上下載到firmware到板子上可寫的文件系統,ui

而且用命令將其刷人。this

 

第3個方法須要拆路由器,經過TTL線用命令讓路由器從電腦上拿uboot,而且用命令刷入uboot

 

第4個方法是不死uboot的方法,這裏的「不死」的意思其實是不用拆機來恢復openwrt,

這樣大大方便了倒騰的過程。這個uboot通常帶有一個友好的web界面,經過HTTP將uboot文件上傳到路由器。

 

 

固然了,若是連uboot都掛掉了,那麼只能經過其餘方法刷openwrt了(好比拆下flash直接刷),下面是一個例子:

http://blog.chinaunix.net/uid-27194309-id-3405021.html

 在這裏(https://github.com/pepe2k/u-boot_mod)提到了如何恢復:

My device does not boot after upgrade!

I told you... bootloader, in this case U-Boot, is the most important piece of code inside your device. It is responsible for hardware initialization and booting an OS (kernel in this case), i.e. it's the bridge head for delegating to / flashing kernel and rootfs images. So, if during the upgrade something went wrong, your device will not boot any more. The only way to recover from such a situation in a mild way is via a JTAG adapter connection. In case of a lack of JTAG connection, you would even need to remove the FLASH chip, load proper image using an external programmer and solder it back.

能夠看到,若是uboot都壞了,那麼只能將flash拆下,用編程器刷flash,或者使用JTAG鏈接到路由器。這些設備都須要額外購買,

並且有些路由器也不支持JTAG,因此刷uboot要慎重。

 

 

若是你對路由器上面的文件系統有疑惑,那麼請看openwrt的官方文檔:

http://wiki.openwrt.org/zh-cn/doc/techref/flash.layout

我這裏只是介紹了一些大致的概念,具體刷uboot的操做能夠看這裏:

http://www.right.com.cn/forum/thread-154561-1-1.html

相關文章
相關標籤/搜索