* Use Upstart instead of sysvinit.

svn path=/nixu/trunk/; revision=7074
This commit is contained in:
Eelco Dolstra 2006-11-19 18:16:29 +00:00
parent 29d9b88aa9
commit d191615e96
3 changed files with 21 additions and 10 deletions

View file

@ -82,7 +82,7 @@ rec {
bootStage2 = import ./boot-stage-2.nix {
inherit (pkgs) genericSubstituter coreutils findutils
utillinux kernel sysklogd udev module_init_tools
nettools;
nettools upstart;
shell = pkgs.bash + "/bin/sh";
dhcp = pkgs.dhcpWrapper;
@ -108,7 +108,7 @@ rec {
pkgs.shadowutils
pkgs.strace
pkgs.sysklogd
pkgs.sysvinit
# pkgs.sysvinit
# pkgs.vim
nix
nixosInstaller

View file

@ -50,6 +50,8 @@ mkdir -m 0755 -p /nix/var/nix/db
mkdir -m 0755 -p /nix/var/nix/gcroots
mkdir -m 0755 -p /nix/var/nix/temproots
mkdir -m 0755 -p /var/log
# Ensure that the module tools can find the kernel modules.
export MODULE_DIR=@kernel@/lib/modules/
@ -109,10 +111,18 @@ if ! test -e /etc/group; then
fi
# Set up inittab.
echo -n > /etc/inittab
# Set up the Upstart jobs.
export UPSTART_CFG_DIR=/etc/event.d
mkdir -p $UPSTART_CFG_DIR
cp -f @upstart@/etc/event.d/logd $UPSTART_CFG_DIR/logd
for i in $(seq 1 6); do
echo "$i:2345:respawn:@mingetty@/sbin/mingetty --noclear tty$i" >> /etc/inittab
cat > $UPSTART_CFG_DIR/tty$i <<EOF
start on startup
stop on shutdown
respawn @mingetty@/sbin/mingetty --noclear tty$i
EOF
done
@ -146,8 +156,8 @@ hostname nixos
# Start an interactive shell.
#exec @shell@
@shell@ &
# Start init.
exec init 2
# Start Upstart's init.
exec @upstart@/sbin/init -v

View file

@ -1,6 +1,6 @@
{ genericSubstituter, shell, coreutils, findutils
, utillinux, kernel, sysklogd, mingetty, udev
, module_init_tools, nettools, dhcp
, module_init_tools, nettools, dhcp, upstart
, path ? []
, # Whether the root device is root only. If so, we'll mount a
@ -11,7 +11,7 @@
genericSubstituter {
src = ./boot-stage-2-init.sh;
isExecutable = true;
inherit shell kernel sysklogd mingetty readOnlyRoot;
inherit shell kernel sysklogd mingetty upstart readOnlyRoot;
path = [
coreutils
findutils
@ -20,6 +20,7 @@ genericSubstituter {
module_init_tools
nettools
dhcp
upstart
];
extraPath = path;
}