On Mon, 2026-11-30 at 01:00 +0100, Johannes Schauer Marin Rodrigues
wrote:
> Hi,
>
> Quoting Benjamin Drung (2026-11-28 00:07:35)
> > > > Also add updates and security mirrors when a URI is specified
> > > >
> > > > `get_sourceslist_by_suite` will add updates and security mirrors when no
> > > > URI is specified on the command line, but it will not be added when a
> > > > URI is specified. This is inconsistent and probably not what a user
> > > > wants by default.
> > >
> > > This is a breaking change. What motivation do you have for breaking the
> > > interface? Ideally, I'd only break the interface if there is a reason
> > > like "if
> > > we don't break it, then we cannot have feature XY" or "we don't break it,
> > > we
> > > actually fix a bug". I don't see either of that in this case. Can you
> > > elaborate?
> > >
> > > For me it's logical that a mirror to "security.debian.org" is *not*
> > > specified
> > > when the user explicitly says which mirror they want the packages to come
> > > from.
> > > Did you only change it because the existing behaviour felt illogical to
> > > you or
> > > because the Ubuntu support you wanted to implement cannot work otherwise?
> >
> > I was surprised when I noticed that specifying a mirror disabled the
> > additional repositories and the security mirror. So yes, this behavior
> > felt illogical to me.
> >
> > IIRC when I do an installation of Debian/Ubuntu I might be able to pick
> > a mirror, but the security mirror will be added anyway. I would expect
> > mmdebstrap to behave similar to it.
>
> Well, yes because debian-installer does it in a two-step process: it first
> uses
> debootstrap to create a chroot *without* security mirrors and then later adds
> the mirror and runs apt-update and apt-upgrade again.
>
> > The logical behavior for me is: If I provide a $foo.list or $foo.sources
> > file, I will get exactly this for my apt sources.
>
> We agree on this.
>
> > Otherwise I get the whole repository defaults with the default mirror or the
> > mirror that I specify.
>
> Okay, I now see where you are coming from. I agree that this could be a
> reasonable default behaviour. Alas, it is not what mmdebstrap used since the
> very beginning and I do not find your your alternate reasoning strong enough
> to
> break behaviour for existing users of mmdebstrap. I think to break the
> documented interface, a really strong reason must exist.
>
> > Currently there is no way to just replace the default mirror with a custom
> > one. Since we do not have something like http://deb.debian.org/debian for
> > Ubuntu, using $CC.archive.ubuntu.com as mirror is common on Ubuntu.
>
> Ah okay, I see then that the inability of mmdebstrap to just replace the
> default mirror but still do the default action of adding updates and security
> mirrors is bad for Ubuntu as a derivative.
I though about how to implement that feature (just replace the default
mirror), and changing the default was the cleanest solution (adding a
--mirror option would be a bit confusing). I see the point that you want
to keep backward compatibility. As alternative, you could bump the
version to 2 and announce this change. I am open to other solutions, but
I haven't found a better one.
> What is the use-case for using $CC.archive.ubuntu.com instead of
> archive.ubuntu.com? Is it just for speed? In which situation would it be used?
> By users of mmdebstrap on the command line or by programs which are wrappers
> around mmdebstrap like sbuild?
The reasons are mainly speed and latency, but also to not put so much
load on the main archive.ubuntu.com.
I would use $CC.archive.ubuntu.com when using mmdebstrap (or bdebstrap)
and have this line in my sbuild config:
push @{$unshare_mmdebstrap_extra_args},
qr/^(trusty|xenial|bionic|focal|jammy|noble|resolute|stonking|tenacious)/,
['http://de.archive.ubuntu.com/ubuntu'];
To compare it with other tools: If you install Ubuntu 26.04 desktop in
Germany (German language and location), you will get
http://de.archive.ubuntu.com/ubuntu in your apt sources by default. So
using a country mirror is the default behaviour and what most desktop
users will use. My local Ubuntu server uses the country mirror as well,
but I am not sure if that was the default or if I changed it afterwards
(would need to test that).
> > > > Die folgenden Signaturen konnten nicht überprüft werden, weil ihr
> > > > öffentlicher Schlüssel nicht verfügbar ist: NO_PUBKEY 6ED0E7B82643E131
> > > > NO_PUBKEY 78DBA3BC47EF2265 NO_PUBKEY F8D2585B8783D481
> > > > Paketlisten werden gelesen… Fertig
> > > > W: http://deb.debian.org/debian/dists/oldstable/InRelease: Loading
> > > > /etc/apt/trusted.gpg from deprecated option Dir::Etc::Trusted
> > > > W: OpenPGP-Signaturüberprüfung fehlgeschlagen:
> > > > http://deb.debian.org/debian oldstable InRelease: Die folgenden
> > > > Signaturen konnten nicht überprüft werden, weil ihr öffentlicher
> > > > Schlüssel nicht verfügbar ist: NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY
> > > > 78DBA3BC47EF2265 NO_PUBKEY F8D2585B8783D481
> > > > E: Das Depot »http://deb.debian.org/debian oldstable InRelease« ist
> > > > nicht signiert.
> > > > N: Eine Aktualisierung von solch einem Depot kann nicht auf eine
> > > > sichere Art durchgeführt werden, daher ist es standardmäßig deaktiviert.
> > > > N: Weitere Details zur Erzeugung von Paketdepots sowie zu deren
> > > > Benutzerkonfiguration finden Sie in der Handbuchseite apt-secure(8).
> > > > N: Einige Quellen können modernisiert werden. Führen Sie dafür »apt
> > > > modernize-sources« aus.
> > > > running cleanupapt
> > > > does not exist: ./shared/cache.A/apt/var/cache/apt/archives/*.deb
> > > > does not exist:
> > > > ./shared/cache.A/apt/var/cache/apt/archives/partial/*.deb
> > > > rmdir: failed to remove
> > > > './shared/cache.A/apt/var/lib/apt/lists/partial': Directory not empty
> > > > ```
> > >
> > > I never ran make_mirror.sh on a Debian derivative. The above sounds like
> > > you
> > > don't have debian-archive-keyring or similar installed?
> > > >
> >
> > I have debian-archive-keyring 2025.1ubuntu1 installed.
>
> Ah, I have another theory. Can you first verify that the desired key is in the
> expected file on your system:
>
> gpg --with-colons --show-keys /usr/share/keyrings/debian-archive-keyring.gpg
> | grep 6ED0E7B82643E131
$ gpg --with-colons --show-keys /usr/share/keyrings/debian-archive-keyring.gpg
| grep 6ED0E7B82643E131
sub:-:4096:1:6ED0E7B82643E131:1674301461:1926589461:::::s::::::23:
fpr:::::::::4CB50190207B4758A3F73A796ED0E7B82643E131:
> mmdebstrap automatically adds a signed-by to a sources.list entry if needed.
> This does not happen in make_mirror.sh. To test this theory, could you edit
> the
> entries that start with "deb [arch=$nativearch] ..." to include a signed-by
> value of the keyring you found to contain the desired fingerprint?
> >
Yes, adding signed-by=/usr/share/keyrings/debian-archive-keyring.gpg to
those lines make the scripts pass this failure. So could you update the
script to explicitly specify the signed-by key?
> > > I don't want to remove UNSHARE_MMDEBSTRAP_DISTRO_MANGLE nor
> > > UNSHARE_MMDEBSTRAP_EXTRA_ARGS from sbuild because I think they still
> > > allow a
> > > flexible way to cook up something very custom. But yes, the plan is to
> > > move a
> > > lot of automatism to mmdebstrap so that users of sbuild only have to
> > > resort to
> > > these settings if their use-case is somewhat special.
> > >
> >
> > I don't propose to remove those setting, but the mmdebstrap change would
> > trim down the defaults to:
> >
> > UNSHARE_MMDEBSTRAP_DISTRO_MANGLE => [qr/^(unreleased|UNRELEASED.*)$/ =>
> > 'unstable']
> > UNSHARE_MMDEBSTRAP_EXTRA_ARGS => []
>
> Yes, that's what I'd like to achieve.
> >
And this is what my patches sbuild has as default.
> > > Your plan involves coordination with distro-info maintainers. I actually
> > > wanted
> > > to first prototype something which fulfills the needs of mmdebstrap (I'm
> > > not
> > > quite sure yet how that would look like myself) and once that works, I can
> > > propose how to best store this information in a machine-readable format to
> > > distro-info. Once distro-info carries it, I can switch mmdebstrap to that.
> > >
> >
> > FYI: I am the author/maintainer of distro-info.
>
> Hah! I didn't know. Excellent! Now I will keep you even more in the loop. :)
>
> > > Why the change in 'refactor: call get_suite_by_vendor earlier'?
> > Because function like get_vendor_by_suite will need suite_by_vendor
> > earlier.
>
> Should that change then not be part of the commit which introduce this need?
>
> Or, alternatively, explain in the commit message something like: "this is in
> preparation for..."
I added the explanation sentence.
> > > Many people value how fast mmdebstrap is. I'm hesitant to make such kind
> > > of
> > > "older than a decade" release detection logic by default because of that.
> > > I'm
> > > tending towards recommending that those who use mmdebstrap in a way where
> > > they
> > > often have to do that, then they can add the --hook-dir they need. Another
> > > reason against making the check the default is that I would estimate that
> > > the
> > > vast majority of mmdebstrap (or debootstrap) users do use it together with
> > > distros younger than five years and things should work out-of-the-box for
> > > those.
> >
> > I agree for Debian jessie, but Ubuntu 14.04 still gets support. So there
> > are users (like me) who want to build for those old releases.
>
> Okay, we are talking about an EOL of in April 2031. That's in 4.3 years.
The hope dies last. The support duration started much shorter and was
extended since then. Let's see if the support really ends in April 2031.
>
> > Making mmdebstrap support old releases shouldn't be expensive. The code
> > would look something like (plus documenting it in the man page):
> >
> > # Quirks for old release before 2017
> > sub get_default_hooks_by_suite {
> > my $suite = shift;
> > my $variant = shift;
> > my $mode = shift;
> >
> > if (any { $_ eq $suite } keys ('jessie', 'wheezy', ...)) {
> > return ('jessie-or-older');
> > } elsif ($suite eq 'xenial') {
> > if ($variant eq 'standard' && $mode ne 'root') {
> > return ('xenial', 'skip-makedev');
> > }
> > return ('xenial');
> > } elsif (any { $_ eq $suite } keys ('trusty', 'precise', ...)) {
> > if ($variant eq 'standard' && $mode ne 'root') {
> > return ('jessie-or-older', 'skip-makedev');
> > }
> > return ('jessie-or-older');
> > }
> > return ();
> > }
> >
> > Would you be open to such kind of change?
>
> This becomes tricky quickly. The idea that you know which suite you are
> building for flies out of the window once you either build for a
> rolling-release (there is a certain point in unstable on snapshot.debian.org
> before which jessie-or-older is required and we never know when "jessie"
> starts) or you build from a sources.list without passing the suite name to
> mmdebstrap explicitly (you can pass the empty string). There is also the
> question of: if there is an automatism, there needs to be a way to disable it.
> How would a good way to do that look like?
>
> So yes, your proposal would be quick but even if we limit ourselves to Debian,
> it would make the assumption that we pass a non-empty suite name and that we
> are not using unstable or testing.
I see your point. Instead of implementing that, I put those two lines in
my sbuild config:
push @{$unshare_mmdebstrap_extra_args}, qr/^xenial/,
['--hook-dir=/usr/share/mmdebstrap/hooks/xenial/'];
push @{$unshare_mmdebstrap_extra_args}, qr/^jammy/,
['--hook-dir=/usr/share/mmdebstrap/hooks/jessie-or-older/'];
That looks clean enough for me. So ditch this automatism idea and just
let sbuild carry those two entries by default (at least for Ubuntu).
> Note also, that the skip-makedev hook is not necessarily dependent on the root
> mode hook. If you are inside an unprivileged container, then you are root but
> you still cannot do mknod.
>
> I only now realize that you only need these hooks for the 'standard' variant?
> What is your use case to create such chroots? I must admit that I only created
> --variant=standard because there was a priority of that name not because it
> was
> useful for anything. What is your use-case?
I don't have a recent use-case. My use-case is to use mmdebstrap for
sbuild (the buildd variant). While debugging the failure there, I was
calling mmdebstrap manually and --variant=standard happened to be the
default.
> > > > Then sbuild should default to add this hook to support building on old
> > > > releases by default.
> > >
> > > Okay, you implement it and you know ubuntu better than I, so I will leave
> > > the
> > > naming of this up to you.
> >
> > The drawback of having such a maybe-old-distro hook would that it
> > clutters the output even for recent releases.
>
> I only see four additional lines of output when I add the hook to a creation
> of
> an unstable chroot. Is that too much?
This is my perfectionism not liking it. With the two line sbuild config
change about, the maybe-jessie-or-older is not needed.
With that said, I think the skip-makedev and xenial hooks plus the
jessie-or-older change are ready to be merged and no more hooks are
needed (at least for my sbuild use case).
--
Benjamin Drung
Debian & Ubuntu Developer