Use a reproducible timestamp in mkconf; delete temporary file in initramfs. (Closes: #982607)
Fixes two issues when building the Debian live images: [1]
a) mkconf adds a timestamp to the generated configuration file, which is made
reproducible herein via $SOURCE_DATE_EPOCH, if needed.
b) The initramfs hook leaves a temporary file, which is hereby deleted.
Authorship was granted in Git. Thank you to Roland Clobus for the patch!
[1] https://wiki.debian.org/ReproducibleInstalls/LiveImages
Roland Clobus authored 2 years ago
Felix Lechner committed 2 years ago
92 | 92 |
tmpfile="${DESTMDADMCONF}.tmp"
|
93 | 93 |
if /usr/share/mdadm/mkconf > $tmpfile; then
|
94 | 94 |
cp -p $tmpfile $DESTMDADMCONF
|
|
95 |
rm -f $tmpfile
|
95 | 96 |
else
|
96 | 97 |
warn "failed to auto-generate temporary mdadm.conf file."
|
97 | 98 |
fi
|
94 | 94 |
fi
|
95 | 95 |
fi
|
96 | 96 |
|
97 | |
echo "# This configuration was auto-generated on $(date -R) by mkconf"
|
|
97 |
if [ -z $SOURCE_DATE_EPOCH ]; then
|
|
98 |
echo "# This configuration was auto-generated on $(date -R) by mkconf"
|
|
99 |
else
|
|
100 |
echo "# This configuration was auto-generated on $(date -R --utc -d@$SOURCE_DATE_EPOCH) by mkconf"
|
|
101 |
fi
|
98 | 102 |
|
99 | 103 |
exit $error
|