openwrt升级命令

来源:互联网 发布:nginx tcp反向代理 编辑:程序博客网 时间:2024/05/18 17:43

用shell更新固件,脱离luci。

这样可以winscp传入固件,也可以用lan的时候wget获取。

使用

  • 使用命令:
sysupgrade xxx.bin
  • 用法说明:

root@OpenWrt:~# sysupgrade -h Usage: /sbin/sysupgrade [options]
Options:

  • -d add a delay before rebooting
  • -f restore configuration from .tar.gz (file or url)
  • -i interactive mode
  • -b / –create-backup
    create .tar.gz of files specified in sysupgrade.conf
    then exit. Does not flash an image. If file is ‘-’,
    i.e. stdout, verbosity is set to 0 (i.e. quiet).
  • -n do not save configuration over reflash
  • -q less verbose
  • -v more verbose
  • -h / –help display this help

简化流程

  • 先配置lan
  • wget下载最新固件
  • sysupgrade 进行保留配置更新
  • 无论如何都会丢失软件包-重装。

经验

        root@OpenWrt:~# sysupgrade /tmp/openwrt-ar71xx-generic-tl-mr11u-v1-squashfs-sysupgrade_6.09.binSaving config files...Sending TERM to remaining processes ... crond dnsmasq ser2net ntpd syslogd klogd hotplug2 ubusd netifd Sending KILL to remaining processes ... Switching to ramdisk...Performing system upgrade...Unlocking firmware ... Writing from <stdin> to firmware ...  [w]Appending jffs2 data from /tmp/sysupgrade.tgz to firmware...TRX header not foundError fixing up TRX header Upgrade completedRebooting system...

刷机过程

1.用telnet进入,passwd修改默认密码比如fuckyou,然后路由器会自动ssh模式,此时telnet会开始无效,以后ssh登录路由器的时候带上id(ssh root@192.168.1.1,否则是不会以当前用户id进入的,mac里会这样)。

2.下载WINSCP 
用scp协议连接到路由器,(有个麻烦对话框可以关闭查找用户组),然后上传文件到tmp。

3.用winscp里的打开终端,sysupgrade /tmp/openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-sysupgrade.bin
直接开始刷固件。

4.若干秒后,刷机完成。

见识

堂西滴小五遇到Opkg 内核不正确实践成功: ===求个WR703n v1.6版本能用的带luci的openwrt - OPENWRT专版 - 恩山WIFI论坛 - Powered by Discuz! 沿途见识 [1]===

1.下载文件:
http://downloads.openwrt.org/sna ... quashfs-factory.bin
http://downloads.openwrt.org/sna ... shfs-sysupgrade.bin


2.在openwrt下恢复固件(或使用AUTOTTL恢复固件):
>cd /tmp
>wget http://ip/*.bin
>mtd -r write *.bin firmware

3.更新openwrt固件(从第版本升级到高版本):
>cd /tmp
>wget http://ip/*.bin
>sysupgrade -i /tmp/*.bin

4.用PUTTY登陆telnet,进行地址配置:(vi /etc/config/network)
>config interface 'lan'
>        option ifname 'eth0'
>        option proto 'static'
>        option ipaddr '192.168.1.105'
>        option netmask '255.255.255.0'
>        option gateway '192.168.1.1'
>        option dns '192.168.1.1'

5.应用ip配置更改:
>/etc/init.d/network restart

6.更新opkg:
>opkg update

7.安装luci:
>opkg install luci
启动luci:
>/etc/init.d/uhttpd enable
>/etc/init.d/uhttpd start

8.安装usb支持:
>opkg install kmod-fs-ext4
>opkg install kmod-usb-storage
>opkg install block-mount

引用信息

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