mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/kexec: don't clobber existing kexec-loaded kernel
This commit is contained in:
parent
2024421f04
commit
4d667685c2
1 changed files with 3 additions and 0 deletions
|
@ -13,6 +13,9 @@
|
|||
path = [ pkgs.kexectools ];
|
||||
script =
|
||||
''
|
||||
# Don't load the current system profile if we already have a kernel loaded
|
||||
[[ 1 = "$(</sys/kernel/kexec_loaded)" ]] && exit
|
||||
|
||||
p=$(readlink -f /nix/var/nix/profiles/system)
|
||||
if ! [ -d $p ]; then exit 1; fi
|
||||
exec kexec --load $p/kernel --initrd=$p/initrd --append="$(cat $p/kernel-params) init=$p/init"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue