Apply predictable timestamps in the source image

This commit is contained in:
Roland Clobus 2023-08-06 15:22:07 +02:00 committed by Luca Boccassi
parent ff950cbeee
commit d6e7b80ea0
2 changed files with 6 additions and 0 deletions

View File

@ -44,6 +44,9 @@ lb source_disk "${@}"
lb source_hooks "${@}"
lb source_checksums "${@}"
# Apply SOURCE_DATE_EPOCH to all modified and created files
find source -newermt "$(date -d@${SOURCE_DATE_EPOCH} '+%Y-%m-%d %H:%M:%S')" -printf "%y %p\n" -exec touch '{}' -d@${SOURCE_DATE_EPOCH} --no-dereference ';' > source.modified_timestamps
# Building images
lb source_iso "${@}"
lb source_tar "${@}"

View File

@ -49,6 +49,9 @@ rm -f ${LB_IMAGE_NAME}-source.live.tar.bz2 ${LB_IMAGE_NAME}-source.live.tar.gz $
tar cf ${LB_IMAGE_NAME}-source.debian.tar source/debian
tar cf ${LB_IMAGE_NAME}-source.live.tar source/live
touch ${LB_IMAGE_NAME}-source.debian.tar -d@${SOURCE_DATE_EPOCH}
touch ${LB_IMAGE_NAME}-source.live.tar -d@${SOURCE_DATE_EPOCH}
case "${LB_COMPRESSION}" in
bzip2)
bzip2 ${BZIP2_OPTIONS} ${LB_IMAGE_NAME}-source.debian.tar