add --skip=cleanup/reproducible/machine-id

This commit is contained in:
Johannes Schauer Marin Rodrigues 2024-09-13 01:17:52 +02:00
parent 87b9b385b3
commit 6e4ed4a049
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -4190,6 +4190,10 @@ sub run_cleanup() {
# this file if possible. Having an empty file in place is useful # this file if possible. Having an empty file in place is useful
# because it allows a temporary file to be bind-mounted over the # because it allows a temporary file to be bind-mounted over the
# real file, in case the image is used read-only. # real file, in case the image is used read-only.
if (any { $_ eq 'cleanup/reproducible/machine-id' }
@{ $options->{skip} }) {
info "skipping cleanup/reproducible/machine-id as requested";
} else {
unlink "$options->{root}/etc/machine-id" unlink "$options->{root}/etc/machine-id"
or error "cannot unlink /etc/machine-id: $!"; or error "cannot unlink /etc/machine-id: $!";
open my $fh, '>', "$options->{root}/etc/machine-id" open my $fh, '>', "$options->{root}/etc/machine-id"
@ -4197,6 +4201,7 @@ sub run_cleanup() {
close $fh; close $fh;
} }
} }
}
if (any { $_ eq 'cleanup/run' } @{ $options->{skip} }) { if (any { $_ eq 'cleanup/run' } @{ $options->{skip} }) {
info "skipping cleanup/run as requested"; info "skipping cleanup/run as requested";