openwrt怎么升级固件?使用命令sysupgrade实现openwrt升级固件
使用openwrt的小伙伴越来越多,大家比较熟悉的一般是用luci网页升级,其中会有很多使用openwrt的小伙伴来问:openwrt用命令怎么升级固件?今天就来说说通过命令sysupgrade实现openwrt升级固件,脱离luci用命令行更新固件。 使用命令行实现openwrt升级固件:
1、使用mobaxterm(等ssh终端工具登录,passwd修改默认密码比如abcabc,然后路由器会自动ssh模式,然后用ssh登录路由器的(命令ssh root@192.168.1.1--- 您的openwrt IP)。
2、使用winSCP,准备好要刷的固件,然后用scp协议连接到路由器,然后上传固件文件到tmp文件夹中。
3、上传完成后,在ssh终端输入命令 sysupgrade /tmp/openwrt-squashfs-sysupgrade.bin(这个.bin文件是你之前上传到tmp文件夹的固件,这个命令中的固件名称也要改成你实际上传的固件名称来使用) 不清楚sysupgrade怎么用可以先全用命令sysupgrade --help 查看用法: sysupgrade --help
Usage: /sbin/sysupgrade [<upgrade-option>...] <image file or URL>
/sbin/sysupgrade [-q] [-i] <backup-command> <file>
upgrade-option:
-d <delay> add a delay before rebooting
-f <config> restore configuration from .tar.gz (file or url)
-i interactive mode
-c attempt to preserve all changed files in /etc/
-n do not save configuration over reflash
-T | --test
Verify image and config .tar.gz but do not actually flash.
-F | --force
Flash image even if image checks fail, this is dangerous!
-q less verbose
-v more verbose
-h | --help display this help
backup-command:
-b | --create-backup <file>
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).
-r | --restore-backup <file>
restore a .tar.gz created with sysupgrade -b
then exit. Does not flash an image. If file is '-',
the archive is read from stdin.
-l | --list-backup
list the files that would be backed up when calling
sysupgrade -b. Does not create a backup file.
4、直接开始刷固件,等待刷机完成。升级完成后,系统会自动重启.......
|