forked from mirrors/nixpkgs
nixos stage-1: try to quit plymouth if started on failure
This commit is contained in:
parent
a2d4235fe1
commit
c69c76ca7e
|
@ -36,7 +36,7 @@ let
|
||||||
${optionalString (header != null) "--header=${header}"} \
|
${optionalString (header != null) "--header=${header}"} \
|
||||||
${optionalString (keyFile != null) "--key-file=${keyFile} ${optionalString (keyFileSize != null) "--keyfile-size=${toString keyFileSize}"}"} \
|
${optionalString (keyFile != null) "--key-file=${keyFile} ${optionalString (keyFileSize != null) "--keyfile-size=${toString keyFileSize}"}"} \
|
||||||
> /.luksopen_args
|
> /.luksopen_args
|
||||||
cryptsetup-askpass
|
get_password "Enter LUKS Passphrase" cryptsetup-askpass
|
||||||
rm /.luksopen_args
|
rm /.luksopen_args
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,9 +78,7 @@ let
|
||||||
for try in $(seq 3); do
|
for try in $(seq 3); do
|
||||||
|
|
||||||
${optionalString yubikey.twoFactor ''
|
${optionalString yubikey.twoFactor ''
|
||||||
echo -n "Enter two-factor passphrase: "
|
k_user="$(get_password "Enter two-factor passphrase" cat)"
|
||||||
read -s k_user
|
|
||||||
echo
|
|
||||||
''}
|
''}
|
||||||
|
|
||||||
if [ ! -z "$k_user" ]; then
|
if [ ! -z "$k_user" ]; then
|
||||||
|
@ -463,6 +461,26 @@ in
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
boot.initrd.preDeviceCommands = ''
|
||||||
|
get_password() {
|
||||||
|
local ret
|
||||||
|
local reply
|
||||||
|
local tty_stat
|
||||||
|
|
||||||
|
tty_stat="$(stty -g)"
|
||||||
|
stty -echo
|
||||||
|
for i in `seq 1 3`; do
|
||||||
|
echo -n "$1: "
|
||||||
|
read reply
|
||||||
|
echo "$reply" | "$2"
|
||||||
|
if [ "$?" = "0" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
stty "$tty_stat"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
boot.initrd.preLVMCommands = concatStrings (mapAttrsToList openCommand preLVM);
|
boot.initrd.preLVMCommands = concatStrings (mapAttrsToList openCommand preLVM);
|
||||||
boot.initrd.postDeviceCommands = concatStrings (mapAttrsToList openCommand postLVM);
|
boot.initrd.postDeviceCommands = concatStrings (mapAttrsToList openCommand postLVM);
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,9 @@ export LVM_SUPPRESS_FD_WARNINGS=true
|
||||||
fail() {
|
fail() {
|
||||||
if [ -n "$panicOnFail" ]; then exit 1; fi
|
if [ -n "$panicOnFail" ]; then exit 1; fi
|
||||||
|
|
||||||
|
# If we have a splash screen started, quit it.
|
||||||
|
command -v plymouth >/dev/null 2>&1 && plymouth quit
|
||||||
|
|
||||||
# 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
|
||||||
|
|
Loading…
Reference in a new issue