diff options
author | Roland Clobus <rclobus@rclobus.nl> | 2021-01-02 17:41:50 +0100 |
---|---|---|
committer | Luca Boccassi <bluca@debian.org> | 2021-01-15 09:22:29 +0000 |
commit | 91e1e65c873291d11495730d8ce6df5940706c2b (patch) | |
tree | 98a1571299f411b85e92cee9e76ad4e5e203d822 /scripts/build | |
parent | 5636820be5ee2d247cba30876fc67ae27f295ed8 (diff) | |
download | vyos-live-build-91e1e65c873291d11495730d8ce6df5940706c2b.tar.gz vyos-live-build-91e1e65c873291d11495730d8ce6df5940706c2b.zip |
Apply SOURCE_DATE_EPOCH to newly generated files and create a log
Diffstat (limited to 'scripts/build')
-rwxr-xr-x | scripts/build/binary | 3 | ||||
-rwxr-xr-x | scripts/build/binary_iso | 2 | ||||
-rwxr-xr-x | scripts/build/clean | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/scripts/build/binary b/scripts/build/binary index aa1d06ab2..971e28b95 100755 --- a/scripts/build/binary +++ b/scripts/build/binary @@ -68,6 +68,9 @@ if [ "${LB_BUILD_WITH_CHROOT}" != "true" ]; then lb chroot_prep install "${CHROOT_PREP_MOUNTS}" "${@}" fi +# Apply SOURCE_DATE_EPOCH to all modified and created files +find binary -newermt "$(date -d@${SOURCE_DATE_EPOCH} '+%Y-%m-%d %H:%M:%S')" -printf "%y %p\n" -exec touch '{}' -d@${SOURCE_DATE_EPOCH} --no-dereference ';' > binary.modified_timestamps + # Building images lb binary_iso "${@}" lb binary_onie "${@}" diff --git a/scripts/build/binary_iso b/scripts/build/binary_iso index 990af86a0..5008d382a 100755 --- a/scripts/build/binary_iso +++ b/scripts/build/binary_iso @@ -176,6 +176,8 @@ mkdir -p binary/.disk cat <<-EOF >binary/.disk/mkisofs xorriso -as mkisofs ${XORRISO_OPTIONS} -o ${IMAGE} binary EOF +# Set the timestamp +find binary/.disk -newermt "$(date -d@${SOURCE_DATE_EPOCH} '+%Y-%m-%d %H:%M:%S')" -printf "%y %p\n" -exec touch '{}' -d@${SOURCE_DATE_EPOCH} ';' >> binary.modified_timestamps case "${LB_BUILD_WITH_CHROOT}" in true) diff --git a/scripts/build/clean b/scripts/build/clean index b28cdcd2d..6549fc635 100755 --- a/scripts/build/clean +++ b/scripts/build/clean @@ -180,6 +180,7 @@ if [ "${RM_BINARY}" = "true" ]; then rm -f ${LB_IMAGE_NAME}*.iso-ONIE.bin rm -f MD5SUMS SHA1SUMS SHA256SUMS SHA512SUMS rm -f md5sum.txt sha1sum.txt sha256sum.txt sha512sum.txt + rm -f binary.modified_timestamps rm -rf binary rm -rf tftpboot |