🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#6449
From: Benjamin Drung
Date: Fri, 27 Nov 2026 16:30
228 lines
11191 bytes
On Fri, 2026-11-27 at 10:16 +0100, Johannes Schauer Marin Rodrigues
wrote:
> > 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:
> 
> I think the bug is that you install makedev. ;)
> 
> Why would you need makedev?

Because ubuntu-minimal depends on it in Ubuntu <= 16.04. Not installing
it would be the better solution, but this is an old Ubuntu release where
it's unlikely to land such a change. makedev was demoted to universe in
18.04 and is not installed by default any more. So this is an "old"
distro problem.

> > As alternative, mmdebstrap could
> > create those dev devices before configuring makedev (makedev checks with
> > "test -e /dev/<dev>").
> 
> mmdebstrap does not create /dev/mem nor /dev/kmem. It creates those
> devices which debootstrap creates to increase compatibility. That
> makedev wants to create /dev/mem and fails because it cannot mknod is
> either a problem of makedev itself or that the user who really wants
> makedev is not executing mmdebstrap with --mode=root. The root mode
> is the only mode where a real mknod is possible.
> 
> > > /var/lib/dpkg/available is no longer needed since dpkg 1.17.11, so mmdebstrap
> > > 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 chroots
> > > 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. I tried:
> > 
> > mmdebstrap trusty trusty.tar "deb [trusted=yes] http://de.archive.ubuntu.com/ubuntu trusty main universe
> > deb [trusted=yes] http://de.archive.ubuntu.com/ubuntu trusty-updates main universe" -v --hook-dir=/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.
> 
> Thank you, I locally applied that patch to the branch with your other
> Ubuntu related commits. I still want to clean that up but see the
> other mail thread about that topic. I think you didn't reply to my
> review yet?

I did answer to that thread and attached it to the "Please support
specifying wanted suites" bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1140618#34

> > > I'm not here to volunteer my freetime for Canonical. If somebody is paying
> > > 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.
> 
> I hope I addressed all the points.

Yes.

On Fri, 2026-11-27 at 10:38 +0100, Johannes Schauer Marin Rodrigues wrote:
> Hi,
> 
> thank you for these patches! I see you updated
> 0001-hooks-jessie-or-older-also-install-maw. I locally rewrote history to
> instead contain the patch from this mail. Thank you for being verbose in your
> commit message.

I rebased my ubuntu-support branch and pushed it.

> In your hooks, could you put your name and copyright in form of a SPDX header
> at the top?

Yes. Done and pushed in the ubuntu-support branch.

> Quoting Benjamin Drung (2026-11-27 00:24:40)
> > thanks for your help. Attached three patches to add/enhance hooks to make
> > xenial and trusty building:
> > 
> > mmdebstrap xenial /dev/null http://archive.ubuntu.com/ubuntu --hook-dir=./hooks/xenial/ --hook-dir=./hooks/skip-makedev/
> > mmdebstrap trusty /dev/null http://archive.ubuntu.com/ubuntu --hook-dir=./hooks/jessie-or-older/ --hook-dir=./hooks/skip-makedev/
> 
> Cool!
> 
> > What is your opinion to auto-add those hooks when detecting suites that need
> > it? mmdebstrap could gain a parameter to disable that behaviour.
> 
> The situation is much better today but when mmdebstrap started, debootstrap was
> full of crazy stunts to work around all kinds of distro-specific behaviour. The
> fact that it's only "old" ubuntu releases which require these workaround shows
> me that the time I spent back then to file patches against apt, dpkg and other
> offending packages did have an effect and these days, the 13-line shell script
> from the mmdebstrap is indeed sufficient to create a Debian chroot. This was
> not the case 10 years ago.

Thanks for that work. It really paid off.

> So I also see mmdebstrap as my motivation to make sure that Debian does not
> regress and that it is possible to create a distro chroot without the
> bootstrapping tool implementing workarounds. If anything like a workaround is
> needed, then that has to go into the packages themselves or in the package
> managers like apt or dpkg in a declarative format. This is to follow the ideas
> of component-based software engineering. If I add package-specific workarounds
> into mmdebstrap, then that would be like fixing a bug in gcc by adding a change
> to apt which fixes that bug. We don't do that. We expect gcc to carry the fix
> and not the installation tool.

I fully agree. I see no reason why mmdebstrap should carry workarounds
for recent Debian or Ubuntu releases.

