From 5ee79c57228cda29883dd61fd75dc4e5c05ea7b6 Mon Sep 17 00:00:00 2001 From: Lluis Batlle Date: Mon, 24 Sep 2012 00:14:43 +0200 Subject: [PATCH] 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. --- modules/tasks/filesystems.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/tasks/filesystems.nix b/modules/tasks/filesystems.nix index 9495cac67855..5d6e4a4a3697 100644 --- a/modules/tasks/filesystems.nix +++ b/modules/tasks/filesystems.nix @@ -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"