Set timestamp embedded in EFI files

This commit is contained in:
Roland Clobus 2021-01-02 17:40:55 +01:00 committed by Luca Boccassi
parent 2b0559fd11
commit 15fab34ea2
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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"