> That being said, old distros still require a lot of workarounds and most of
> them can no longer be fixed. This is what the jessie-or-older hook is for. It
> contains all the hacks which used to be necessary and which debootstrap worked
> around by manually selecting installation order and some such. Since
> debootstrap existed we were complacent and there was no pressure to fix these
> things in the respective packages because the bootstrapping tool took care of
> papering over them. This bugged me, so I filed patches and for modern
> derivatives, the jessie-or-older hook is no longer required.
> 
> Since I want to keep it that way, I would be very much against adding any
> command line options which enable or disable distro-specific hacks. Those
> options do then have to be carried forever. I want to go the opposite
> direction: fix packages so that hacks never have to be used again by a
> bootstrapping tool.
> 
> For old distros: that's what the hooks are for. They allow you to implement any
> hack you desire (as you now can confirm).

We know what quirks are needed for old distros and we know that those
old distros won't be updated for that any more. My idea was that
mmdebstrap could enable those hooks by default when it detects an old
distro that needs it.

> About auto-adding those, did you have a look at the maybe-jessie-or-older hook?
> That one implements the auto-add behaviour that you are asking for. If you
> don't know what distro you are bootstrapping and if you want the hacks for old
> distros to automatically be applied if your distro is too old, then the
> maybe-jessie-or-older hook will do the auto-detection and run the
> jessie-or-older hooks only if necessary.

This would work, but clutter the output for newer distros that do not
need this hook.

> Also, would you prefer to keep the existing skip-makedev and xenial hooks which
> you proposed or would you rather write a hook called ubuntu which then does the
> auto-detection of which ubuntu-release is currently being bootstrapped and then
> does the right thing depending on the ubuntu version?
>
> Then you could use --hook-dir=./hooks/ubuntu for both trusty and xenial without
> having to remember which one of them needed the skip-makedev hook for example.

Keeping the existing skip-makedev and xenial hooks make sense, since
those are the equivalent to the jessie-or-older hook. We could add a
maybe-xenial-or-older hook that does the equivalent to maybe-jessie-or-
older. Then users can use:

mmdebstrap $debian-codename --hook-dir=./hooks/maybe-jessie-or-older
mmdebstrap $ubuntu-codename --hook-dir=./hooks/maybe-xenial-or-older

Or have one common maybe-old-distro hook. So that you could use the same
parameters.

Then sbuild should default to add this hook to support building on old
releases by default.

-- 
Benjamin Drung
Debian & Ubuntu Developer
Technical Details
Message-ID: <O46ZH-euJJ-5@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!fu-berlin.de!bofh.it!news.nic.it!robomod
References: <O1iaZ-cXIu-1@gated-at.bofh.it> <O1p2N-d1rv-3@gated-at.bofh.it> <O30Wl-dTPs-11@gated-at.bofh.it> <O40hz-erfP-1@gated-at.bofh.it> <O1iaZ-cXIu-1@gated-at.bofh.it> <O40hz-erfP-1@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!fu-berlin.de!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: Fri, 27 Nov 2026 17:30:01 +0100
Message-ID: <O46ZH-euJJ-5@gated-at.bofh.it>
References: <O1iaZ-cXIu-1@gated-at.bofh.it> <O1p2N-d1rv-3@gated-at.bofh.it> <O30Wl-dTPs-11@gated-at.bofh.it> <O40hz-erfP-1@gated-at.bofh.it> <O1iaZ-cXIu-1@gated-at.bofh.it> <O40hz-erfP-1@gated-at.bofh.it>
X-Original-To: Johannes Schauer Marin Rodrigues <josch@debian.org>, 
	1154510@bugs.debian.org
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Fri Nov 27 16:25: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-Source: mmdebstrap
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
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/2005421
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 228
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Fri, 27 Nov 2026 17:23:56 +0100
X-Original-Message-ID: <e8303d2f6f525e18e9d372ba838af767a5af13fe.camel@debian.org>
X-Original-References: <179512456377.1844508.10007620892073787783.reportbug@deep-thought> 	 <179515098240.2951.3635647472516703784@localhost> 	 <91600a9f37efc9aaca21e98d6beb36557bcb6b68.camel@debian.org> 	 <179577099471.465360.6492357497625968799@localhost> <179512456377.1844508.10007620892073787783.reportbug@deep-thought> <179577099471.465360.6492357497625968799@localhost>