diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-04-28 09:38:12 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-04-28 10:47:35 +0000 |
commit | 4adae7e7cd86b2f8e2cc140c02760922ee8258a9 (patch) | |
tree | b2965994cddd16801f6fbe14f0d8929053b8b939 /vm/sys | |
parent | 538ae7a47c0d896cbdebc98fbcf11b9745013bcc (diff) | |
download | spectrum-4adae7e7cd86b2f8e2cc140c02760922ee8258a9.tar spectrum-4adae7e7cd86b2f8e2cc140c02760922ee8258a9.tar.gz spectrum-4adae7e7cd86b2f8e2cc140c02760922ee8258a9.tar.bz2 spectrum-4adae7e7cd86b2f8e2cc140c02760922ee8258a9.tar.lz spectrum-4adae7e7cd86b2f8e2cc140c02760922ee8258a9.tar.xz spectrum-4adae7e7cd86b2f8e2cc140c02760922ee8258a9.tar.zst spectrum-4adae7e7cd86b2f8e2cc140c02760922ee8258a9.zip |
Adapt to s6-linux-init structure
This is preparatory work before a switch to s6-linux-init.
Diffstat (limited to 'vm/sys')
-rw-r--r-- | vm/sys/net/Makefile | 5 | ||||
-rwxr-xr-x | vm/sys/net/etc/init | 16 | ||||
-rwxr-xr-x | vm/sys/net/etc/s6-linux-init/run-image/service/getty-hvc0/run (renamed from vm/sys/net/etc/service/getty-hvc0/run) | 0 | ||||
-rwxr-xr-x | vm/sys/net/etc/s6-linux-init/scripts/rc.init | 10 |
4 files changed, 16 insertions, 15 deletions
diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile index 2aaf706..d190ebf 100644 --- a/vm/sys/net/Makefile +++ b/vm/sys/net/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: EUPL-1.2 -# SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is> +# SPDX-FileCopyrightText: 2021-2022 Alyssa Ross <hi@alyssa.is> # qemu-kvm is non-standard, but is present in at least Fedora and # Nixpkgs. If you don't have qemu-kvm, you'll need to set e.g. @@ -45,7 +45,8 @@ VM_FILES = \ etc/mdev/iface \ etc/nftables.conf \ etc/passwd \ - etc/service/getty-hvc0/run \ + etc/s6-linux-init/run-image/service/getty-hvc0/run \ + etc/s6-linux-init/scripts/rc.init \ etc/sysctl.conf # These are separate because they need to be included, but putting diff --git a/vm/sys/net/etc/init b/vm/sys/net/etc/init index 4f3ed66..9ead7ab 100755 --- a/vm/sys/net/etc/init +++ b/vm/sys/net/etc/init @@ -1,26 +1,16 @@ #!/bin/execlineb -P # SPDX-License-Identifier: EUPL-1.2 -# SPDX-FileCopyrightText: 2020-2021 Alyssa Ross <hi@alyssa.is> +# SPDX-FileCopyrightText: 2020-2022 Alyssa Ross <hi@alyssa.is> /bin/export PATH /bin /bin/s6-setsid -qb -- umask 022 if { mount -t tmpfs -o mode=0755 tmpfs /run } -if { s6-hiercopy /etc/service /run/service } +if { s6-hiercopy /etc/s6-linux-init/run-image /run } emptyenv -p -background { - s6-setsid -- - - if { s6-rc-init -c /etc/s6-rc /run/service } - - if { s6-mkdir -p /dev/pts /dev/shm } - - if { mount -a } - - s6-rc change ok-all -} +background { s6-setsid -- /etc/s6-linux-init/scripts/rc.init } unexport ! cd /run/service diff --git a/vm/sys/net/etc/service/getty-hvc0/run b/vm/sys/net/etc/s6-linux-init/run-image/service/getty-hvc0/run index 2d2022c..2d2022c 100755 --- a/vm/sys/net/etc/service/getty-hvc0/run +++ b/vm/sys/net/etc/s6-linux-init/run-image/service/getty-hvc0/run diff --git a/vm/sys/net/etc/s6-linux-init/scripts/rc.init b/vm/sys/net/etc/s6-linux-init/scripts/rc.init new file mode 100755 index 0000000..7b32d83 --- /dev/null +++ b/vm/sys/net/etc/s6-linux-init/scripts/rc.init @@ -0,0 +1,10 @@ +#!/bin/execlineb -P +# SPDX-License-Identifier: EUPL-1.2 +# SPDX-FileCopyrightText: 2020-2022 Alyssa Ross <hi@alyssa.is> + +if { s6-rc-init -c /etc/s6-rc /run/service } + +if { s6-mkdir -p /dev/pts /dev/shm } +if { mount -a } + +s6-rc change ok-all |