Use the tools created by RM #730 to automate an upgrade. This probably requires a daemon or at least a cron job to check for upgrades and install them.
Updated by Hammel over 3 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
In the Busybox init:
- Before mounting squashfs, check if a new squashfs exists.
- This would be in /mnt/user/upgrade/rootfs-new.squashfs
- If it exists
- save the old squashfs to /mnt/user/upgrade/rootfs-old.squashfs
- install /mnt/user/upgrade/rootfs-new.squashfs to /mnt/root/overlay/current/squashfs/rootfs.squashfs (or what current points to)
- Continue booting
There should be a new package that does a validation of the system on the next boot to make sure it's working. This validation is system specific - it's different for the dev platform, media system, piplayer, ironman, etc. If validation passes then rootfs-old.squashfs is removed. If validation fails then the system reboots and init removes the new squashfs and restores the old one.
Note: this isn't exactly correct. The "current" points to an image id. The upgrade should be installed to a new image id directory and the swap between old and new is just a matter of changing the current symlink - don't move the files around!
This also only works if the new and old are compatible so any packages installed on the old won't break with the new. This can be handled with a versioning test that disables/uninstalls packages that are not compatible with the new, but I need a definition of how this versioning would work. One way to do that is to have whatever mechanism is used to grab the new rootfs also check for new packages that match the existing packages on the platform and download them too. Then place a stamp file that packages need to be updated on the next boot.