Merge ~xnox/grub:ubuntu-backup-and-restore-v2 into ~ubuntu-core-dev/grub/+git/ubuntu:ubuntu

Proposed by Dimitri John Ledkov
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 (+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/ (+2/-2)
util/grub-install-common.c (+90/-15)
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Julian Andres Klode Pending
Ubuntu Core Development Team Pending
Review via email:

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/rollback/cleanup all operate correctly using Debian cloud image as a base VM image.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

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.

Revision history for this message
Steve Langasek (vorlon) wrote :

LGTM. Were you still going to do something with the git dpm hashes (AIUI by adding the upstream remote so that git will recalculate)?

Revision history for this message
Steve Langasek (vorlon) :
review: Approve
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

`git config --global core.abbrev 10`


There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.


People subscribed via source and target branches