From 6e4ed4a04995dca7cafc3d4816ebbf8559d889da Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Fri, 13 Sep 2024 01:17:52 +0200 Subject: [PATCH] add --skip=cleanup/reproducible/machine-id --- mmdebstrap | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mmdebstrap b/mmdebstrap index 82f5fc9..efbc28a 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -4190,11 +4190,16 @@ sub run_cleanup() { # this file if possible. Having an empty file in place is useful # because it allows a temporary file to be bind-mounted over the # real file, in case the image is used read-only. - unlink "$options->{root}/etc/machine-id" - or error "cannot unlink /etc/machine-id: $!"; - open my $fh, '>', "$options->{root}/etc/machine-id" - or error "failed to open(): $!"; - close $fh; + if (any { $_ eq 'cleanup/reproducible/machine-id' } + @{ $options->{skip} }) { + info "skipping cleanup/reproducible/machine-id as requested"; + } else { + unlink "$options->{root}/etc/machine-id" + or error "cannot unlink /etc/machine-id: $!"; + open my $fh, '>', "$options->{root}/etc/machine-id" + or error "failed to open(): $!"; + close $fh; + } } }