efi-image_eltorito: make reproducible

'./*' produces arguments ordered by inode.

efiDir produces, reliably, ./EFI, so just make all the directories
known explicitly.
This commit is contained in:
Graham Christensen 2019-02-05 21:33:37 -05:00
parent 81531046e8
commit 013c7fa4ba
No known key found for this signature in database
GPG Key ID: ACA1C1D120C83D5C
1 changed files with 3 additions and 3 deletions

View File

@ -339,11 +339,11 @@ let
# dates (cp -p, touch, mcopy -m, faketime for label), IDs (mkfs.vfat -i)
''
mkdir ./contents && cd ./contents
cp -rp "${efiDir}"/* .
cp -rp "${efiDir}"/EFI .
mkdir ./boot
cp -p "${config.boot.kernelPackages.kernel}/${config.system.boot.loader.kernelFile}" \
"${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}" ./boot/
touch --date=@0 ./*
touch --date=@0 ./EFI ./boot
usage_size=$(du -sb --apparent-size . | tr -cd '[:digit:]')
# Make the image 110% as big as the files need to make up for FAT overhead
@ -355,7 +355,7 @@ let
echo "Image size: $image_size"
truncate --size=$image_size "$out"
${pkgs.libfaketime}/bin/faketime "2000-01-01 00:00:00" ${pkgs.dosfstools}/sbin/mkfs.vfat -i 12345678 -n EFIBOOT "$out"
mcopy -psvm -i "$out" ./* ::
mcopy -psvm -i "$out" ./EFI ./boot ::
# Verify the FAT partition.
${pkgs.dosfstools}/sbin/fsck.vfat -vn "$out"
''; # */