From ddc5d34f6126c7029d6aa876eac29e2aed0ee0e4 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Thu, 19 Jan 2023 23:42:22 -0600 Subject: [PATCH] nixos/tests/systemd-boot: only patch systemd-boot during update test The update test patches the systemd-boot binary to report a known version then tests that this is the version updated from. The previous patch would also search the kernel and initrd binaries, which would cause sed to write out a temporary file that might cause the disk to run out of space and the test to fail. Only attempt to patch binaries which contain systemd-boot (usually `BOOT.EFI` and `systemd-boot.efi` to avoid this problem. As a bonus, this reduces test time by 20-30%. --- nixos/tests/systemd-boot.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/systemd-boot.nix b/nixos/tests/systemd-boot.nix index 759ddd2eb2ca..94e269ff37bb 100644 --- a/nixos/tests/systemd-boot.nix +++ b/nixos/tests/systemd-boot.nix @@ -101,7 +101,7 @@ in # Replace version inside sd-boot with something older. See magic[] string in systemd src/boot/efi/boot.c machine.succeed( """ - find /boot -iname '*.efi' -print0 | \ + find /boot -iname '*boot*.efi' -print0 | \ xargs -0 -I '{}' sed -i 's/#### LoaderInfo: systemd-boot .* ####/#### LoaderInfo: systemd-boot 000.0-1-notnixos ####/' '{}' """ )