🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #5946

Bug#1154510: mmdebstrap fails to build images for Ubuntu xenial and trusty

#5946
From: Benjamin Drung
Date: Tue, 24 Nov 2026 15:50
248 lines
11687 bytes
--=-7VpY7Pc0EPUVb0yDWTnE
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, 2026-11-20 at 06:03 +0100, Johannes Schauer Marin Rodrigues
wrote:
> Hi,
>=20
> Quoting Benjamin Drung (2026-11-19 22:42:43)
> > Package: mmdebstrap
> > Version: 1.7.0-5
> > Severity: normal
> > Tags: ftbfs
>=20
> I don't think this is the correct tag because this is not mmdebstrap fail=
ing to
> build on Ubuntu but mmdebstrap not being able to create chroots for Ubunt=
u, no?
>=20

Yes, that tag is wrong. No idea how I happen to add that.

> > X-Debbugs-Cc: debian-amd64@lists.debian.org, bdrung@debian.org
> > User: debian-amd64@lists.debian.org
> > Usertags: amd64
> >=20
> > Dear Maintainer,
> >=20
> > mmdebstrap fails to build images for Ubuntu xenial:
> >=20
> > ```
> > $ mmdebstrap xenial xenial.tar http://archive.ubuntu.com/ubuntu
> > I: automatically chosen mode: unshare
> > I: chroot architecture amd64 is equal to the host's architecture
> > I: finding correct signed-by value...
> > done
> > I: automatically chosen format: tar
> > I: using /tmp/mmdebstrap.SPrWJ7eEHl as tempdir
> > I: running apt-get update...
> > done
> > I: downloading packages with apt...
> > done
> > I: extracting archives...
> > done
> > I: installing essential packages...
> > done
> > [...]
> > Setting up systemd (229-4ubuntu21.31) ...
> > Created symlink /etc/systemd/system/getty.target.wants/getty@tty1.servi=
ce, pointing to /lib/systemd/system/getty@.service.
> > Created symlink /etc/systemd/system/multi-user.target.wants/remote-fs.t=
arget, pointing to /lib/systemd/system/remote-fs.target.
> > Created symlink /etc/systemd/system/sysinit.target.wants/systemd-timesy=
ncd.service, pointing to /lib/systemd/system/systemd-timesyncd.service.
> > Initializing machine ID from random generator.
> > Adding group `systemd-journal' (GID 101) ...
> > Done.
> > chfn: PAM: Critical error - immediate abort
> > adduser: `/usr/bin/chfn -f systemd Time Synchronization systemd-timesyn=
c' returned error code 1. Exiting.
> > dpkg: error processing package systemd (--install):
> >  subprocess installed post-installation script returned error exit stat=
us 1
>=20
> Why do you suspect mmdebstrap to be the problem, given the above? Did you
> investigate the reason for chfn exiting with a ciritical error related to=
 pam?

I reported a tracking bug in Ubuntu and thought that I can forward it to
Debian since Debian is affected as well. So it could be in pam or
passwd.

> It reminds me of a problem we used to have six years ago with mmdebstrap
> running in "proot" mode (that mode no longer exists). Under proot, one wo=
uld
> get the following in the systemd postinst:
>=20
> chfn: PAM: System error
> adduser: `/usr/bin/chfn -f systemd Time Synchronization systemd-timesync'=
 returned error code 1. Exiting.
>=20
> And here is a similar error with fakechroot
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D745082#75
>=20
> And here is the issue with proot: https://github.com/proot-me/PRoot/issue=
s/156
>=20
> So in either case it wasn't mmdebstrap doing the wrong thing. Can you pre=
sent
> evidence that this is actually a bug in mmdebstrap?

Thanks. That was a helpful pointer. I tracked down the upstream change
for pam and tested it: It still did not fix it. After more
investigation, I found a solution for that part: libpam-runtime should
be configured before systemd. Workaround demonstrate that:

