Compare commits

..

5 commits

Author SHA1 Message Date
d3952de003 Let apt decide unpack order instead of sorting filenames
Now that the deb files can reside in different places sorting them leads
to subtil differences in the order and hence the created chroot. apts
unpack order on the other hand might not be a good order (but why would
one sorted from a to z be one?), but it is far more stable as it is
independent on the filenames.
2022-04-24 11:56:50 +02:00
e9fa78c438 Support file:// mirrors the same way copy:// is supported
As long as you can make it so that the same path to the deb file works
inside and outside of the chroot using file:// as a mirror is no longer
a problem with the previous work.
2022-04-24 11:56:50 +02:00
71067316ee Ask apt to give us the deb filenames directly
Guessing filenames is boring. What if we could ask apt to tell us which
debs it downloaded (or found lying around elsewhere) directly? Turns out
we can rather easily avoiding a bunch of guesswork.
2022-04-24 11:56:48 +02:00
487237f9ae Factor out downloading packages with apt 2022-04-24 11:55:30 +02:00
8b58dc583e Replace EDSP with EIPP usage obsoleting proxysolver
EIPP stands for "External Installation Planner Protocol" and is rather
similar to EDSP but with the clear advantage that we can extract the
information we need more easily as we can tell apt to write the file for
us rather than playing solver-in-the-middle and the problem space is
much smaller meaning less data for apt to generate and to pass through
our hands.

The idea here is simply that every package which doesn't have a Status
field in EIPP has the uninstalled status and the only reason its is part
of the EIPP request is that we want to change this by installing it.
That could be verified via the Install header at the start of the
request, but this commit doesn't implement that.

Note that this means we need "more" than the download-only mode can
provide: Either a simulation or "the real deal". Except we modify the
later to be a fancy no op.
2022-04-24 09:29:17 +02:00

View file

@ -1413,7 +1413,6 @@ sub run_hooks {
# This is the file descriptor of the socket that the mmdebstrap # This is the file descriptor of the socket that the mmdebstrap
# --hook-helper can write to and read from to communicate with the outside. # --hook-helper can write to and read from to communicate with the outside.
push @env_opts, ("MMDEBSTRAP_HOOKSOCK=" . fileno($options->{hooksock})); push @env_opts, ("MMDEBSTRAP_HOOKSOCK=" . fileno($options->{hooksock}));
push @env_opts, ("MMDEBSTRAP_VERBOSITY=" . $verbosity_level);
my $runner = sub { my $runner = sub {
foreach my $script (@{ $options->{"${name}_hook"} }) { foreach my $script (@{ $options->{"${name}_hook"} }) {
@ -6638,25 +6637,7 @@ Performs cleanup tasks, unless B<--skip=cleanup> is used:
=item * Remove all files that were put into the chroot for setup purposes, like F</etc/apt/apt.conf.d/00mmdebstrap>, the temporary apt config and the qemu-user-static binary. This can be disabled using B<--skip=cleanup/mmdebstrap>. =item * Remove all files that were put into the chroot for setup purposes, like F</etc/apt/apt.conf.d/00mmdebstrap>, the temporary apt config and the qemu-user-static binary. This can be disabled using B<--skip=cleanup/mmdebstrap>.
=item * Remove files that make the result unreproducible and write "uninitialized" to /etc/machine-id if it exists. This can be disabled using B<--skip=cleanup/reproducible>. Note that this will not remove files that make the result unreproducible on machines with differing F</etc/resolv.conf> or F</etc/hostname>. Use a B<--customize-hook> to make those two files reproducible across multiple hosts. See section C<SOURCE_DATE_EPOCH> for more information. The following files will be removed: =item * Remove all files that make the result unreproducible, like apt and dpkg logs and caches or F</etc/machine-id> and F</var/lib/dbus/machine-id>. This can be disabled using B<--skip=cleanup/reproducible>
=over 4
=item * F</var/log/dpkg.log>
=item * F</var/log/apt/history.log>
=item * F</var/log/apt/term.log>
=item * F</var/log/alternatives.log>
=item * F</var/cache/ldconfig/aux-cache>
=item * F</var/log/apt/eipp.log.xz>
=item * F</var/lib/dbus/machine-id>
=back
=item * Remove everything in F</tmp> inside the chroot. This can be disabled using B<--skip=cleanup/tmp>. =item * Remove everything in F</tmp> inside the chroot. This can be disabled using B<--skip=cleanup/tmp>.
@ -6871,21 +6852,8 @@ As a docker/podman replacement:
=item C<SOURCE_DATE_EPOCH> =item C<SOURCE_DATE_EPOCH>
By setting C<SOURCE_DATE_EPOCH> the result will be reproducible across multiple By setting C<SOURCE_DATE_EPOCH> the result will be reproducible over multiple
runs with the same options and mirror content. Note that for debootstrap runs with the same options and mirror content.
compatibility, B<mmdebstrap> will copy the host's F</etc/resolv.conf> and
F</etc/hostname> into the chroot. This means that the B<mmdebstrap> output will
differ if it is run on machines with differing F</etc/resolv.conf> and
F</etc/hostname> contents. To make the result reproducible across different
hosts, you need to manually either delete both files from the output:
$ mmdebstrap --customize-hook='rm "$1"/etc/resolv.conf' \
--customize-hook='rm "$1"/etc/hostname' ...
or fill them with reproducible content:
$ mmdebstrap --customize-hook='echo nameserver X > "$1"/etc/resolv.conf' \
--customize-hook='echo host > "$1"/etc/hostname' ...
=item C<TMPDIR> =item C<TMPDIR>