Package: mmdebstrap
Version: 0.5.1-4
Severity: minor
As at this version:
root@not-omega:/tmp/bootstrap# dpkg-query -W mmdebstrap apt
apt 1.8.2
mmdebstrap 0.5.1-4
The manpage says I can use deb822 format:
root@not-omega:/tmp/bootstrap# man mmdebstrap | grep -2 -F deb822
(defaults to "main"). If a MIRROR option happens to be an existing
file, then its contents are pasted into the chroot's sources.list.
This can be used to supply a deb822 style sources.list. If MIRROR is
"-" then standard input is pasted into the chroot's sources.list.
More
than one mirror can be specified and are appended to the chroot's
But I can't convince it to work:
root@not-omega:/tmp/bootstrap# cat live.debian-10.sources
Types: deb
URIs: http://deb.debian.org/debian
# Need contrib & non-free for intel-microcode (CPU security).
# Need backports for newer kernel (to support newer hardware).
Suites: buster buster-updates buster-proposed-updates buster-backports
Components: main contrib non-free
Types: deb
URIs: http://deb.debian.org/debian-security
Suites: buster/updates
Components: main contrib non-free
root@not-omega:/tmp/bootstrap# mmdebstrap buster live live.debian-10.sources
I: automatically chosen mode: root
I: chroot architecture amd64 is equal to the host's architecture
E: Sub-process test returned an error code (1)
W: Download is performed unsandboxed as root as file
/tmp/bootstrap/live/var/lib/apt/lists/partial couldn't be accessed by user _apt
I: running apt-get update...
done
E: Type 'Types:' is not known on line 1 in source list
/tmp/bootstrap/live/etc/apt/sources.list
E: The list of sources could not be read.
E: apt-get update -oAPT::Status-Fd=<$fd> -oDpkg::Use-Pty=false failed
As far as I can tell,
apt allows only legacy format in .list files, and
apt allows only deb822 format in .sources files.
Writing a deb822 format to sources.list.d/mmdebstrap.list:
root@not-omega:/tmp/bootstrap# diff -U0 /usr/bin/mmdebstrap
mmdebstrap-patched
--- /usr/bin/mmdebstrap 2019-10-20 08:26:10.000000000 +1100
+++ mmdebstrap-patched 2020-01-20 16:29:18.943182911 +1100
@@ -1100 +1100 @@
- open my $fh, '>', "$options->{root}/etc/apt/sources.list" or error
"cannot open /etc/apt/sources.list: $!";
+ open my $fh, '>',
"$options->{root}/etc/apt/sources.list.d/mmdebstrap.list" or error "cannot open
/etc/apt/sources.list.d/mmdebstrap.list: $!";
@@ -1189 +1189 @@
- info "content of /etc/apt/sources.list:";
+ info "content of /etc/apt/sources.list.d/mmdebstrap.list:";
@@ -1191 +1191 @@
- copy("$options->{root}/etc/apt/sources.list", *STDERR);
+
copy("$options->{root}/etc/apt/sources.list.d/mmdebstrap.list", *STDERR);
root@not-omega:/tmp/bootstrap# rm -rf live
root@not-omega:/tmp/bootstrap# perl ./mmdebstrap-patched buster live
live.debian-10.sources
I: automatically chosen mode: root
I: chroot architecture amd64 is equal to the host's architecture
E: Sub-process test returned an error code (1)
W: Download is performed unsandboxed as root as file
/tmp/bootstrap/live/var/lib/apt/lists/partial couldn't be accessed by user _apt
I: running apt-get update...
done
E: Type 'Types:' is not known on line 1 in source list
/tmp/bootstrap/live/etc/apt/sources.list.d/mmdebstrap.list
E: The list of sources could not be read.
E: apt-get update -oAPT::Status-Fd=<$fd> -oDpkg::Use-Pty=false failed
Writing a .list format to .sources:
root@not-omega:/tmp/bootstrap# diff -U0 /usr/bin/mmdebstrap
mmdebstrap-patched-2
--- /usr/bin/mmdebstrap 2019-10-20 08:26:10.000000000 +1100
+++ mmdebstrap-patched-2 2020-01-20 16:30:55.534159939 +1100
@@ -1100 +1100 @@
- open my $fh, '>', "$options->{root}/etc/apt/sources.list" or error
"cannot open /etc/apt/sources.list: $!";
+ open my $fh, '>',
"$options->{root}/etc/apt/sources.list.d/mmdebstrap.sources" or error "cannot
open /etc/apt/sources.list.d/mmdebstrap.sources: $!";
@@ -1189 +1189 @@
- info "content of /etc/apt/sources.list:";
+ info "content of /etc/apt/sources.list.d/mmdebstrap.sources:";
@@ -1191 +1191 @@
- copy("$options->{root}/etc/apt/sources.list", *STDERR);
+
copy("$options->{root}/etc/apt/sources.list.d/mmdebstrap.sources", *STDERR);
root@not-omega:/tmp/bootstrap# rm -rf live
root@not-omega:/tmp/bootstrap# perl ./mmdebstrap-patched-2 buster live
I: automatically chosen mode: root
I: chroot architecture amd64 is equal to the host's architecture
E: Sub-process test returned an error code (1)
W: Download is performed unsandboxed as root as file
/tmp/bootstrap/live/var/lib/apt/lists/partial couldn't be accessed by user _apt
I: running apt-get update...
done
E: Malformed stanza 1 in source list
/tmp/bootstrap/live/etc/apt/sources.list.d/mmdebstrap.sources (type)
E: The list of sources could not be read.
E: apt-get update -oAPT::Status-Fd=<$fd> -oDpkg::Use-Pty=false failed
Therefore I think mmdebstrap must either:
1. convince apt to be less picky; or
2. detect which format (.list or .sources) was provided, and
use the corresponding file name; or
3. change the manpage from "deb822 works" to "deb822 does not work".
PS: I glanced at "git diff 0.5.1 0.6.0 -- mmdebstrap".
I *think* the issue is present there, but I haven't tested.