Preinstalled amd64 images cannot upgrade grub.cfg on boot partition + technical debt

Bug #1949102 reported by Łukasz Zemczak
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-initramfs-tools (Ubuntu)
New
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
livecd-rootfs (Ubuntu)
New
Critical
Unassigned
Focal
Fix Released
Critical
Unassigned

Bug Description

[Impact]

This is a design flaw that needs to be fixed. Basically we inherited the design from old Ubuntu Core devices that the boot configuration is prepared in the gadget and - therefore - is quite static. Newer Core devices have mechanisms for updating boot assets, while classic images... well, we never actually thought about it.

Now that we have a valid use-case for preinstalled amd64 images, we actually need to make sure we can update at least the grub config somehow. To do this, we introduce the hook from preinstalled desktop images from groovy+ with an additional change to generate the grub.cfg by using `update-grub2`. We switch the design to now only shipping a blanket grub.cfg on the boot partition, pointing to the rootfs one - which can be freely updated via existing mechanisms.

While adding the hook, we also fix a few other technical dept - like adding a swap file and making the rootfs resizable. Everything that we already had for our Pi images in groovy+.

The growroot part might also require a quick workaround in cloud-initramfs-tools.

[Test Case]

* Base test case:

Build an image with -proposed enabled, make sure that it still boots as before on Intel IOT platforms. Try booting the image on an USB when there are other USB drives present on the device.

* Growroot:

Resize the image so that growroot finds space to expand the rootfs. Boot the image, make sure that the image boots fine on first boot (no initramfs prompt!). Log into the system and run `sudo udevadm info /dev/sda3` and check if there are "ID_*" properties present. Check if the root partition has expanded as expected.

* Grub updates:

On the booted image, run `sudo update-grub2`, make sure that there are no errors present. Reboot, check if the image still boots correctly.
To make sure the rootfs grub.cfg is used, modify /etc/default/grub and change GRUB_TIMEOUT to 10. Run `sudo update-grub2` again and reboot. Confirm that the grub menu appears with a 10 second timeout.

[Regression Potential]

This can basically only regress intel-iotg desktop images, which is what we want to fix right now. But it requires for the images to go through the whole testing cycle again, to make sure that everything still works - since we're basically switching to a completely new grub.cfg. The test case should be sufficient to make sure there are no regressions.

The cloud-initramfs-tools changes for growroot might, in some very weird way, break cloud image resizing. So it would be good to double check with the CPC team if images still work as expected with this change.

Related branches

description: updated
Changed in livecd-rootfs (Ubuntu Focal):
importance: Undecided → Critical
status: New → In Progress
summary: - Preinstalled amd64 images cannot upgrade grub.cfg on boot partition
+ Preinstalled amd64 images cannot upgrade grub.cfg on boot partition +
+ technical dept
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Łukasz, or anyone else affected,

Accepted livecd-rootfs into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.664.31 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in livecd-rootfs (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Łukasz, or anyone else affected,

Accepted livecd-rootfs into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.664.32 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

summary: Preinstalled amd64 images cannot upgrade grub.cfg on boot partition +
- technical dept
+ technical debt
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (livecd-rootfs/2.664.32)

All autopkgtests for the newly accepted livecd-rootfs (2.664.32) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

ubuntu-image/1.11+20.04ubuntu1 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#livecd-rootfs

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

description: updated
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Łukasz, or anyone else affected,

Accepted cloud-initramfs-tools into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-initramfs-tools/0.45ubuntu2 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in cloud-initramfs-tools (Ubuntu Focal):
status: New → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Łukasz, or anyone else affected,

Accepted livecd-rootfs into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.664.33 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (livecd-rootfs/2.664.33)

All autopkgtests for the newly accepted livecd-rootfs (2.664.33) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

ubuntu-image/1.11+20.04ubuntu1 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#livecd-rootfs

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

I tested the https://cdimage.ubuntu.com/focal/daily-preinstalled/20211102.1/ proposed image locally on a kvm and was able to get the image booting for the first time without an initramfs prompt and the rootfs has been expanded as expected. I saw no boot errors. I confirmed that the right version of cloud-initramfs-tools was used (0.45ubuntu2).

Quoting Pierre Equoy regarding the testing of other bits:
"We are happy to confirm that this image not only fixes the BusyBox screen issue we had with the previous image (20211101), but also both LP#1948885 (auto expand root partition) and LP#1948895 (cannot boot if a USB disk is present)! \o/"

So I think we can consider this SRU to be verified.

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

This bug was fixed in the package cloud-initramfs-tools - 0.45ubuntu2

---------------
cloud-initramfs-tools (0.45ubuntu2) focal; urgency=medium

  * When performing growroot, we don't need to perform a wait-for-root call
    as we already waited for the whole of udev to settle before that. This
    should help with weird cases where the device loses the ID_FS_TYPE
    property after growpart. (LP: #1949102)

 -- Łukasz 'sil2100' Zemczak <email address hidden> Tue, 02 Nov 2021 15:33:46 +0100

Changed in cloud-initramfs-tools (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for cloud-initramfs-tools has completed successfully and the package is now being 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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
livecd-rootfs (2.664.33) focal; urgency=medium

  * Install cloud-initramfs-growroot to actually enable rootfs resize.
  * Fix a grub error by making sure the unicode.pf2 font is installed in the
    right path for preinstalled amd64 desktop images.

livecd-rootfs (2.664.32) focal; urgency=medium

  * 099-ubuntu-image-customization.chroot: fix a typo in it.

livecd-rootfs (2.664.31) focal; urgency=medium

  [ Łukasz 'sil2100' Zemczak ]
  * Add the 099-ubuntu-image-customization.chroot for
    desktop-preinstalled images similar to what we have in groovy+ (for the pi
    desktop), but improved for amd64 platforms. We need it to generate a valid
    grub.cfg on the rootfs (similar to ubuntu-cpc) and then use that instead
    of a static configuration locked on the boot partition (LP: #1949102).

  [ Brian Murray ]
  * Properly check ARCH when setting the intel-iot model.

livecd-rootfs (2.664.30) focal; urgency=medium

  [ Thomas Bechtold ]
  * magic-proxy: Replace http.client with urllib calls. live-build/auto/build:
    change iptables calls to query rules and quickly check that connectivity
    works after transparent proxy has been installed. (LP: #1917920)
  * magic-proxy: fix TypeError when trying to call get_uri() (LP: #1944906)

 -- Łukasz 'sil2100' Zemczak <email address hidden> Fri, 29 Oct 2021 15:33:34 +0200

Changed in livecd-rootfs (Ubuntu Focal):
status: Fix Committed → Fix Released
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.