Adding a parameter 'ttyEmergency'

It specifies what mingetty will be stopped, if a bad filesystem
triggers an emergency shell.

That should be ttyS0 on headless systems, and in that case,
nixos should stop the ttyS0 mingetty from getting in.
This commit is contained in:
Lluis Batlle 2012-09-24 00:14:43 +02:00
parent 97c74bf050
commit 5ee79c5722

View File

@ -156,6 +156,16 @@ in
description = "Names of supported filesystem types in the initial ramdisk.";
};
boot.ttyEmergency = mkOption {
default =
if pkgs.stdenv.isArm
then "ttyS0" # presumably an embedded platform such as a plug
else "tty1";
description = ''
The tty that will be stopped in case an emergency shell is spawned
at boot.
'';
};
};
@ -247,7 +257,7 @@ in
status="$(status xserver || true)"
[[ "$status" =~ start/ ]] && exit 0
stop tty1 || true
stop ${config.boot.ttyEmergency} || true
start --no-wait emergency-shell \
DEVICE="$DEVICE" MOUNTPOINT="$MOUNTPOINT"