itiligent / Easy-OpenWRT-Builder

A simple framework for building customized OpenWRT images with additional options for virtual machine conversion & embedded parition resizing
22 stars 8 forks source link

[Not an issue]: Questions About Upgrading and Config Preservation #4

Closed binuengoor closed 1 month ago

binuengoor commented 1 month ago

Hi there! I saw your posts on the OpenWRT subreddit and had a few beginner questions about the script.

I've been using OpenWRT for a couple of years now—started with a Proxmox VM, then moved it to a router for easier upgrades, but now I’m considering moving it back to an x86 Proxmox setup for better performance.

I ran a test with the script, which created images with my custom packages and resized partitions, all working smoothly. Now I’m curious about what to do when it’s time to upgrade.

Here’s what I'm wondering:

Thanks in advance for any tips on making upgrades easier!

itiligent commented 1 month ago

OWRT has many limitations with upgrading individual packages, and this is generally discouraged because each package is built for a specific kernel. When ugrading, the safest way is to use the script to re-create a brand new firmware with your specific package recipie added to the script and then re-flash the disk.

Reflashing over the top of an existing formware via luci requires a special sysupgrade variant of images be built. The x86 profile in this script does not create these sysupgrade variants because you dont need the OWRT firmware to manage in place re-flashes to disk, instead there are tools like Balena Etcher for this. (Only with router flash memory do you need to flash via OWRT console or gui with the sysupgrade image variant)

To replicate your existing config you can backup your config via luci, then re-flash the new image and the re-apply the backup config in luci. Another way is to copy your (unzipped) backup to the directory when the script prompts, your backup will then be baked in to the new image meaning after a firmware reset your backed up config will remain. This can be quite handy if you have a more complex vlan setup and the router relies on vlan tags to access trunk switch ports and reset would cut you off from accessing the router to re-apply the backup.

Squashfs is my preference as this is an immutable filesystem that is very reliable. With SqushFS, if you have baked in a specifc config, a firmware reset in luci lets you quickly roll back to a known good config without any extra steps. Great for testing and experimetnting.

I like the idea of using squashfs for the router, but adding a second ext4 partition (with this config baked in - see the readme) for a little extra storage that will always be available and not get nuked after an upgrade or fimware reset. I store a large musuc collection as flak this way without needing an extra always on NAS cosuming power as the router will be on 24x7 anyway.