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 | |
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.
18 files changed, 70 insertions, 64 deletions
diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile index 54034ca..d37fe45 100644 --- a/host/rootfs/Makefile +++ b/host/rootfs/Makefile @@ -25,11 +25,12 @@ FILES = \ etc/mdev/wait \ etc/parse-devname \ etc/passwd \ - etc/service/getty-tty1/run \ - etc/service/getty-tty2/run \ - etc/service/getty-tty3/run \ - etc/service/getty-tty4/run \ - etc/service/getty-ttyS0/run \ + etc/s6-linux-init/run-image/service/getty-tty1/run \ + etc/s6-linux-init/run-image/service/getty-tty2/run \ + etc/s6-linux-init/run-image/service/getty-tty3/run \ + etc/s6-linux-init/run-image/service/getty-tty4/run \ + etc/s6-linux-init/run-image/service/getty-ttyS0/run \ + etc/s6-linux-init/scripts/rc.init \ etc/xdg/weston/autolaunch \ etc/xdg/weston/weston.ini \ usr/bin/lsvm \ diff --git a/host/rootfs/etc/init b/host/rootfs/etc/init index a4c6c60..0dff005 100755 --- a/host/rootfs/etc/init +++ b/host/rootfs/etc/init @@ -8,20 +8,10 @@ umask 022 if { mount -t tmpfs -o mode=0755 tmpfs /run } if { s6-dumpenv /run/param } -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/host/rootfs/etc/service/getty-tty1/run b/host/rootfs/etc/s6-linux-init/run-image/service/getty-tty1/run index c6da707..c6da707 100755 --- a/host/rootfs/etc/service/getty-tty1/run +++ b/host/rootfs/etc/s6-linux-init/run-image/service/getty-tty1/run diff --git a/host/rootfs/etc/service/getty-tty2/run b/host/rootfs/etc/s6-linux-init/run-image/service/getty-tty2/run index 5af93e3..5af93e3 100755 --- a/host/rootfs/etc/service/getty-tty2/run +++ b/host/rootfs/etc/s6-linux-init/run-image/service/getty-tty2/run diff --git a/host/rootfs/etc/service/getty-tty3/run b/host/rootfs/etc/s6-linux-init/run-image/service/getty-tty3/run index fc4ec34..fc4ec34 100755 --- a/host/rootfs/etc/service/getty-tty3/run +++ b/host/rootfs/etc/s6-linux-init/run-image/service/getty-tty3/run diff --git a/host/rootfs/etc/service/getty-tty4/run b/host/rootfs/etc/s6-linux-init/run-image/service/getty-tty4/run index e32196b..e32196b 100755 --- a/host/rootfs/etc/service/getty-tty4/run +++ b/host/rootfs/etc/s6-linux-init/run-image/service/getty-tty4/run diff --git a/host/rootfs/etc/service/getty-ttyS0/run b/host/rootfs/etc/s6-linux-init/run-image/service/getty-ttyS0/run index d93e03f..d93e03f 100755 --- a/host/rootfs/etc/service/getty-ttyS0/run +++ b/host/rootfs/etc/s6-linux-init/run-image/service/getty-ttyS0/run diff --git a/host/rootfs/etc/s6-linux-init/scripts/rc.init b/host/rootfs/etc/s6-linux-init/scripts/rc.init new file mode 100755 index 0000000..7b32d83 --- /dev/null +++ b/host/rootfs/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 diff --git a/vm/app/catgirl/Makefile b/vm/app/catgirl/Makefile index 3ee5842..0d90a01 100644 --- a/vm/app/catgirl/Makefile +++ b/vm/app/catgirl/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. @@ -46,7 +46,8 @@ VM_FILES = \ etc/mdev.conf \ etc/mdev/iface \ etc/passwd \ - etc/resolv.conf + etc/resolv.conf \ + etc/s6-linux-init/scripts/rc.init # These are separate because they need to be included, but putting # them as make dependencies would confuse make. @@ -66,7 +67,8 @@ build/rootfs.tar: build/empty $(PACKAGES_TAR) $(VM_FILES) $(VM_BUILD_FILES) for m in $(VM_MOUNTPOINTS); do \ tar $(TARFLAGS) --append -hf $@ --xform="s,.*,$$m," build/empty ; \ done - tar $(TARFLAGS) --append -hf $@ --xform='s,.*,etc/service,' build/empty + tar $(TARFLAGS) --append -hf $@ \ + --xform='s,.*,etc/s6-linux-init/run-image/service,' build/empty VM_S6_RC_FILES = \ etc/s6-rc/catgirl/run \ diff --git a/vm/app/catgirl/etc/init b/vm/app/catgirl/etc/init index 4f3ed66..9ead7ab 100755 --- a/vm/app/catgirl/etc/init +++ b/vm/app/catgirl/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/app/catgirl/etc/s6-linux-init/scripts/rc.init b/vm/app/catgirl/etc/s6-linux-init/scripts/rc.init new file mode 100755 index 0000000..7b32d83 --- /dev/null +++ b/vm/app/catgirl/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 diff --git a/vm/app/lynx/Makefile b/vm/app/lynx/Makefile index 016b1f5..e343fce 100644 --- a/vm/app/lynx/Makefile +++ b/vm/app/lynx/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. @@ -46,7 +46,8 @@ VM_FILES = \ etc/mdev.conf \ etc/mdev/iface \ etc/passwd \ - etc/resolv.conf + etc/resolv.conf \ + etc/s6-linux-init/scripts/rc.init # These are separate because they need to be included, but putting # them as make dependencies would confuse make. @@ -66,7 +67,8 @@ build/rootfs.tar: build/empty $(PACKAGES_TAR) $(VM_FILES) $(VM_BUILD_FILES) for m in $(VM_MOUNTPOINTS); do \ tar $(TARFLAGS) --append -hf $@ --xform="s,.*,$$m," build/empty ; \ done - tar $(TARFLAGS) --append -hf $@ --xform='s,.*,etc/service,' build/empty + tar $(TARFLAGS) --append -hf $@ \ + --xform='s,.*,etc/s6-linux-init/run-image/service,' build/empty VM_S6_RC_FILES = \ etc/s6-rc/lynx/run \ diff --git a/vm/app/lynx/etc/init b/vm/app/lynx/etc/init index 4f3ed66..9ead7ab 100755 --- a/vm/app/lynx/etc/init +++ b/vm/app/lynx/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/app/lynx/etc/s6-linux-init/scripts/rc.init b/vm/app/lynx/etc/s6-linux-init/scripts/rc.init new file mode 100755 index 0000000..7b32d83 --- /dev/null +++ b/vm/app/lynx/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 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 |