diff --git a/modules/kexecboot.nix b/modules/kexecboot.nix index c78b7c9..4538afd 100644 --- a/modules/kexecboot.nix +++ b/modules/kexecboot.nix @@ -26,7 +26,6 @@ in { outputs.boot-sh = let - inherit (pkgs) kexec-tools; inherit (pkgs.lib.trivial) toHexString; inherit (config.outputs) squashfs kernel; cmdline = concatStringsSep " " config.boot.commandLine; diff --git a/overlay.nix b/overlay.nix index 0317039..fc60fc7 100644 --- a/overlay.nix +++ b/overlay.nix @@ -17,6 +17,13 @@ extraPkgs // { strace = prev.strace.override { libunwind = null; }; kexec-tools = prev.kexec-tools.overrideAttrs(o: { + # For kexecboot we copy kexec into a ramdisk on the system being + # upgraded from. This is more likely to work if kexec is + # statically linked so doesn't have dependencies on store paths that + # may not exist on that machine. (We can't nix-copy-closure as + # the store may not be on a writable filesystem) + LDFLAGS = "-static"; + patches = o.patches ++ [ (fetchpatch { # merge user command line options into DTB chosen