nixos/kexec: log what's happening
This commit is contained in:
parent
4d667685c2
commit
6b6f25e926
@ -14,10 +14,17 @@
|
|||||||
script =
|
script =
|
||||||
''
|
''
|
||||||
# Don't load the current system profile if we already have a kernel loaded
|
# Don't load the current system profile if we already have a kernel loaded
|
||||||
[[ 1 = "$(</sys/kernel/kexec_loaded)" ]] && exit
|
if [[ 1 = "$(</sys/kernel/kexec_loaded)" ]] ; then
|
||||||
|
echo "kexec kernel has already been loaded, prepare-kexec skipped"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
p=$(readlink -f /nix/var/nix/profiles/system)
|
p=$(readlink -f /nix/var/nix/profiles/system)
|
||||||
if ! [ -d $p ]; then exit 1; fi
|
if ! [[ -d $p ]]; then
|
||||||
|
echo "Could not find system profile for prepare-kexec"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Loading NixOS system via kexec."
|
||||||
exec kexec --load $p/kernel --initrd=$p/initrd --append="$(cat $p/kernel-params) init=$p/init"
|
exec kexec --load $p/kernel --initrd=$p/initrd --append="$(cat $p/kernel-params) init=$p/init"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user