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.

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

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.

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.

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).

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.

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.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to