nixos stage-1: add custom pre failure dialog commands
This commit is contained in:
parent
36459f1977
commit
86ad25625f
@ -14,6 +14,8 @@ export LVM_SUPPRESS_FD_WARNINGS=true
|
|||||||
fail() {
|
fail() {
|
||||||
if [ -n "$panicOnFail" ]; then exit 1; fi
|
if [ -n "$panicOnFail" ]; then exit 1; fi
|
||||||
|
|
||||||
|
@preFailCommands@
|
||||||
|
|
||||||
# If starting stage 2 failed, allow the user to repair the problem
|
# If starting stage 2 failed, allow the user to repair the problem
|
||||||
# in an interactive shell.
|
# in an interactive shell.
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
@ -208,7 +208,7 @@ let
|
|||||||
inherit (config.boot) resumeDevice devSize runSize;
|
inherit (config.boot) resumeDevice devSize runSize;
|
||||||
|
|
||||||
inherit (config.boot.initrd) checkJournalingFS
|
inherit (config.boot.initrd) checkJournalingFS
|
||||||
preLVMCommands preDeviceCommands postDeviceCommands postMountCommands kernelModules;
|
preLVMCommands preDeviceCommands postDeviceCommands postMountCommands preFailCommands kernelModules;
|
||||||
|
|
||||||
resumeDevices = map (sd: if sd ? device then sd.device else "/dev/disk/by-label/${sd.label}")
|
resumeDevices = map (sd: if sd ? device then sd.device else "/dev/disk/by-label/${sd.label}")
|
||||||
(filter (sd: (sd ? label || hasPrefix "/dev/" sd.device) && !sd.randomEncryption) config.swapDevices);
|
(filter (sd: (sd ? label || hasPrefix "/dev/" sd.device) && !sd.randomEncryption) config.swapDevices);
|
||||||
@ -336,6 +336,14 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot.initrd.preFailCommands = mkOption {
|
||||||
|
default = "";
|
||||||
|
type = types.lines;
|
||||||
|
description = ''
|
||||||
|
Shell commands to be executed before the failure prompt is shown.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
boot.initrd.extraUtilsCommands = mkOption {
|
boot.initrd.extraUtilsCommands = mkOption {
|
||||||
internal = true;
|
internal = true;
|
||||||
default = "";
|
default = "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user