diff --git a/OSDK.toml b/OSDK.toml index 55404e318..ee331433a 100644 --- a/OSDK.toml +++ b/OSDK.toml @@ -21,7 +21,7 @@ kcmd_args = [ "PATH=/bin:/benchmark", "init=/usr/bin/busybox", ] -init_args = ["sh", "-l"] +init_args = ["/init"] initramfs = "test/initramfs/build/initramfs.cpio.gz" # Special options for testing diff --git a/distro/etc_nixos/modules/systemd.nix b/distro/etc_nixos/modules/systemd.nix index 1e5cf911c..942e04148 100644 --- a/distro/etc_nixos/modules/systemd.nix +++ b/distro/etc_nixos/modules/systemd.nix @@ -22,7 +22,14 @@ shell = "${pkgs.bash}/bin/bash"; hashedPassword = null; }; - systemd.targets.getty.wants = [ "autovt@hvc0.service" ]; + systemd.targets.getty.wants = [ + "autovt@hvc0.service" + "getty@tty2.service" + "getty@tty3.service" + "getty@tty4.service" + "getty@tty5.service" + "getty@tty6.service" + ]; systemd.extraConfig = '' LogLevel=crit diff --git a/test/initramfs/nix/initramfs.nix b/test/initramfs/nix/initramfs.nix index a2a0c095a..3f959df24 100644 --- a/test/initramfs/nix/initramfs.nix +++ b/test/initramfs/nix/initramfs.nix @@ -37,6 +37,9 @@ in stdenvNoCC.mkDerivation { cp -r ${etc}/* $out/etc/ + cp ${./../src/init} $out/init + chmod +x $out/init + cp ${resolv_conf}/resolv.conf $out/etc/ ${lib.optionalString (apps != null) '' diff --git a/test/initramfs/src/etc/inittab b/test/initramfs/src/etc/inittab new file mode 100644 index 000000000..1dc19f6b6 --- /dev/null +++ b/test/initramfs/src/etc/inittab @@ -0,0 +1,15 @@ +hvc0::respawn:/bin/sh +tty1::askfirst:/bin/cttyhack /bin/sh +tty2::askfirst:/bin/cttyhack /bin/sh +tty3::askfirst:/bin/cttyhack /bin/sh +tty4::askfirst:/bin/cttyhack /bin/sh +tty5::askfirst:/bin/cttyhack /bin/sh +tty6::askfirst:/bin/cttyhack /bin/sh + +# Stuff to do when restarting the init process +::restart:/bin/init + +# Stuff to do before rebooting +::ctrlaltdel:/bin/reboot +::shutdown:/bin/umount -a -r +::shutdown:/bin/swapoff -a \ No newline at end of file diff --git a/test/initramfs/src/init b/test/initramfs/src/init new file mode 100644 index 000000000..ae7d050c4 --- /dev/null +++ b/test/initramfs/src/init @@ -0,0 +1,4 @@ +#!/bin/sh + +# Start the init process +exec /bin/init