Sysupgrade help for x86_64

I prefer having 2 separate SD Cards for the alternating installation on my x86 OpenWRT. Currently using 2x 32GB (smaller cards practically aren‘t really cheaper) and just leaving 99% on each card empty, not bothering the effort to repartition OpenWRT after applying the image.

I have an additional SSD attached, used as data-only drive, used as OpenWRT-hosted SMB file share. This way, I do not need to touch the data SSD, when upgrading OpenWRT, as OpenWRT goes onto the SD Cards only. So no migration effort for the data and no extra risk of damaging data, if the update would go south.

2x USB sticks would also do it instead of SD. Yet I prefer SD Cards: Several vendors offer write-durability enhanced SD Cards (I guess they only bin the better SD cards and sell them for a slightly higher price). They are not reasonably more expensive, so I got those. I have seen enough cheap USB sticks malfunctioning after a few weeks and I dont want to waste extra lifetime with such issues on a 24x7 router.

The BIOS on my x86 OpenWRT automatically boots from any attached USB stick/SD Card in any of its USB slots (I have a regular PC mainboard in my x86 OpenWRT and use an thumbsized SD Card adapter in one of its external USB ports on the back, so I can easily switch SD cards without opening the device.

When updating OpenWRT, I go like this:

  1. Download and apply the new OpenWRT image via my work PC on the alternating secondary SD card (SD slot on PC, using Win32 disk imager freeware).
  2. LuCi: backup config from the current OpenWRT system
  3. putty: get a list of the user-installed packages, see
    https://forum.openwrt.org/t/script-to-list-installed-packages-for-simplifying-sysupgrade
  4. swap SD Cards on the router and reboot the router with the new, but yet vanilla default OpenWRT release
  5. putty: opkg install the list on the new OpenWRT, using the list of packages as extracted in step 2
  6. LuCi: restore the config backup from step 1

1-6 takes about 5min. And if something does not work, I have a fully working fall back ready on the other (untouched) SD Card.

That forum thread from step 3 is amazing by the way. I actually wish, that the regular LuCi backup script would just include that, to write that list of user-installed packages to the backup archive as a bare text file. A restore would not automatically need to autoapply it, but simply having the list part in the config backup archive would be amazing.

4 Likes