Merge pull request #158967 from mschwaig/sd-image-determinism
sd-image: make firmware partition reproducible, sd-image, dvd-image: get rid of faketime related warnings
This commit is contained in:
commit
5784f69a46
2 changed files with 14 additions and 3 deletions
|
@ -421,7 +421,7 @@ let
|
||||||
echo "Usage size: $usage_size"
|
echo "Usage size: $usage_size"
|
||||||
echo "Image size: $image_size"
|
echo "Image size: $image_size"
|
||||||
truncate --size=$image_size "$out"
|
truncate --size=$image_size "$out"
|
||||||
faketime "2000-01-01 00:00:00" mkfs.vfat -i 12345678 -n EFIBOOT "$out"
|
mkfs.vfat --invariant -i 12345678 -n EFIBOOT "$out"
|
||||||
|
|
||||||
# Force a fixed order in mcopy for better determinism, and avoid file globbing
|
# Force a fixed order in mcopy for better determinism, and avoid file globbing
|
||||||
for d in $(find EFI -type d | sort); do
|
for d in $(find EFI -type d | sort); do
|
||||||
|
|
|
@ -224,14 +224,25 @@ in
|
||||||
# Create a FAT32 /boot/firmware partition of suitable size into firmware_part.img
|
# Create a FAT32 /boot/firmware partition of suitable size into firmware_part.img
|
||||||
eval $(partx $img -o START,SECTORS --nr 1 --pairs)
|
eval $(partx $img -o START,SECTORS --nr 1 --pairs)
|
||||||
truncate -s $((SECTORS * 512)) firmware_part.img
|
truncate -s $((SECTORS * 512)) firmware_part.img
|
||||||
faketime "1970-01-01 00:00:00" mkfs.vfat -i ${config.sdImage.firmwarePartitionID} -n ${config.sdImage.firmwarePartitionName} firmware_part.img
|
|
||||||
|
mkfs.vfat --invariant -i ${config.sdImage.firmwarePartitionID} -n ${config.sdImage.firmwarePartitionName} firmware_part.img
|
||||||
|
|
||||||
# Populate the files intended for /boot/firmware
|
# Populate the files intended for /boot/firmware
|
||||||
mkdir firmware
|
mkdir firmware
|
||||||
${config.sdImage.populateFirmwareCommands}
|
${config.sdImage.populateFirmwareCommands}
|
||||||
|
|
||||||
|
find firmware -exec touch --date=2000-01-01 {} +
|
||||||
# Copy the populated /boot/firmware into the SD image
|
# Copy the populated /boot/firmware into the SD image
|
||||||
(cd firmware; mcopy -psvm -i ../firmware_part.img ./* ::)
|
cd firmware
|
||||||
|
# Force a fixed order in mcopy for better determinism, and avoid file globbing
|
||||||
|
for d in $(find . -type d -mindepth 1 | sort); do
|
||||||
|
faketime "2000-01-01 00:00:00" mmd -i ../firmware_part.img "::/$d"
|
||||||
|
done
|
||||||
|
for f in $(find . -type f | sort); do
|
||||||
|
mcopy -pvm -i ../firmware_part.img "$f" "::/$f"
|
||||||
|
done
|
||||||
|
cd ..
|
||||||
|
|
||||||
# Verify the FAT partition before copying it.
|
# Verify the FAT partition before copying it.
|
||||||
fsck.vfat -vn firmware_part.img
|
fsck.vfat -vn firmware_part.img
|
||||||
dd conv=notrunc if=firmware_part.img of=$img seek=$START count=$SECTORS
|
dd conv=notrunc if=firmware_part.img of=$img seek=$START count=$SECTORS
|
||||||
|
|
Loading…
Reference in a new issue