dbadf6e9c2
during boot. Mountall ensures that these are done in the right order. It's informed by udev about devices becoming available. It emits some Upstart events upon reaching certain states, in particular ‘local-filesystems’ after all local filesystems have been mounted successfully, ‘remote-filesystems’ after all network filesystems have been mounted, and ‘filesystem’ (sic) when all filesystems have been mounted. Currently, if a filesystem fails to mount or doesn't exist, then the mingettys won't start and the boot will appear to hang. This is because mountall doesn't emit an event for failing filesystems and waits indefinitely for the filesystems to become available. * The ‘filesystems’ and ‘swap’ Upstart jobs are gone. (Support for encrypted swap devices is temporarily gone.) * Generate a proper /etc/fstab from the ‘fileSystems’ and ‘swapDevices’ options. svn path=/nixos/branches/boot-order/; revision=22148
77 lines
1.8 KiB
Nix
77 lines
1.8 KiB
Nix
{ config, pkgs, ... }:
|
||
|
||
with pkgs.lib;
|
||
|
||
{
|
||
|
||
###### interface
|
||
|
||
options = {
|
||
|
||
services.mingetty = {
|
||
|
||
ttys = mkOption {
|
||
default = [ "tty1" "tty2" "tty3" "tty4" "tty5" "tty6" ];
|
||
description = ''
|
||
The list of tty devices on which to start a login prompt.
|
||
'';
|
||
};
|
||
|
||
waitOnMounts = mkOption {
|
||
default = false;
|
||
description = ''
|
||
Whether the login prompts on the virtual consoles will be
|
||
started before or after all file systems have been mounted. By
|
||
default we don't wait, but if for example your /home is on a
|
||
separate partition, you may want to turn this on.
|
||
'';
|
||
};
|
||
|
||
greetingLine = mkOption {
|
||
default = ''<<< Welcome to NixOS (\m) - Kernel \r (\l) >>>'';
|
||
description = ''
|
||
Welcome line printed by mingetty.
|
||
'';
|
||
};
|
||
|
||
helpLine = mkOption {
|
||
default = "";
|
||
description = ''
|
||
Help line printed by mingetty below the welcome line.
|
||
Used by the installation CD to give some hints on
|
||
how to proceed.
|
||
'';
|
||
};
|
||
|
||
};
|
||
|
||
};
|
||
|
||
|
||
###### implementation
|
||
|
||
config = {
|
||
|
||
# Generate a separate job for each tty.
|
||
jobs = listToAttrs (map (tty: nameValuePair tty {
|
||
|
||
startOn = "started udev and local-filesystems";
|
||
|
||
exec = "${pkgs.mingetty}/sbin/mingetty --loginprog=${pkgs.shadow}/bin/login --noclear ${tty}";
|
||
|
||
}) config.services.mingetty.ttys);
|
||
|
||
environment.etc = singleton
|
||
{ # Friendly greeting on the virtual consoles.
|
||
source = pkgs.writeText "issue" ''
|
||
|
||
[1;32m${config.services.mingetty.greetingLine}[0m
|
||
${config.services.mingetty.helpLine}
|
||
|
||
'';
|
||
target = "issue";
|
||
};
|
||
};
|
||
|
||
}
|