Differences

This shows you the differences between two versions of the page.

doc:howto:generic.sysupgrade [2012/10/11 16:22]
wintermutepi
doc:howto:generic.sysupgrade [2013/06/15 14:35] (current)
lorema
Line 5: Line 5:
===== Terminal Upgrade Process ===== ===== Terminal Upgrade Process =====
-  - you should check how much RAM you have currently available<code>free</code>. In case you do not have enough left, consult [[#Free up RAM]]. +  - You should check how much RAM you have currently available:<code>free</code> In case you do not have enough left, consult [[#Free up RAM]]. 
-  - populate your ''[[doc/howto/notuci.config#etcsysupgrade.conf|/etc/sysupgrade.conf]]'' +  - Populate your ''[[doc/howto/notuci.config#etcsysupgrade.conf|/etc/sysupgrade.conf]]'' 
-  - obtain suitable OpenWrt firmware image (trunk or stable):<code>+  - Obtain suitable OpenWrt firmware image (trunk or stable):<code>
cd /tmp cd /tmp
wget http://downloads.openwrt.org/snapshots/trunk/PLATFORM/xxx-sysupgrade.bin wget http://downloads.openwrt.org/snapshots/trunk/PLATFORM/xxx-sysupgrade.bin
wget http://downloads.openwrt.org/snapshots/trunk/PLATFORM/md5sums</code> wget http://downloads.openwrt.org/snapshots/trunk/PLATFORM/md5sums</code>
-| {{:meta:icons:tango:dialog-information.png|}} | Please note: trunk now = Openwrt 12.09-beta/, see https://dev.openwrt.org/ticket/12286 |+Some brief things to consider: If you are attempting this on a system with an extroot configured, 
 +you will need to reinstall your packages after the sysupgrade. So before you upgrade, take some consideration and follow a few extra steps. 
 +I recommend to make a quick list of the packages you had installed:
-  - check the integrity of the image file:<code> +<code> 
-md5sum -c md5sums+opkg list-installed > /etc/installed-pkgs 
 +</code> 
 + 
 +  - check the integrity of the image file: 
 +<code> 
 +md5sum -c md5sums 2> /dev/null | grep OK 
 +or alternatively 
 +cat md5sums | grep mr3420 | md5sum -c
</code> When it says something like ''md5sum: WARNING: 195 of 196 computed checksums did NOT match'' it means the only one you downloaded did match ;-) </code> When it says something like ''md5sum: WARNING: 195 of 196 computed checksums did NOT match'' it means the only one you downloaded did match ;-)
-  - use the following commands to upgrade:<code>+  - use the following command to upgrade:<code>
sysupgrade -v /tmp/openwrt-ar71xx-generic-wzr-hp-ag300h-squashfs-sysupgrade.bin</code> sysupgrade -v /tmp/openwrt-ar71xx-generic-wzr-hp-ag300h-squashfs-sysupgrade.bin</code>
  * The verbose-option should give some output similar to this:<code>   * The verbose-option should give some output similar to this:<code>
Line 62: Line 71:
Rebooting system... Rebooting system...
</code> </code>
-  * After the automatic reboot, the system should come up with the same network IP addresses, same dropbear password, etc. It is however possible that it does not. In that case, try a [[wp>Booting#Hard_reboot|cold reset]] (= interrupt the electrical current to the device, wait a couple of seconds and then connect it again.) +  * After the automatic reboot, the system should come up with the same network IP addresses, same dropbear password, etc. It is however possible that it does not. In that case, try a [[wp>Booting#Hard_reboot|cold reset]] (= interrupt the electrical current to the device, wait a couple of seconds and then connect it again).
  * After the cold reboot, you should gain access and here you could check things out:<code bash>   * After the cold reboot, you should gain access and here you could check things out:<code bash>
dmesg dmesg
Line 69: Line 78:
... ...
</code> </code>
-  * You do need to reinstall opkg-packages:<code sh>+ 
 +  * You do need to reinstall opkg-packages:<code>
opkg update opkg update
opkg install tc iptables-mod-ipopt wol opkg install tc iptables-mod-ipopt wol
</code> </code>
 +optional EXTROOT notes continued...
 +I use a USB flash drive for my extroot.  Modify as needed if you are using a different medium.  Of course you'll want to setup your extroot
 +before reinstalling all of your packages.  fdisk is optional, but can be useful if you do not remember your partitioning schema.
-| {{:meta:icons:tango:48px-dialog-warning.svg.png?nolink}} | For unknown reasons such a cold reset has often reported to be necessary after a sysupgrade. This is very very bad in case you performed this remotely!  |+<code> 
 +opkg install blockmount 
 +opkg install kmod-usb-storage 
 +opkg install kmod-fs-ext4 
 +opkg install e2fsprogs 
 +opkg install kmod-scsi-generic 
 +opkg install fdisk 
 +opkg install nano 
 +</code> 
 + 
 +You'll need to modify /etc/config/fstab again per instructions in [[http://wiki.openwrt.org/doc/howto/extroot]] 
 + 
 +I am using this for example: 
 + 
 +<code> 
 +config mount 
 +        option target        /overlay 
 +        option device        /dev/sda1 
 +        option fstype        ext4 
 +        option options      rw,sync 
 +        option enabled      1 
 +        option enabled_fsck  0 
 +</code> 
 + 
 +Which is working well on my current trunk r36141.  Do not use on revisions earlier than r25787 
 + 
 +Now mount your device and copy the overlay to it, enable fstab so it mounts on startup and reboot 
 + 
 +<code> 
 +mkdir /mnt/sda1 
 +mount /dev/sda1 /mnt/sda1 
 +tar -C /overlay -cvf - . | tar -C /mnt/sda1 -xf - 
 +/etc/init.d/fstab enable 
 +reboot 
 +</code> 
 + 
 +Once the device is running again, check to see that your extroot is mounted.  My storage medium again is USB flash drive 8GB. 
 + 
 +<code> 
 +root@OpenWrt:~# df -h 
 +Filesystem                Size      Used Available Use% Mounted on 
 +rootfs                    7.2G    58.0M      6.8G  1% / 
 +/dev/root                1.8M      1.8M        0 100% /rom 
 +tmpfs                    30.0M    472.0K    29.6M  2% /tmp 
 +tmpfs                  512.0K        0    512.0K  0% /dev 
 +/dev/sda1                7.2G    58.0M      6.8G  1% /overlay 
 +overlayfs:/overlay        7.2G    58.0M      6.8G  1% / 
 + 
 +root@OpenWrt:~# mount 
 +rootfs on / type rootfs (rw) 
 +/dev/root on /rom type squashfs (ro,relatime) 
 +proc on /proc type proc (rw,noatime) 
 +sysfs on /sys type sysfs (rw,noatime) 
 +tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime) 
 +tmpfs on /dev type tmpfs (rw,noatime,size=512k,mode=755) 
 +devpts on /dev/pts type devpts (rw,noatime,mode=600) 
 +/dev/sda1 on /overlay type ext4 (rw,sync,relatime,data=ordered) 
 +overlayfs:/overlay on / type overlayfs (rw,noatime,lowerdir=/,upperdir=/overlay) 
 +debugfs on /sys/kernel/debug type debugfs (rw,noatime) 
 +</code> 
 + 
 +Now update package cache and reinstall your packages based on the list you made before.  The cut command cleans the version numbers from the list.  Pay careful attention to any errors at the end of the operation.  The only ones I encountered were due to saved configuration files. 
 + 
 +<code> 
 +opkg update 
 +opkg install $(cat /etc/installed-pkgs | cut -d' ' -f 1 ) 
 +</code> 
 + 
 +Note that you can preserve scripts, settings, and documents across sysupgrade by putting them in a directory in /etc/config.  Otherwise, most will be lost. 
 + 
 +| {{:meta:icons:tango:48px-dialog-warning.svg.png?nolink}} | For unknown reasons such a cold reset has often been reported to be necessary after a sysupgrade. This is very very bad in case you performed this remotely!  |
===== LuCI Web Upgrade Process ===== ===== LuCI Web Upgrade Process =====
Line 161: Line 244:
  * drop caches:<code>   * drop caches:<code>
echo 3 > /proc/sys/vm/drop_caches</code> echo 3 > /proc/sys/vm/drop_caches</code>
-  * prevent [[wireless.essentials|wireless drivers]] to be loaded at next boot and then reboot:<code>+  * prevent wireless drivers to be loaded at next boot and then reboot:<code>
rm /etc/modules.d$/*80211* rm /etc/modules.d$/*80211*
rm /etc/modules.d$/*ath9k* rm /etc/modules.d$/*ath9k*
Line 169: Line 252:
The wireless drivers, usually take up quite some amount of RAM and are not required (unless you are connected via wireless of course ;-)), so an easy way to free up some RAM is to delete the symlinks in ''etc/modules.d'' so these are not loaded into memory at the next reboot: The wireless drivers, usually take up quite some amount of RAM and are not required (unless you are connected via wireless of course ;-)), so an easy way to free up some RAM is to delete the symlinks in ''etc/modules.d'' so these are not loaded into memory at the next reboot:
 +
 +===== Keep config files =====
 +Add installed-pkgs to preserved files
 +<code>
 +echo /etc/installed-pkgs >> /etc/sysupgrade.conf
 +</code>
 +
 +Verify backup configuration
 +<code>
 +sysupgrade -b - | tar -tzv
 +</code>
===== Notes ===== ===== Notes =====
  * [[doc/techref/sysupgrade|Sysupgrade – Technical Reference]]   * [[doc/techref/sysupgrade|Sysupgrade – Technical Reference]]

Back to top

doc/howto/generic.sysupgrade.1349965354.txt.bz2 · Last modified: 2012/10/11 16:22 by wintermutepi