From a1d6fd3702f78d73f7d47729f7fe28820f6b30ed Mon Sep 17 00:00:00 2001 From: Martin Schwaighofer Date: Sun, 5 Dec 2021 18:23:58 +0100 Subject: [PATCH] sd-image: replace faketime with --invariant for mkfs.vfat This is done for sd-images only here, but should probably also be done for dvd-images. The --invariant arg should be a better way of making mkfs.vfat deterministic. The previous version of invoking faketime was building fine and reproducible when I was compiling an sdimage for aarch64 under emulation. It was however still logging errors: ERROR: ld.so: object '/nix/store/1c2cp2709kmvby8ql2n9946v7l52nn50-libfaketime-0.9.9/lib/libfaketime.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. ERROR: ld.so: object '/nix/store/1c2cp2709kmvby8ql2n9946v7l52nn50-libfaketime-0.9.9/lib/libfaketime.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. The logged errors were presumably inaccurate somehow as calling faketime was required for reproducibility, even though the log makes it looks like it failed. --- nixos/modules/installer/sd-card/sd-image.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/installer/sd-card/sd-image.nix b/nixos/modules/installer/sd-card/sd-image.nix index 2921491c9c96..c6b5e43ee1f0 100644 --- a/nixos/modules/installer/sd-card/sd-image.nix +++ b/nixos/modules/installer/sd-card/sd-image.nix @@ -225,7 +225,7 @@ in eval $(partx $img -o START,SECTORS --nr 1 --pairs) truncate -s $((SECTORS * 512)) firmware_part.img - faketime "2000-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 mkdir firmware