From ff53d0a373b6ffa8eea6458b7df33496708ad40a Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Sun, 5 Jul 2026 15:28:30 -0400 Subject: [PATCH] initrd/bin/kexec-save-default.sh: skip symlinks when finding crypttab files - NixOS initrds contain /etc/crypttab as a symlink to a Nix store path (e.g. /nix/store/-initrd-crypttab). When unpacked into /tmp/initrd_extract, the symlink target is an absolute path that does not exist on the Heads recovery system, making cat fail. - find without -type f matched the dangling symlink, causing cat to error out inside a pipefail pipeline, which killed the crypttab parsing loop and caused kexec-save-default.sh to fail. - Add -type f to only match regular files, skipping symlinks. Signed-off-by: Thierry Laurion --- initrd/bin/kexec-save-default.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initrd/bin/kexec-save-default.sh b/initrd/bin/kexec-save-default.sh index 87e8fbceb..f60b28c12 100755 --- a/initrd/bin/kexec-save-default.sh +++ b/initrd/bin/kexec-save-default.sh @@ -326,7 +326,7 @@ if [ "$save_key" = "y" ]; then DEBUG "Extracting $current_default_initrd to find crypttab files" unpack_initramfs.sh "$current_default_initrd" "$initrd_decompressed" - crypttab_files=$(find "$initrd_decompressed" | grep crypttab 2>/dev/null) || true + crypttab_files=$(find "$initrd_decompressed" -type f | grep crypttab 2>/dev/null) || true if [ ! -z "$crypttab_files" ]; then DEBUG "Found crypttab files in $current_default_initrd"