Improve documentation of reproducibility of /etc/resolv.conf and /etc/hostname

Closes: #26
This commit is contained in:
Johannes Schauer Marin Rodrigues 2022-05-11 10:47:25 +02:00
parent 57e0ecb20f
commit 09f1dd2ee6
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -6763,7 +6763,25 @@ 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 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>
=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:
=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>.
@ -6978,8 +6996,21 @@ As a docker/podman replacement:
=item C<SOURCE_DATE_EPOCH>
By setting C<SOURCE_DATE_EPOCH> the result will be reproducible over multiple
runs with the same options and mirror content.
By setting C<SOURCE_DATE_EPOCH> the result will be reproducible across multiple
runs with the same options and mirror content. Note that for debootstrap
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>