ImageBasedUpgrades
Ubuntu is more and more interested in offering an image based system, similar to some of the other mobile operating system. Typically those images will contain a basic Ubuntu desktop system and will always be read-only (in some cases, may be signed too).
User data and additional software will be stored in an overlay on top of the base image.
Upgrades will typically be a simple download of a newer image and swapping the image file (likely to be squashfs).
This comes with quite a few problems that are listed below and should be addresed:
- Overlay filesystems typically work with copy-on-write, meaning that as soon as you install any extra package on the system, /var/lib/dpkg/status (for example) will be copied to the overlay, then then extra entry will be written to it. This is a major problem as any such system wide database will then be completely out of date after an upgrade.
- Any action done by the maintainer scripts (preinst/postinst/prerm/postrm) won't be applied during the "upgrade", this will likely cause some configuration to be out of date if not completely invalid and will also cause quite a few missing entries or invalid entries in /var.
- File transition won't happen as preinst won't be called, leading to more file conflicts.
- In general, any file that's being touched for any reason, won't ever be upgraded.
Some ideas on how to workaround those problems:
- Write a whitelist of configuration files and database that we know how to merge, for those, run a migration script post-upgrade and for any other file detected, move them out of the way and push an error to the crash database for tracking.
- Don't attempt to merge anything, instead use apt-clone before applying the upgrade to extract all the extra packages that were installed and any relevant configuration. Save those on the side, apply the upgrade and restore those. That's similar to ubiquity's "upgrade" option.
- Don't allow standard package installation, instead rely on chroot or chroot-like environments that can be preserved across upgrades.
Feel free to update this page with more potential problems and workaround/fixes.