Upgrade version (x86)

i have installed Openwrt in a couple of PCs by using the [generic-ext4-combined.img.gz].
How can i upgrade to newer versions, please? What about the config, will it be lost? Do i have to install all packages from scratch?

There is a wiki page for that X86 Upgrading.

i have seen this page but i am kinda lost. do i have to go to LuCI web interface System → Backup / Flash Firmware → “Flash new firmware image and upload the generic-ext4-combined.img.gz image? or do i have to do something else?

I'm in the same boat as you, ready to upgrade my x86/64 router from 21.02.0 to 21.02.2. The relevant portion of the page @RaylynnKnight linked is the following:

If you had used a **ext4-combined.img.gz** type of image to install, there are 4 options for upgrading:

1. Write a new **ext4-combined.img.gz** image: this is the simplest option and is identical to first installation: all data, configs, packages and extra partitions will be wiped and you'll have a brand new OpenWrt system with default packages and configs. Then you can reinstall all packages and copy config files back and create extra partitions.
2. Use **sysupgrade**: this is default upgrading procedure, but the least recommended option for x86 machines. Proceed to [Sysupgrade](https://openwrt.org/docs/guide-user/installation/installation_methods/sysupgrade) for details.
3. Extracting boot partition image from **ext4-combined.img.gz** and writing it and **ext4-rootfs.img.gz**, leaving MBR partition table intact.
4. Extracting boot partition image from **ext4-combined.img.gz** and writing it, then uncompressing **rootfs.tar.gz** to existing rootfs partition.

The frustrating part is #2. It recommends against using sysupgrade but doesn't explain why. For myself, I'm going with #1, which is basically a re-install but I intend to use the Image Builder this time to hopefully skip the extra package loads and reconfiguration.

Take a look at: Using the Image Builder

The linked page has very good instructions for starting from the image you want to upgrade to but adding all of the packages you are currently using as well as preserving your current config. I think it is kosher to include your current config files if your doing a minor "point" upgrade such as 21.02.0 to 21.02.2.

I was able to successfully build my image with extra packages and configs. I created a bootable USB drive with Ubuntu BUT also with persistent storage so I could copy my newly built image to the USB drive. This will let me boot into the live Ubuntu image and then dd the custom OpenWRT image to my router.

Now I just need to find a time that both my wife and son don't need the network for about an hour. The good thing about installing on a x86 computer is that you really can't screw it up (brick it). Worst case is just a full install and manual update and config like you did the first time.

Good luck.

1 Like

I have had OpenWrt on an x86 box with squashfs for more than a year now, and upgrade that installation using sysupgrade all the time. Worked fine at least 10 times by now.

If you choose to do that, you might want to roll your own images, or use the awesome Attended Sysupgrade / https://sysupgrade.openwrt.org/ service to save effort on re-installing packages after flashing the new firmware image.

1 Like

Is there a good explanation of when to use a particular image on x86 routers? Squashfs vs ext4 for example? The instructions I followed for my initial install directed the use of generic-ext4-combined, which is what I did.

The Sysupgrade Server looks pretty cool. Will have to use it the next time.

I took the easy route and asked experienced OpenWrt community members on IRC which fs option I should choose, and went with what advice I got :wink:

Iirc, it was said that squashfs offered working factory reset. Beyond that, I do not know what drawbacks one would incur by going for one over the other. Once you get past the BIOS/EFI firmware and bootloader, I think it matters little in practice.

Squashfs is a compressed FS, it really isn't required on a x86, since there's usually plenty of disk space available.

Here's a post I made about installing another release, parallel to the currently running one, and then just (re)booting into it - Sysupgrade help for x86_64 - #14 by frollic

As colo implied, the advantage of squashfs based images is the ability to factory reset the device. If you're asking for advice, that would go in favour of squashfs, but as x86_64 has other recovering means available (be it attaching monitor & keyboard, replacing the boot disk/ reflashing it externally or taking access from a removable boot medium), it's not a major concern on this platform (but can still come in handy, easier to attach a USB keyboard and typing in firstboot blindly, than wheeling in a monitor to a headless system as well).

1 Like

my current df -h is

root@OpenWrt_alix: ~ $ df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root               252.0M     17.6M    229.3M   7% /
tmpfs                   123.7M   1000.0K    122.7M   1% /tmp
/dev/sda1                15.7M      2.4M     13.0M  16% /boot
/dev/sda1                15.7M      2.4M     13.0M  16% /boot
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt_alix: ~ $

so if you know an easy way to simply upgrade my system, without loosing the config, packages, etc, please let me know.

Config can be exported, packages will ways be lost, but can be reinstalled.

As I see it you have two options for a "simpler" upgrade:

  1. Use Image Builder to build a custom image that contains all your packages and configs as I mentioned above. It really is quite easy.
  2. Try the Attended Sysupgrade app as mentioned by @colo above. Export your config beforehand and import it after the upgrade.

It's probably always a good idea to export your config before any upgrade, just to have it for reference if nothing else.

thanks a lot for your replies. after taking a backup i did try to simply upgrade the newer image to my system new version as it is, without extracting. it worked fine without any issues.
I do not know if his is a correct way of doing things but it worked for 3 of my systems upgrading from 19.07.07 to 21.02.2. Off course i had to reinstall some packages, but the config has not been lost.

hi,

default upgrade mechanism is sysupgrade which works for x86 arch too - good point. due to nature of openwrt build & sysupgrade it means that:

  • owrt using binary releases (see *ext4-combined.img.gz for example)
  • deploying binary image means it is overwriting the partitions tables and the partition content as well! - that's not so good.
  • as (sys)upgrade overwrites stuff also means packages installed after fresh install are lost during upgrade process, although the configuration files and if you ask for even the package list will be copied to upgraded image.

as explained by the upgrade wiki there are couple of options, all has limitations. e.g. extracting rootfs.tar.gz can overwrite the root partitions but it may not the best if kernel is changed.

so i think the best option is to create a dual boot partition schema, so create a boot partition, root1 and root2, copy the corresponding kernel to /boot and set grub.cfg as needed.

I noticed my system is very much similar to yours. Any idea why the duplicate entries for /boot?

Please see the following

1 Like

I'm curious about this auc tool and how it differs from the image builder. Is it building images?

Yes. auc commands a remote server to run Image Builder. The completed image is then downloaded and installed.

A post was split to a new topic: Using AUC on Unifi U6-Lite