OpenWRT/sysupgrade

From Segfault
Jump to: navigation, search

Upgrade

Preparation:

cd /root
opkg list-changed-conffiles                                                   # Check and maybe add additional files to /etc/sysupgrade.conf
opkg list-installed | awk '{print $1}' | sort > opkg_installed
awk '/^Package:/ {PKG= $2} /^Status: .*user installed/ {print PKG}' /usr/lib/opkg/status | sort > status_installed

After backing up the device once more, start the actual upgrade over a wired connection using the correct image and after verifying its checksum:

sysupgrade -v /tmp/*sysupgrade.bin

Postinstall:

opkg list-installed | sort > foo
for p in `awk '!/^lib/ {print $1}' opkg_installed`; do grep -qw $p foo || echo "to be installed: $p"; done

opkg install diffutils
find /etc -name "*opkg"                  

Once these packages have been installed, enable all needed services again:

for s in haveged snmpd vnstat; do /etc/init.d/$s enable; done
for s in haveged snmpd vnstat; do /etc/init.d/$s start; done

Log

root@vortex:/tmp# sysupgrade -v ./openwrt-ar71xx-generic-wndr3800-squashfs-sysupgrade.bin 
Saving config files...
root/iptables-ternet.sh
root/foo
root/backup/uci-show.txt
root/backup/uci-export.txt
root/backup/opkg-installed.txt
root/backup.sh
root/.ssh/known_hosts
root/.iftoprc
root/   
etc/sysupgrade.conf
etc/sysctl.conf
etc/shells
etc/shadow
etc/rc.local
etc/profile
etc/passwd
etc/nrpe.cfg
etc/inittab
etc/hosts
etc/group
etc/firewall.user
etc/dropbear/dropbear_rsa_host_key
etc/dropbear/dropbear_dss_host_key
etc/dropbear/authorized_keys
etc/dnsmasq.conf
etc/crontabs/root
etc/config/wireless
etc/config/vnstat
etc/config/uhttpd
etc/config/ucitrack
etc/config/ubootenv
etc/config/system
etc/config/radvd
etc/config/qos
etc/config/network
etc/config/mini_snmpd
etc/config/luci
etc/config/firewall
etc/config/dropbear
etc/config/dhcp
etc/config/ddns
Sending TERM to remaining processes ... dynamic_dns_upd sleep crond mini_snmpd radvd radvd uhttpd xinetd dnsmasq nrpe ntpd syslogd klogd hotplug2 ubusd netifd 
Sending KILL to remaining processes ... uhttpd 
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 found
Error fixing up TRX header
    
Upgrade completed
Rebooting system...

Links