Merge pull request #55296 from grahamc/efi-image_eltorito-make-reproducible

efi-image_eltorito: make reproducible
This commit is contained in:
Graham Christensen 2019-02-06 07:10:31 -05:00 committed by GitHub
commit 38543e9174
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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"
''; # */