Actually support Ubuntu

Bug #1923145 reported by TJ
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mkosi (Ubuntu)
Fix Released
Medium
Unassigned
Bionic
New
Undecided
Unassigned
Focal
Fix Released
Medium
Unassigned
Groovy
Fix Released
Medium
Unassigned
Hirsute
Fix Released
Medium
Unassigned

Bug Description

[impact]

mkosi does not work on ubuntu when using distribution detection instead of specifying distribution and release codename

[test case]

see original description

[regression potential]

any regression would likely result in immediate failure on ubuntu and/or when running mkosi for ubuntu

[scope]

this is needed for f,g,h

this was fixed upstream by commit 743a06b0afd1215c4a63e7f30d8f10a128d07293 which was first included in version 6, so this is needed in h and earlier.

this is also needed for b, but that version is so old that it would require other changes

[other info]

debian MR:
https://salsa.debian.org/systemd-team/mkosi/-/merge_requests/2

[original description]

version 5-1 does not support Ubuntu correctly in that it tries to use the version number rather than version codename in arguments to debootstrap.

$ sudo mkosi
...
Traceback (most recent call last):
  File "/usr/bin/mkosi", line 4539, in <module>
    main()
  File "/usr/bin/mkosi", line 4535, in main
    run_verb(args)
  File "/usr/bin/mkosi", line 4507, in run_verb
    build_stuff(args)
  File "/usr/bin/mkosi", line 4333, in build_stuff
    raw, tar, root_hash = build_image(args, workspace, do_run_build_script=False, cleanup=True)
  File "/usr/bin/mkosi", line 4153, in build_image
    install_distribution(args, workspace.name,
  File "/usr/bin/mkosi", line 1987, in install_distribution
    install[args.distribution](args, workspace, do_run_build_script)
  File "/usr/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "/usr/bin/mkosi", line 1717, in install_ubuntu
    install_debian_or_ubuntu(args, workspace, do_run_build_script=do_run_build_script, mirror=args.mirror)
  File "/usr/bin/mkosi", line 1633, in install_debian_or_ubuntu
    run(cmdline, check=True)
  File "/usr/bin/mkosi", line 69, in run
    return subprocess.run(cmdline, **kwargs)
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['debootstrap', '--verbose', '--variant=minbase', '--include=systemd-sysv', '--exclude=sys
v-rc,initscripts,startpar,lsb-base,insserv', '--components=main', '--merged-usr', '"20.04"', '/var/tmp/mkosi-akzr5g4y/root', 'http
://archive.ubuntu.com/ubuntu']' returned non-zero exit status 1.

Notice the "20.04" argument passed to debootstrap, which should be "focal".

TJ (tj)
Changed in mkosi (Ubuntu):
status: New → In Progress
Revision history for this message
TJ (tj) wrote :

This applies for 21.04, 21.10 and 20.04

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

The attachment "Debdiff from 5-1" 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
TJ (tj)
description: updated
Dan Streetman (ddstreet)
description: updated
Changed in mkosi (Ubuntu Hirsute):
importance: Undecided → Medium
Changed in mkosi (Ubuntu Groovy):
importance: Undecided → Medium
Changed in mkosi (Ubuntu Focal):
importance: Undecided → Medium
Revision history for this message
Dan Streetman (ddstreet) wrote :

I adjusted the patch slightly to match the upstream commit, and uploaded to f/g/h.

Thanks!

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

This bug was fixed in the package mkosi - 5-1ubuntu1

---------------
mkosi (5-1ubuntu1) hirsute; urgency=medium

  * d/p/Fix-detect_distribution-on-ubuntu.patch:
    actually support Ubuntu for debootstrap (LP: #1923145)

 -- Tj <email address hidden> Fri, 09 Apr 2021 08:44:19 +0100

Changed in mkosi (Ubuntu Hirsute):
status: In Progress → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello TJ, or anyone else affected,

Accepted mkosi into groovy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mkosi/5-1ubuntu0.20.10.1 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-groovy to verification-done-groovy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-groovy. 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 mkosi (Ubuntu Groovy):
status: New → Fix Committed
tags: added: verification-needed verification-needed-groovy
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello TJ, or anyone else affected,

Accepted mkosi into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mkosi/5-1ubuntu0.20.04.1 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 mkosi (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Dan Streetman (ddstreet) wrote :

ubuntu@lp1923145-g:~$ dpkg -l|grep mkosi
ii mkosi 5-1 all create legacy-free OS images
ubuntu@lp1923145-g:~$ sudo mkosi
...
E: No such script: /usr/share/debootstrap/scripts/"20.10"
...

ubuntu@lp1923145-g:~$ dpkg -l|grep mkosi
ii mkosi 5-1ubuntu0.20.10.1 all create legacy-free OS images
ubuntu@lp1923145-g:~$ sudo mkosi
...
‣ Installing Ubuntu complete.
...

ubuntu@lp1923145-f:~$ dpkg -l|grep mkosi
ii mkosi 5-1 all create legacy-free OS images
ubuntu@lp1923145-f:~$ sudo mkosi
...
E: No such script: /usr/share/debootstrap/scripts/"20.04"
...

ubuntu@lp1923145-f:~$ dpkg -l|grep mkosi
ii mkosi 5-1ubuntu0.20.04.1 all create legacy-free OS images
ubuntu@lp1923145-f:~$ sudo mkosi
...
‣ Installing Ubuntu complete.
...

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

This bug was fixed in the package mkosi - 5-1ubuntu0.20.10.1

---------------
mkosi (5-1ubuntu0.20.10.1) groovy; urgency=medium

  * d/p/Fix-detect_distribution-on-ubuntu.patch:
    actually support Ubuntu for debootstrap (LP: #1923145)

 -- Tj <email address hidden> Fri, 09 Apr 2021 08:44:19 +0100

Changed in mkosi (Ubuntu Groovy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for mkosi 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 mkosi - 5-1ubuntu0.20.04.1

---------------
mkosi (5-1ubuntu0.20.04.1) focal; urgency=medium

  * d/p/Fix-detect_distribution-on-ubuntu.patch:
    actually support Ubuntu for debootstrap (LP: #1923145)

 -- Tj <email address hidden> Fri, 09 Apr 2021 08:44:19 +0100

Changed in mkosi (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.