From 915d558cd55f19a4615fa5f20a2ff28a4511243c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 27 Nov 2022 17:32:39 +0100 Subject: [PATCH] kexec-installer: avoid copying initrd instead we append the extra data. --- nix/kexec-installer/module.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nix/kexec-installer/module.nix b/nix/kexec-installer/module.nix index ba73d1a..3f737b6 100644 --- a/nix/kexec-installer/module.nix +++ b/nix/kexec-installer/module.nix @@ -48,15 +48,13 @@ in { find | cpio -o -H newc | gzip -9 > ../extra.gz popd - cat "''${SCRIPT_DIR}/initrd" extra.gz > final-initrd + cat extra.gz >> "''${SCRIPT_DIR}/initrd" + rm -r "$INITRD_TMP" "$SCRIPT_DIR/kexec" --load "''${SCRIPT_DIR}/bzImage" \ - --initrd=final-initrd \ + --initrd="''${SCRIPT_DIR}/initrd" \ --command-line "init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" - # kexec will map the new kernel in memory so we can remove the kernel at this point - rm -r "$INITRD_TMP" - # Disconnect our background kexec from the terminal echo "machine will boot into nixos in in 6s..." if [[ -e /dev/kmsg ]]; then