summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
authorRoland Clobus <rclobus@rclobus.nl>2021-01-02 17:40:55 +0100
committerLuca Boccassi <bluca@debian.org>2021-01-15 09:22:29 +0000
commit15fab34ea2e154cee5e6d53da7f5c80b300ca77f (patch)
tree9938b90954f55a89d94e31ff0ea33eafe688334b /scripts/build
parent2b0559fd110fa5a1a3e997b064d15f8e67d8fe60 (diff)
downloadvyos-live-build-15fab34ea2e154cee5e6d53da7f5c80b300ca77f.tar.gz
vyos-live-build-15fab34ea2e154cee5e6d53da7f5c80b300ca77f.zip
Set timestamp embedded in EFI files
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build/binary_grub-efi2
-rwxr-xr-xscripts/build/efi-image4
2 files changed, 6 insertions, 0 deletions
diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi
index 4510622d1..714a7dd50 100755
--- a/scripts/build/binary_grub-efi
+++ b/scripts/build/binary_grub-efi
@@ -234,6 +234,8 @@ search --set=root --file /.disk/info
set prefix=(\\\$root)/boot/grub
configfile (\\\$root)/boot/grub/grub.cfg
EOF
+# Set the timestamp within the efi.img file
+touch ${_CHROOT_DIR}/grub-efi-temp-cfg/grub.cfg -d@${SOURCE_DATE_EPOCH}
# The code below is adapted from tools/boot/jessie/boot-x86
# in debian-cd
diff --git a/scripts/build/efi-image b/scripts/build/efi-image
index 381ea24fb..8831bfa81 100755
--- a/scripts/build/efi-image
+++ b/scripts/build/efi-image
@@ -53,6 +53,8 @@ search --file --set=root /.disk/info
set prefix=(\$root)/boot/grub
source \$prefix/$platform/grub.cfg
EOF
+# Set the timestamps
+find $workdir -newermt "$(date -d@${SOURCE_DATE_EPOCH} '+%Y-%m-%d %H:%M:%S')" -exec touch '{}' -d@${SOURCE_DATE_EPOCH} ';'
mkdir -p "$outdir/boot/grub/$platform"
(for i in /usr/lib/grub/$platform/part_*.mod; do
@@ -78,6 +80,8 @@ mkfs.msdos -C "$outdir/efi.img" \
/ 32 * 32 )) -i ${SOURCE_DATE_EPOCH}
mmd -i "$outdir/efi.img" ::efi
mmd -i "$outdir/efi.img" ::efi/boot
+# Set the timestamp of the .efi file
+touch "$workdir/boot$efi_name.efi" -d@${SOURCE_DATE_EPOCH}
mcopy -m -i "$outdir/efi.img" "$workdir/boot$efi_name.efi" \
"::efi/boot/boot$efi_name.efi"