don't short-circuit update-grub kernel postinst hook in containers

Bug #1729034 reported by Steve Langasek
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
livecd-rootfs (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned

Bug Description

[SRU Justification]
LP: #1060404 was addressed by making the update-grub kernel postinst hook a no-op when running in containers.

We now do all of our livefs builds in containers in Launchpad; this means livefses no longer get a grub config automatically generated with the correct contents when installing a kernel in the target, as they did previously.

The change for LP: #1060404 was described by Colin as a "temporary fix".

We know that update-grub itself now succeeds in the launchpad buildd containers, because we have several points in livefs builds where we are invoking it directly and it does what we expect. And in any containers where update-grub does not work, these same livefs builds will fail anyway.

[Test case]
Run through a standard set of xenial image builds with livecd-rootfs in launchpad, including the private cloud image builds. Confirm that the builds are successful and that the resulting images list the correct contents in /boot/grub/grub.cfg.

[Regression potential]
If something else relied on container detection in order to modify its behavior, and is called between the addition and removal of the systemd-detect-virt diversion, it could now behave incorrectly in a container and cause build failures. This is an entirely hypothetical scenario, since all current consumers of (un)divert_grub, and pending users of it, have it very narrowly scoped such that they're only doing update-grub / kernel install operations in between.

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

prelim feedback is that update-grub does still fail in a lxd container with a stock setup; so we will need to work around this in livecd-rootfs instead.

affects: grub2 (Ubuntu) → livecd-rootfs (Ubuntu)
Changed in livecd-rootfs (Ubuntu):
status: New → Fix Committed
Steve Langasek (vorlon)
description: updated
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Steve, or anyone else affected,

Accepted livecd-rootfs into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.408.22 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in livecd-rootfs (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed verification-needed-xenial
Steve Langasek (vorlon)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 2.479

---------------
livecd-rootfs (2.479) bionic; urgency=medium

  * Purge initramfs-tools from minimized images.
  * Make sure to remove any initramfs that was generated in a minimized
    image.
  * divert /usr/bin/systemd-detect-virt as part of the grub diversions, so
    that the grub kernel postinst hook is operational when we're building
    in a container. LP: #1729034.

 -- Steve Langasek <email address hidden> Tue, 31 Oct 2017 09:58:35 -0700

Changed in livecd-rootfs (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :

public ubuntu-cpc -proposed builds for the first part of this SRU verification are here:

https://launchpad.net/~canonical-foundations/+livefs/ubuntu/xenial/ubuntu-cpc

daily xenial builds of ISOs are already happening with 2.408.22 from -proposed and built successfully (this SRU is expected to be a no-op for those images):
https://launchpad.net/~ubuntu-cdimage/+livefs/ubuntu/xenial/ubuntu/+build/113821/+files/buildlog_ubuntu_xenial_i386_ubuntu_BUILDING.txt.gz
https://launchpad.net/~ubuntu-cdimage/+livefs/ubuntu/xenial/ubuntu/+build/113820/+files/buildlog_ubuntu_xenial_amd64_ubuntu_BUILDING.txt.gz

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

Public ubuntu-cpc builds check out (except that s390x hasn't built because apparently this isn't a devirt ppa).

Private cloud image builds, for those with access, are at <https://launchpad.net/~cloudware/+livefs/ubuntu/xenial/cpc-development/+build/113981>. These show the expected behavior; the derivative image builds are not using the divert_grub entry point in this revision, so the /boot/grub/grub.cfg is currently wrong for some of these images, but this is not a regression and will be fixed in a later revision of the derived image build code.

tags: added: verification-done-xenial
removed: verification-needed verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 2.408.22

---------------
livecd-rootfs (2.408.22) xenial; urgency=medium

  * Make sure to remove any initramfs that was generated in a minimized
    image.
  * divert /usr/bin/systemd-detect-virt as part of the grub diversions, so
    that the grub kernel postinst hook is operational when we're building
    in a container. LP: #1729034.

 -- Steve Langasek <email address hidden> Sat, 21 Oct 2017 20:53:02 -0700

Changed in livecd-rootfs (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Andy Whitcroft (apw) wrote : Update Released

The verification of the Stable Release Update for livecd-rootfs has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.