focal: backport patch to allow mk-sbuild within Docker

Bug #1948713 reported by Dan Watkins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
debootstrap (Debian)
Fix Released
Unknown
debootstrap (Ubuntu)
Fix Released
Medium
Unassigned
Focal
Fix Released
Medium
Brian Murray
Hirsute
Fix Released
Undecided
Brian Murray

Bug Description

Debian bug #968927 is present in the version of debootstrap in focal, which means that mk-sbuild cannot execute successfully within a Docker environment.

https://salsa.debian.org/installer-team/debootstrap/-/commit/87cdebbcad6f4e16ba711227cbbbd70039f88752 is the fix for this. It's included in the version of debootstrap in impish+, and we've been using a patched debootstrap (including only this patch on top of focal's debootstrap) for a couple of months without issue.

[Impact]

Without this patch, using debootstrap via mk-sbuild within a Docker environment produces this error:

  ln: failed to create symbolic link '/dev/stdin': File exists
  E: 10mount: E: Failed to open mount file ‘/proc/mounts’: No such file or directory
  E: focal-amd64-6433640d-7654-4238-b872-e8f1acd4b717: Chroot setup failed: stage=setup-stop

This means that Ubuntu users either have to perform their mk-sbuild'ing outside of Docker (which may not be possible in corporate settings), or they have to maintain debootstrap downstream of Ubuntu (which either requires superseding the versions in Ubuntu entirely, or rebasing this patch onto the new version which appears in focal as each new release is opened).

[Test Plan]

Launch a Docker container (privileged so mk-sbuild can perform overlay mounting) with:

  docker run --privileged -it --rm ubuntu:focal

and then within the container:

  apt-get update
  apt-get install ubuntu-dev-tools sbuild

  # Convince mk-sbuild to run as root
  touch /root/.sbuildrc
  usermod -a -G sbuild root
  newgrp sbuild

  # Run mk-sbuild
  mk-sbuild focal

After much output, the above-described error will be output. Using a patched debootstrap causes the mk-sbuild to complete successfully.

