어허

[openwrt] sysupgrade 명령어 사용 본문

개발/Embedded

[openwrt] sysupgrade 명령어 사용

AKDK 2015. 10. 22. 18:53
728x90


기본적으로 openwrt를 바로 다운받아 이미지를 만들었다면 방화벽 설정이 되어있다.


iptables 명령어로확인가능


iptables -F
tftp -g 192.168.100.10 -r openwrt-ramips-rt305x-r9dj202-squashfs-sysupgrade.bin -l /tmp/sysupgrade.bin
sysupgrade -v /tmp/sysupgrade.bin



이미지파일을 플래쉬에 직접 write 할 수도 있는데

mtd -r write /tmp/openwrt-ar71xx-generic-wzr-hp-ag300h-squashfs-sysupgrade.bin firmware

이것은 firmware block에 바로 write하므로 config가 저장되지 않는다.


sysupgrade로 업그레이드 하면 자동으로 config파일들을 백업하고 복원한다.


보드 config 는 UCI 를 이용해서 관리.

git clone git://nbd.name/uci.git


로그


root@OpenWrt:/tmp# cd ..
root@OpenWrt:/# iptables -F
192.168.100.10 -r openwrt-ramips-rt305x-r9dj202-squashfs-sysupgrade.bin -l /tmp/sysupgrade.binroot@OpenWrt:/# tftp -g 192.168.100.10 -r openwrt-ramips-rt305x-r9dj202-squashfs
-sysupgrade.bin -l /tmp/sysupgrade.bin
root@OpenWrt:/# ls -l /tmp/sysupgrade.bin
-rw-r--r--    1 root     root       3145732 Oct 22 09:50 /tmp/sysupgrade.bin
root@OpenWrt:/# sysupgrade -v /tmp/sysupgrade.bin
Saving config files...
etc/config/alaveiw
etc/config/dhcp
etc/config/dropbear
etc/config/firewall
etc/config/network
etc/config/system
etc/config/wireless
etc/dnsmasq.conf
etc/dropbear/dropbear_rsa_host_key
etc/firewall.user
etc/group
etc/hosts
etc/inittab
etc/iproute2/rt_tables
etc/opkg.conf
etc/opkg/customfeeds.conf
etc/opkg/keys/49a1b6209b561933
etc/opkg/keys/af22f7a88858c8e9
etc/passwd
etc/ppp/chap-secrets
etc/ppp/filter
etc/ppp/options
etc/profile
etc/protocols
etc/rc.local
etc/services
etc/shadow
etc/shells
etc/sysctl.conf
etc/sysctl.d/local.conf
etc/sysupgrade.conf
killall: watchdog: no process killed
Sending TERM to remaining processes ... dnsmasq ubusd logd netifd odhcpd ntpd odhcp6c
Sending KILL to remaining processes ...
Switching to ramdisk...
Performing system upgrade...
Unlocking firmware ...

Writing from  to firmware ...
Appending jffs2 data from /tmp/sysupgrade.tgz to firmware...
Writing from  to firmware ...
Upgrade completed
Rebooting [12757.510000] reboot: Restarting system
�

U-Boot 1.1.3 (Apr 27 2015 - 11:54:55)

Board: Ralink APSoC DRAM:  32 MB
relocate_code Pointer at: 81fb4000
******************************


728x90

'개발 > Embedded' 카테고리의 다른 글

openwrt 에서 configuration 관리 툴  (0) 2015.10.19
[스크랩] i2c study  (0) 2011.11.09
"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."
공유하기 링크
Comments