mmdebstrap --extract-hook=3D'for f in common-auth common-account common-
session common-password; do printf "auth sufficient
pam_permit.so\naccount sufficient pam_permit.so\nsession sufficient
pam_permit.so\npassword sufficient pam_permit.so\n" > "$1/etc/pam.d/$f";
done' xenial xenial.tar http://archive.ubuntu.com/ubuntu

Is this something that should be done by mmdebstrap?

It now fails at a later stage:

```
I: installing remaining packages inside the chroot...
[...]
Setting up makedev (2.3.1-93ubuntu2~ubuntu16.04.1) ...
grep: /proc/1/environ: Permission denied
mknod: mem-: Operation not permitted
makedev mem c 1 1 root kmem 0640: failed
mknod: kmem-: Operation not permitted
[...]
```

This looks like a bug in the postinst of makedev. makedev has this
check:


if which systemd-detect-virt > /dev/null; then
    if container=3D$(systemd-detect-virt -c)
    then
        echo "$container container detected, aborting due to container-
managed /dev."
        exit 0
    fi
fi

but this does not seem to take action. As alternative, mmdebstrap could
create those dev devices before configuring makedev (makedev checks with
"test -e /dev/<dev>").

> > The systemd package calls:
> >=20
> > adduser --quiet --system --group --no-create-home --home /run/systemd \
> >     --gecos "systemd Time Synchronization" systemd-timesync
> >=20
> > Then adduser calls /usr/bin/chfn from passwd.
> >=20
> > I compared xenial with bionic: on xenial systemd is installed as part o=
f
> > the essential packages, but on bionic systemd is part of the remaining
> > packages.
>=20
> Still sounds like a bug in one of the involved packages to me and not lik=
e a
> bug in mmdebstrap.
>=20
> > mmdebstrap also fails to build images for Ubuntu trusty:
> >=20
> > ```
> > $ mmdebstrap trusty trusty.tar http://archive.ubuntu.com/ubuntu
> > I: automatically chosen mode: unshare
> > I: chroot architecture amd64 is equal to the host's architecture
> > I: finding correct signed-by value...
> > done
> > I: automatically chosen format: tar
> > I: using /tmp/mmdebstrap.w0v46VeV27 as tempdir
> > I: running apt-get update...
> > done
> > I: downloading packages with apt...
> > done
> > I: extracting archives...
> > done
> > I: installing essential packages...
> > done
> > dpkg: error: failed to open package info file `/var/lib/dpkg/available'=
 for reading: No such file or directory
>=20
> /var/lib/dpkg/available is no longer needed since dpkg 1.17.11, so mmdebs=
trap
> stopped writing it. For creating chroots for older releases, have a look =
at the
> jessie-or-older hooks shipped by mmdebstrap. Using these you can create c=
hroots
> for Debian unstable going as far back as 2006-08-04 using snapshot.debian=
.org.
> That should be more than sufficient for Ubuntu, no?

Thanks for this pointer.=C2=A0I tried:

mmdebstrap trusty trusty.tar "deb [trusted=3Dyes] http://de.archive.ubuntu.=
com/ubuntu trusty main universe
deb [trusted=3Dyes] http://de.archive.ubuntu.com/ubuntu trusty-updates main=
 universe" -v --hook-dir=3D/usr/share/mmdebstrap/hooks/jessie-or-older

The jessie-or-older/extract01.sh scripts fails with dpkg complaining
about a missing awk. Attached a tested patch for mmedebstrap to also try
to install mawk. I successfully tested that the jessie command from the
man page still works.

With this patch trusty gets as far as the xenial case mentioned above.

> > I know that these are old Ubuntu releases, but they still get paid
> > support by Canonical. I like to use sbuild unshare to build package for
> > these releases.
>=20
> I'm not here to volunteer my freetime for Canonical. If somebody is payin=
g
> money for this, then they should pay a person to fix these things. I hope=
 I was
> able to give you sufficient feedback for such a thing to happen.

Thanks. Your feedback was very helpful to help me move this topic
further. Feedback on my comments above will be appreciated.

--=20
Benjamin Drung
Debian & Ubuntu Developer

--=-7VpY7Pc0EPUVb0yDWTnE
Content-Disposition: attachment;
	filename="0001-hooks-jessie-or-older-also-install-mawk-for-Ubuntu.patch"
