[SRU] Allow to bypass container exit test

Bug #1980929 reported by Alexandre Ghiti
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Kinetic
Fix Released
Undecided
Unassigned
livecd-rootfs (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Kinetic
Fix Released
Undecided
Unassigned

Bug Description

https://bugs.launchpad.net/ubuntu/+source/flash-kernel/+bug/1863145 introduced a test at the beginning of main() to skip flash-kernel completely if we are in a container: that logic breaks the creation of RISC-V images where we need flash-kernel to run in order to install the dtb at the right location for update-grub.

So introduce a new environment variable that allows to bypass this test in such circumstances: FK_FORCE_CONTAINER must be equal to "yes" to skip the test and allow flash-kernel to run.

[Impact]

RISC-V images build needs to run flash-kernel to install the dtb for update-grub to find. Currently, Ubuntu has a delta that prevents flash-kernel to run in a container but our infrastructure runs the images build inside a container which breaks the installation of the dtb on RISC-V images.

We fix this by adding a new environment variable which will be set to "yes" only when building a RISC-V image.

[Test Plan]

To reproduce this bug, we need to launch livecd-rootfs inside a LXC container.

To test this fix, I'll patch livecd-rootfs in order to set the new environment variable and we'll trigger a new build of a RISC-V image from launchpad.

Additionally, an Ubuntu Server image should be spun up in a LXC container, and flash-kernel from the -proposed pocket should be executed to ensure it does *not* run:

* Launch an Ubuntu Jammy image in LXD: lxc launch ubuntu:j test-fk
* Shell into the instance: lxc exec test-fk bash
* Enable proposed (https://wiki.ubuntu.com/Testing/EnableProposed)
* Update flash-kernel to the proposed version: apt install -t jammy-proposed flash-kernel
* Run flash-kernel if the update did not already: flash-kernel
* Ensure it exited cleanly without doing anything (echo $? and check /boot looks the same?)

[Where problems could occur]

We must take care at not breaking other images builds, or boot on the cloud images (the reason for initial introduction of the container test in LP: #1863145), so great attention to the patch must be paid so that it only changes the current behaviour when we set the environment variable. The chosen variable name is specific enough as it likely won't be used (i.e.: FK_FORCE_CONTAINER).

[Other Info]

This patch is needed in Jammy as we intend to publish new RISC-V images for 22.04.1.

Related branches

description: updated
description: updated
Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

Please find attached the debdiff for kinetic

Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

Please find attached the debdiff for jammy

Revision history for this message
Alexandre Ghiti (alexghiti) wrote :
Revision history for this message
Dave Jones (waveform) wrote :

Patches look fine to me; I've tweaked the regression section above to include the risk of breaking boot on the ARM64 cloud images (the reason that the container test was originally introduced). Otherwise, all looks good so I'm happy to sponsor the changes.

description: updated
Revision history for this message
Dave Jones (waveform) wrote :

I've uploaded the kinetic version of flash-kernel; I'll upload the jammy version shortly but just tweaked the test plan in the SRU case to include a test to ensure flash-kernel doesn't run.

summary: - Allow to bypass container exit test
+ [SRU] Allow to bypass container exit test
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Alexandre, or anyone else affected,

Accepted livecd-rootfs into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.765.5 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 Jammy):
status: New → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package flash-kernel - 3.106ubuntu3

---------------
flash-kernel (3.106ubuntu3) kinetic; urgency=medium

  [ Ethan Hsieh ]

  * Add ZCU111 support (LP: #1978798)
  * bootscr.zynqmp (LP: #1978798)
    - Improve messaging in U-Boot boot script for board detection
    - Add kria and zcu board support lists
    - Update kR260 and KV260's bootargs as per AMD-Xilinx's request
    - Support legacy KV260 U-Boot

  [ Alexandre Ghiti ]

  * Allow to bypass container exit test by introducing FK_FORCE_CONTAINER
    for RISC-V images build to run flash-kernel in a container (LP: #1980929)

 -- Dave Jones <email address hidden> Thu, 14 Jul 2022 13:19:57 +0100

Changed in flash-kernel (Ubuntu Kinetic):
status: New → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Alexandre, or anyone else affected,

Accepted flash-kernel into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/flash-kernel/3.104ubuntu12 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 flash-kernel (Ubuntu Jammy):
status: New → Fix Committed
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

hmm, one thing I'd like someone to do during verification here: so basically as it is written right now, if something in flash-kernel includes `. functions` and that script is `set -u` *and* $FK_FORCE_CONTAINER is unset, we would get an error. Because it's not written in a way that would handle such cases of undefined FK_FORCE_CONTAINER. It's an edge case, so I'd like someone to double check if any of the bits that include `functions` don't set -u by any chance.

Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

So I did not find any `set -u` in flash-kernel. There exist 2 hooks that are called when the kernel and initramfs are modified but they are not sourced: they are considered as binaries. So that should not be a problem.

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

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

---------------
livecd-rootfs (2.769) kinetic; urgency=medium

  [ Alexandre Ghiti ]
  * Add support for the VisionFive and the Nezha boards (LP: #1980935)
  * Set FK_FORCE_CONTAINER for RISC-V images build to force flash-kernel
    to run in a container (LP: #1980929).

  [ Thomas Bechtold ]
  * Revert "don't modify ssh_config for ubuntu-cpc projects (LP:1968873)"
    This change triggered a bug in cloud-init (see LP: #1968873).

 -- Thomas Bechtold <email address hidden> Mon, 11 Jul 2022 14:10:52 +0200

Changed in livecd-rootfs (Ubuntu Kinetic):
status: New → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Alexandre, or anyone else affected,

Accepted livecd-rootfs into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.765.6 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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.765.6)

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

livecd-rootfs/2.765.6 (s390x)

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/jammy/update_excuses.html#livecd-rootfs

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

Thank you!

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

Verified by Alex using the latest jammy daily images.

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

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

---------------
livecd-rootfs (2.765.6) jammy; urgency=medium

  [ Alexandre Ghiti ]
  * Fix SiFive Unmatched build. While merging the VisionFive support, we
    removed the installation of u-boot-menu for the Unmatched by mistake
    (LP: #1982735).

livecd-rootfs (2.765.5) jammy; urgency=medium

  * Add support for the VisionFive and the Nezha boards (LP: #1980935)
  * Set FK_FORCE_CONTAINER for RISC-V images build to force flash-kernel
    to run in a container (LP: #1980929).

livecd-rootfs (2.765.4) jammy; urgency=medium

  * Revert "don't modify ssh_config for ubuntu-cpc projects (LP:1968873)"
    This change triggered a bug in cloud-init (see LP:1968873).

livecd-rootfs (2.765.3) jammy; urgency=medium

  * Do not modify /etc/ssh/sshd_config for ubuntu-cpc
    project builds (LP: #1968873)

livecd-rootfs (2.765.2) jammy; urgency=medium

  * Switch the intel-iot images to use the linux-intel-iotg kernel instead.
    (LP: #1980065)

 -- Łukasz 'sil2100' Zemczak <email address hidden> Mon, 25 Jul 2022 10:24:08 +0200

Changed in livecd-rootfs (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for livecd-rootfs 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 flash-kernel - 3.104ubuntu12

---------------
flash-kernel (3.104ubuntu12) jammy; urgency=medium

  [ Ethan Hsieh ]

  * Add ZCU111 support (LP: #1978798)
  * bootscr.zynqmp (LP: #1978798)
    - Improve messaging in U-Boot boot script for board detection
    - Add kria and zcu board support lists
    - Update kR260 and KV260's bootargs as per AMD-Xilinx's request

  [ Alexandre Ghiti ]

  * Allow to bypass container exit test by introducing FK_FORCE_CONTAINER
    for RISC-V images build to run flash-kernel in a container (LP: #1980929)

 -- Dave Jones <email address hidden> Thu, 14 Jul 2022 13:49:46 +0100

Changed in flash-kernel (Ubuntu Jammy):
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.