From 09f1dd2ee62d5f45dc9a5ade350ba2dfc6c72b3a Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Wed, 11 May 2022 10:47:25 +0200 Subject: [PATCH] Improve documentation of reproducibility of /etc/resolv.conf and /etc/hostname Closes: #26 --- mmdebstrap | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/mmdebstrap b/mmdebstrap index f5430ed..5c12763 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -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, 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 and F. 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 or F. Use a B<--customize-hook> to make those two files reproducible across multiple hosts. See section C for more information. The following files will be removed: + +=over 4 + +=item * F + +=item * F + +=item * F + +=item * F + +=item * F + +=item * F + +=item * F + +=back =item * Remove everything in F inside the chroot. This can be disabled using B<--skip=cleanup/tmp>. @@ -6978,8 +6996,21 @@ As a docker/podman replacement: =item C -By setting C the result will be reproducible over multiple -runs with the same options and mirror content. +By setting C the result will be reproducible across multiple +runs with the same options and mirror content. Note that for debootstrap +compatibility, B will copy the host's F and +F into the chroot. This means that the B output will +differ if it is run on machines with differing F and +F 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