diff --git a/test/boot-environment.nix b/test/boot-environment.nix index 4d4d98a0ed51..281a6318af04 100644 --- a/test/boot-environment.nix +++ b/test/boot-environment.nix @@ -77,12 +77,39 @@ rec { }; + # The services (Upstart) configuration for the system. + upstartJobs = import ./upstart-jobs/gather.nix { + inherit (pkgs) stdenv; + + jobs = [ + # For the builtin logd job. + pkgs.upstart + + # The terminals on ttyX. + (map + (ttyNumber: import ./upstart-jobs/mingetty.nix { + inherit (pkgs) genericSubstituter; + mingetty = pkgs.mingettyWrapper; + inherit ttyNumber; + }) + [1 2 3 4 5 6] + ) + + # Syslogd. + (import ./upstart-jobs/syslogd.nix { + inherit (pkgs) genericSubstituter sysklogd; + }) + ]; + }; + + # The init script of boot stage 2, which is supposed to do # everything else to bring up the system. bootStage2 = import ./boot-stage-2.nix { inherit (pkgs) genericSubstituter coreutils findutils - utillinux kernel sysklogd udev module_init_tools + utillinux kernel udev module_init_tools nettools upstart; + inherit upstartJobs; shell = pkgs.bash + "/bin/sh"; dhcp = pkgs.dhcpWrapper; @@ -114,8 +141,6 @@ rec { nixosInstaller ]; - mingetty = pkgs.mingettyWrapper; - inherit readOnlyRoot; }; diff --git a/test/boot-stage-2-init.sh b/test/boot-stage-2-init.sh index a80ee2aaa59d..5f68fea82cd7 100644 --- a/test/boot-stage-2-init.sh +++ b/test/boot-stage-2-init.sh @@ -68,13 +68,10 @@ udevtrigger udevsettle # wait for udev to finish -# Start syslogd. +# Necessary configuration for syslogd. mkdir -m 0755 -p /var/run -#mkdir -p /var/log -#touch /var/log/messages echo "*.* /dev/tty10" > /etc/syslog.conf echo "syslog 514/udp" > /etc/services # required, even if we don't use it -@sysklogd@/sbin/syslogd & # Try to load modules for all PCI devices. @@ -113,17 +110,8 @@ fi # 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 - cat > $UPSTART_CFG_DIR/tty$i <