Content-Type: text/x-patch;
	name="0001-hooks-jessie-or-older-also-install-mawk-for-Ubuntu.patch";
	charset="UTF-8"
Content-Transfer-Encoding: base64

RnJvbSA5ODVjNWY5ZjcwOWRlYzExMzg0MTQxMDAyMDA2ZWU1YmFkOGUwZGVhIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBCZW5qYW1pbiBEcnVuZyA8YmVuamFtaW4uZHJ1bmdAY2Fub25p
Y2FsLmNvbT4KRGF0ZTogVHVlLCAyNCBOb3YgMjAyNiAxNjozMDo0NiArMDEwMApTdWJqZWN0OiBb
UEFUQ0hdIGhvb2tzL2plc3NpZS1vci1vbGRlcjogYWxzbyBpbnN0YWxsIG1hd2sgKGZvciBVYnVu
dHUpCgpVYnVudHUgMTQuMDQgTFRTICJ0cnVzdHkiIG5lZWRzIHRoZSBqZXNzaWUtb3Itb2xkZXIg
aG9vay4gSW4gY29udHJhc3QgdG8KRGViaWFuIGplc3NpZSwgVWJ1bnR1J3MgYmFzZS1maWxlcyBw
cmUtZGVwZW5kcyBvbiBhd2sgKGFuZCBtYXdrIHByb3ZpZGVzCmF3aykuCgpCdWc6IGh0dHBzOi8v
YnVncy5kZWJpYW4ub3JnLzExNTQ1MTAKLS0tCiBob29rcy9qZXNzaWUtb3Itb2xkZXIvZXh0cmFj
dDAxLnNoIHwgN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wogCWV2YWwgJ3ZhbD0kZm5hbWVfJyIkdmFyIgogCVsgLXogIiR2YWwiIF0gJiYgY29udGludWUK
IAljaHJvb3QgIiRUQVJHRVQiIGRwa2cgLS1pbnN0YWxsIC0tZm9yY2UtZGVwZW5kcyAiJHZhbCIK
LS0gCjIuNTMuMAoK


--=-7VpY7Pc0EPUVb0yDWTnE--
Technical Details
Message-ID: <O30Wl-dTPs-11@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <O1iaZ-cXIu-1@gated-at.bofh.it> <O1p2N-d1rv-3@gated-at.bofh.it> <O1iaZ-cXIu-1@gated-at.bofh.it> <O1p2N-d1rv-3@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Benjamin Drung <bdrung@debian.org>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1154510: mmdebstrap fails to build images for Ubuntu xenial and trusty
Date: Tue, 24 Nov 2026 16:50:01 +0100
Message-ID: <O30Wl-dTPs-11@gated-at.bofh.it>
References: <O1iaZ-cXIu-1@gated-at.bofh.it> <O1p2N-d1rv-3@gated-at.bofh.it> <O1iaZ-cXIu-1@gated-at.bofh.it> <O1p2N-d1rv-3@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Tue Nov 24 15:41:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.7
Reply-To: Benjamin Drung <bdrung@debian.org>, 1154510@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: josch@debian.org
X-Debian-Pr-Message: followup 1154510
X-Debian-Pr-Package: mmdebstrap
X-Debian-Pr-Keywords: ftbfs
X-Debian-Pr-Source: mmdebstrap
Content-Type: multipart/mixed; boundary="=-7VpY7Pc0EPUVb0yDWTnE"
User-Agent: Evolution 3.56.2-9 
MIME-Version: 1.0
X-Debian-User: bdrung
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2004703
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 248
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Tue, 24 Nov 2026 16:40:09 +0100
X-Original-Message-ID: <91600a9f37efc9aaca21e98d6beb36557bcb6b68.camel@debian.org>
X-Original-References: <179512456377.1844508.10007620892073787783.reportbug@deep-thought>  <179515098240.2951.3635647472516703784@localhost> <179512456377.1844508.10007620892073787783.reportbug@deep-thought> <179515098240.2951.3635647472516703784@localhost>