Merge ~xnox/grub:ubuntu-backup-and-restore-v2 into ~ubuntu-core-dev/grub/+git/ubuntu:ubuntu
Status: | Merged |
---|---|
Merged at revision: | 143a6ce0429ad9056a23bf0387a4720185a9c7d9 |
Proposed branch: | ~xnox/grub:ubuntu-backup-and-restore-v2 |
Merge into: | ~ubuntu-core-dev/grub/+git/ubuntu:ubuntu |
Diff against target: |
391 lines (+283/-20) 7 files modified
configure.ac (+1/-1) debian/.git-dpm (+2/-2) debian/changelog (+12/-0) debian/patches/grub-install-backup-and-restore.patch (+175/-0) debian/patches/series (+1/-0) debian/postinst.in (+2/-2) util/grub-install-common.c (+90/-15) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Langasek | Approve | ||
Julian Andres Klode | Pending | ||
Ubuntu Core Development Team | Pending | ||
Review via email: mp+389968@code.launchpad.net |
Commit message
This merge request addresses reliability and safety of applying grub-pc upgrades.
When performed non-interactively, postinst instead of showing critical prompts may simply exit successfully indicating successful package configure even though MBR update may have failed, and modules in /boot/grub might no longer match the MBR core image leading to failure to boot.
Separately, I have submitted a patch upstream to make grub-install more resilient. Instead of irrevocably removing grub modules prior to updating MBR, I now made it create a backup and register on_exit handle. If everything is successful the on_exit handle removes the backup. If critical errors have occurred the backup is restored. This prevents mismatch of grub modules and MBR in case of attempts to call grub-install on non-existing devices, or calling on a device that refuses writes to MBR (as I have seen in one particular public cloud, it felt as if the underlying disk storage was refusing writes to mbr).
I have tested above using apparmor profile that prohibited writes to /dev/*. And ensured that backups/
I'm sorry about git-dpm noise w.r.t. how many characters are used for short hash. I don't know what I need to do to have it the same as previous uploads.