Regression testing of regular use of debootstrap (outside of Docker, as used in Ubuntu's image building) should be performed: the image content should be unchanged.

[Where problems could occur]

debootstrap is a fundamental piece of the Debian/Ubuntu image building infrastructure, and any change to it could have an impact on how Ubuntu images are built.

Revision history for this message
Dan Watkins (oddbloke) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "lp1948713.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Mathew Hodson (mhodson)
Changed in debootstrap (Ubuntu):
importance: Undecided → Medium
Changed in debootstrap (Ubuntu Focal):
importance: Undecided → Medium
Changed in debootstrap (Ubuntu):
status: New → Fix Released
Changed in debootstrap (Debian):
status: Unknown → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

 $ dput debootstrap_1.0.123ubuntu6.2_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /tmp/pkgs/hirsute/debootstrap_1.0.123ubuntu6.2_source.changes: Valid signature from 1E918B66765B3E31
Checking signature on .dsc
gpg: /tmp/pkgs/hirsute/debootstrap_1.0.123ubuntu6.2.dsc: Valid signature from 1E918B66765B3E31
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading debootstrap_1.0.123ubuntu6.2.dsc: done.
  Uploading debootstrap_1.0.123ubuntu6.2.tar.gz: done.
  Uploading debootstrap_1.0.123ubuntu6.2_source.buildinfo: done.
  Uploading debootstrap_1.0.123ubuntu6.2_source.changes: done.
Successfully uploaded packages.

Changed in debootstrap (Ubuntu Focal):
status: New → In Progress
Changed in debootstrap (Ubuntu Hirsute):
status: New → In Progress
Changed in debootstrap (Ubuntu Focal):
assignee: nobody → Brian Murray (brian-murray)
Changed in debootstrap (Ubuntu Hirsute):
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Brian Murray (brian-murray) wrote :

 $ dput debootstrap_1.0.118ubuntu1.6_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /tmp/pkgs/focal/debootstrap_1.0.118ubuntu1.6_source.changes: Valid signature from 1E918B66765B3E31
Checking signature on .dsc
gpg: /tmp/pkgs/focal/debootstrap_1.0.118ubuntu1.6.dsc: Valid signature from 1E918B66765B3E31
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading debootstrap_1.0.118ubuntu1.6.dsc: done.
  Uploading debootstrap_1.0.118ubuntu1.6.tar.gz: done.
  Uploading debootstrap_1.0.118ubuntu1.6_source.buildinfo: done.
  Uploading debootstrap_1.0.118ubuntu1.6_source.changes: done.
Successfully uploaded packages.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Dan, or anyone else affected,

Accepted debootstrap into hirsute-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/debootstrap/1.0.123ubuntu6.2 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-hirsute to verification-done-hirsute. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-hirsute. 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 debootstrap (Ubuntu Hirsute):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-hirsute
Changed in debootstrap (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Dan, or anyone else affected,

Accepted debootstrap into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/debootstrap/1.0.118ubuntu1.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-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
Brian Murray (brian-murray) wrote :

The verification passed for me on Focal.

Setting up pkgbinarymangler (144) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
W: --force-yes is deprecated, use one of the options starting with --allow instead.

Done building focal-amd64.

 To CHANGE the golden image: sudo schroot -c source:focal-amd64 -u root
 To ENTER an image snapshot: schroot -c focal-amd64
 To BUILD within a snapshot: sbuild -A -d focal-amd64 PACKAGE*.dsc
 To BUILD for : sbuild -A -d focal-amd64 --host PACKAGE*.dsc

root@22d6bbf0066b:/# apt-cache policy debootstrap
debootstrap:
  Installed: 1.0.118ubuntu1.6
  Candidate: 1.0.118ubuntu1.6
  Version table:
 *** 1.0.118ubuntu1.6 500
        500 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1.0.118ubuntu1.5 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
     1.0.118ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

Revision history for this message
Brian Murray (brian-murray) wrote :

The verification also passed for me on Focal, thanks for the great test case.

Setting up pkgbinarymangler (144) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
W: --force-yes is deprecated, use one of the options starting with --allow instead.

Done building focal-amd64.

 To CHANGE the golden image: sudo schroot -c source:focal-amd64 -u root
 To ENTER an image snapshot: schroot -c focal-amd64
 To BUILD within a snapshot: sbuild -A -d focal-amd64 PACKAGE*.dsc
 To BUILD for : sbuild -A -d focal-amd64 --host PACKAGE*.dsc

root@0f0e588559ca:/# apt-cache policy debootstrap
debootstrap:
  Installed: 1.0.123ubuntu6.2
  Candidate: 1.0.123ubuntu6.2
  Version table:
 *** 1.0.123ubuntu6.2 500
        500 http://archive.ubuntu.com/ubuntu hirsute-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1.0.123ubuntu6.1 500
        500 http://archive.ubuntu.com/ubuntu hirsute-updates/main amd64 Packages
     1.0.123ubuntu5 500
        500 http://archive.ubuntu.com/ubuntu hirsute/main amd64 Packages

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

This bug was fixed in the package debootstrap - 1.0.118ubuntu1.6

---------------
debootstrap (1.0.118ubuntu1.6) focal; urgency=medium

  [ YunQiang Su ]
  * stage1: re-mkdir /proc instead of umount if it is a symlink (LP: #1948713)

 -- Daniel Watkins <email address hidden> Mon, 25 Oct 2021 14:47:59 -0400

Changed in debootstrap (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for debootstrap 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 debootstrap - 1.0.123ubuntu6.2

---------------
debootstrap (1.0.123ubuntu6.2) hirsute; urgency=medium

  [ YunQiang Su ]
  * stage1: re-mkdir /proc instead of umount if it is a symlink (LP: #1948713)

 -- Brian Murray <email address hidden> Fri, 19 Nov 2021 10:54:07 -0800

Changed in debootstrap (Ubuntu Hirsute):
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.