2009-01-02 19:07:30 +03:00
|
|
|
{pkgs, config, ...}:
|
|
|
|
|
|
|
|
let
|
2009-05-28 03:14:38 +04:00
|
|
|
|
|
|
|
options = {
|
|
|
|
|
2010-04-17 19:20:13 +04:00
|
|
|
boot = {
|
|
|
|
postBootCommands = pkgs.lib.mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "rm -f /var/log/messages";
|
|
|
|
merge = pkgs.lib.mergeStringOption;
|
|
|
|
description = ''
|
|
|
|
Shell commands to be executed just before Upstart is started.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
devSize = pkgs.lib.mkOption {
|
|
|
|
default = "50%";
|
|
|
|
example = "32m";
|
|
|
|
description = ''
|
|
|
|
Size limit for the /dev tmpfs. Look at mount(8), tmpfs size option,
|
|
|
|
for the accepted syntax.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
devShmSize = pkgs.lib.mkOption {
|
|
|
|
default = "50%";
|
|
|
|
example = "256m";
|
|
|
|
description = ''
|
|
|
|
Size limit for the /dev/shm tmpfs. Look at mount(8), tmpfs size option,
|
|
|
|
for the accepted syntax.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2009-05-28 03:14:38 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2009-11-06 12:36:35 +03:00
|
|
|
inherit (pkgs) substituteAll writeText coreutils utillinux udev;
|
2009-01-02 19:07:30 +03:00
|
|
|
kernel = config.boot.kernelPackages.kernel;
|
|
|
|
activateConfiguration = config.system.activationScripts.script;
|
|
|
|
|
|
|
|
bootStage2 = substituteAll {
|
2009-05-25 18:19:33 +04:00
|
|
|
src = ./stage-2-init.sh;
|
2009-01-02 19:07:30 +03:00
|
|
|
isExecutable = true;
|
2009-11-06 13:43:38 +03:00
|
|
|
inherit kernel activateConfiguration;
|
2010-04-17 19:20:13 +04:00
|
|
|
inherit (config.boot) devSize devShmSize;
|
2010-01-09 17:23:20 +03:00
|
|
|
ttyGid = config.ids.gids.tty;
|
2009-11-06 13:43:38 +03:00
|
|
|
upstart = config.system.build.upstart;
|
2009-06-05 20:02:58 +04:00
|
|
|
path =
|
|
|
|
[ coreutils
|
|
|
|
utillinux
|
|
|
|
udev
|
|
|
|
];
|
2009-11-15 15:56:40 +03:00
|
|
|
postBootCommands = writeText "local-cmds"
|
|
|
|
''
|
|
|
|
${config.boot.postBootCommands}
|
|
|
|
${config.powerManagement.powerUpCommands}
|
|
|
|
'';
|
2009-01-02 19:07:30 +03:00
|
|
|
};
|
2009-06-05 20:02:58 +04:00
|
|
|
|
2009-01-02 19:07:30 +03:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2009-05-28 03:14:38 +04:00
|
|
|
require = [options];
|
2009-01-02 19:07:30 +03:00
|
|
|
|
2009-06-05 17:24:23 +04:00
|
|
|
system.build.bootStage2 = bootStage2;
|
2006-11-04 03:01:13 +03:00
|
|
|
}
|