mikma / lxd-openwrt

Scripts for building LXD images from OpenWrt rootfs tarballs.
MIT License
150 stars 39 forks source link

How to upgrade? #16

Open MateEke opened 5 years ago

MateEke commented 5 years ago

Hi!

I'm running 18.06.2 in lxd for 3 months now, my only issue is the already open reboot problem (#14).

Is there any way to upgrade to 18.06.4 with keeping the existing configurations?

rkkoszewski commented 5 years ago

I was trying to achieve the same. To upgrade you need to generate a bin file (Probably needs to be ext4?) It does not work with the zip as is right now. The only thing you can do is to do a configuration backup. Delete the container, recreate it with a new version and restore the configuration. Also note what packages you have installed as upgrading (also with any other routers) seems to remove all installed packages too, so you need to reinstall them all.

mikma commented 5 years ago

I have added a basic upgrade script (scripts/upgrade.py) which create a new container and copies the lxd and openwrt configs from the old container to the new container, and installs missing packages. The script requires the pylxd library. Let me know what you think.

MateEke commented 5 years ago

Thank you, looks promising! I will try!

I have recently updated to 18.06.4 manually, this was my method:

./build.sh -p "luci-theme-material luci-app-adblock luci-app-ddns luci-app-wol curl nano iptables-mod-checksum" -f /mnt/openwrt_backup/
lxc image import bin/openwrt-18.06.4-x86-64-lxd.tar.gz --alias openwrt-18.06.4
lxc stop router
lxc rename router router-old
lxc launch openwrt-18.06.4 router -p router
lxc exec router -- sysupgrade -r /backup-router-2019-09-03.tar.gz
lxc exec router -- reboot now
eisengrau commented 4 years ago

@MateEke can you please give your personal contact info, or mail address. I have a question regarding the usage of OpenWRT in an LXC container, whick may be a hungarian ISP/DIGI specific thing.

Köszi!