Local live-build fails to build images due to chroot/dev/* umount failures

Bug #1938414 reported by Łukasz Zemczak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
livecd-rootfs (Ubuntu)
Fix Committed
Medium
Łukasz Zemczak
Focal
Fix Released
High
Łukasz Zemczak

Bug Description

[Impact]

When running image builds locally by either running live-build directly or using `ubuntu-image classic`, the builds will almost always fail at one stage with an error similar to this:

umount: <PATH>/chroot/dev/shm: target is busy.

This is due to the fact that chroot/dev is bind-mounted, and during unmount, when someone is physically using the build host, umount operations on this tree can be impossible.
Without this basically using ubuntu-image locally to build your own image and/or running test automation on certain infrastructure bits can be impossible.

[Test Case]

(best done in a VM)
* On a focal machine, install ubuntu-image + livecd-rootfs from -proposed.
* Get the gadget: git clone https://github.com/snapcore/pc-amd64-gadget.git -b classic
* Prime the gadget: cd pc-amd64-gadget/; snapcraft prime
* Start the image build: cd ../; sudo ubuntu-image classic -d -O out/ -p ubuntu-cpc -a amd64 -s focal
* Wait for the image to finish building, observe that that the image build succeeded and image files are available in the out/ directory

Without the fix the build will not succeed.

[Where problems could occur]

I can't think of a scenario that could go wrong here. If there is any regression, it would most likely manifest as another image build failure. Regression potential is low here, especially that livecd-rootfs is only used for image builds.

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

Released for impish with 2.731.

Changed in livecd-rootfs (Ubuntu Focal):
assignee: nobody → Łukasz Zemczak (sil2100)
importance: Undecided → High
Changed in livecd-rootfs (Ubuntu):
importance: High → Medium
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  * And whoops, we missed adding ARCH in the SUBARCH ubuntu-image handling for
    intel-iot.

livecd-rootfs (2.664.26) focal; urgency=medium

  * Revert previous change of fixing /dev sharing - this causes weird
    autopkgtest issues.

livecd-rootfs (2.664.25) focal; urgency=medium

  [ Brian Murray ]
  * Add support for creating images (ubuntu-core and classic) with a kernel
    optimized for Intel IoT devices. (LP: #1938338)

  [ Michael Hudson-Doyle ]
  * Simplify how the subiquity client is run on the serial console in the live
    server environment, breaking a unit cycle that sometimes prevents
    subiquity from starting up at all. (LP: #1888497)
  * Do not set the password for the installer user via cloud-init as subiquity
    can now do this itself. (LP: #1933523)

  [ Łukasz 'sil2100' Zemczak ]
  * Fix sharing of the /dev tree to make sure we can safely umount the chroot
    when needed. This fixes local non-livefs-builder image builds.
    (LP: #1938414)

 -- Łukasz 'sil2100' Zemczak <email address hidden> Wed, 04 Aug 2021 17:32:37 +0200

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