commit 319437f89d817da89985e99cb81e96bb64f22ad0
parent a8ed5080371ec1c24cc75818bb00eb3ce3968ff0
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date: Tue, 26 Jul 2022 16:28:02 +0200
Create tty-related services using loops, reformat s6-rc.aat, issue-gen
Diffstat:
M | Makefile | | | 2 | +- |
M | s6-rc.aat | | | 351 | ++++++++++++++++++++++++++++++------------------------------------------------- |
M | s6-rc.fileset | | | 401 | +++++++++++++++++++++++++++++++++++++++++++++++-------------------------------- |
3 files changed, 374 insertions(+), 380 deletions(-)
diff --git a/Makefile b/Makefile
@@ -25,7 +25,7 @@ build/fstab.awk: fstab.aat parse_fs.include.awk
s6-rc.fileset: build/s6-rc.qawk build/s6-rc-mount.awk fs build/config
awk -f build/s6-rc-mount.awk fs >"$@.new"
- awk -f build/s6-rc.qawk build/config /dev/null >>"$@.new"
+ awk -f build/s6-rc.qawk build/config >>"$@.new"
mv "$@.new" "$@"
static/etc/fstab: build/fstab.awk fs
diff --git a/s6-rc.aat b/s6-rc.aat
@@ -1,6 +1,42 @@
|BEGIN{
/ d m755
+
+/ok-all d m755
+/ok-all/type cN bundle m644
+/ok-all/contents
+CN ok-all-but-tty
+ gettys
+m644
+
+/ok-all-but-tty d m755
+/ok-all-but-tty/type cN bundle m644
+/ok-all-but-tty/contents
+CN ok-mount
+ net-all
+|# setfont
+ dmesg
+ hostname
+ modules
+ sshd
+m644
+
+/net-all d m755
+/net-all/type cN bundle m644
+/net-all/contents
+CN dhcpcd
+ unbound
+ loopback
+m644
+
+/ok-mount d m755
+/ok-mount/type cN bundle m644
+/ok-mount/contents
+CN ok-sysinit
+ ok-localmount
+m644
+
/dhcpcd d m755
+/dhcpcd/type cN longrun m644
/dhcpcd/dependencies
CN modules
ok-mount
@@ -20,7 +56,7 @@ CN #!/command/execlineb -P
dhcpcd --nobackground
m755
-/dhcpcd/type cN longrun m644
+
/dmesg d m755
/dmesg/type cN oneshot m644
/dmesg/up
@@ -28,76 +64,86 @@ CN # description="Set the dmesg level for a cleaner boot"
# dmesg_level=1
dmesg -n1
m755
+
+/hostname d m755
+/hostname/type cN oneshot m644
+/hostname/up cN hostname -F /etc/hostname m755
+
+/loadkeys d m755
+/loadkeys/dependencies cN kbd_mode m644
+/loadkeys/type cN oneshot m644
+/loadkeys/up cN loadkeys --unicode /root/keymap m644
+
+|### TTY configuration ###
+|tty_max=12
+|getty_max=8
+
/gettys d m755
+/gettys/type cN bundle m644
/gettys/contents
CN tty1
- tty3
- tty2
- tty4
+|for(tty=2; tty<=getty_max; tty++) {
+ tty{{tty}}
+|}
m644
-/gettys/type cN bundle m644
-/hostname d m755
-/hostname/type cN oneshot m644
-/hostname/up cN hostname -F /etc/hostname m755
+
/kbd_mode d m755
+/kbd_mode/type cN bundle m644
/kbd_mode/contents
CN kbd_mode-tty1
- kbd_mode-tty2
- kbd_mode-tty3
- kbd_mode-tty4
- kbd_mode-tty9
- kbd_mode-tty10
- kbd_mode-tty11
- kbd_mode-tty12
+|for(tty=2; tty<=tty_max; tty++) {
+ kbd_mode-tty{{tty}}
+|}
m644
-/kbd_mode-tty1 d m755
-/kbd_mode-tty1/type cN oneshot m644
-/kbd_mode-tty1/up cN kbd_mode -u -C /dev/tty1 m644
-/kbd_mode-tty10 d m755
-/kbd_mode-tty10/type cN oneshot m644
-/kbd_mode-tty10/up cN kbd_mode -u -C /dev/tty10 m644
-/kbd_mode-tty11 d m755
-/kbd_mode-tty11/type cN oneshot m644
-/kbd_mode-tty11/up cN kbd_mode -u -C /dev/tty11 m644
-/kbd_mode-tty12 d m755
-/kbd_mode-tty12/type cN oneshot m644
-/kbd_mode-tty12/up cN kbd_mode -u -C /dev/tty12 m644
-/kbd_mode-tty2 d m755
-/kbd_mode-tty2/type cN oneshot m644
-/kbd_mode-tty2/up cN kbd_mode -u -C /dev/tty2 m644
-/kbd_mode-tty3 d m755
-/kbd_mode-tty3/type cN oneshot m644
-/kbd_mode-tty3/up cN kbd_mode -u -C /dev/tty3 m644
-/kbd_mode-tty4 d m755
-/kbd_mode-tty4/type cN oneshot m644
-/kbd_mode-tty4/up cN kbd_mode -u -C /dev/tty4 m644
-/kbd_mode-tty5 d m755
-/kbd_mode-tty5/type cN oneshot m644
-/kbd_mode-tty5/up cN kbd_mode -u -C /dev/tty5 m644
-/kbd_mode-tty6 d m755
-/kbd_mode-tty6/type cN oneshot m644
-/kbd_mode-tty6/up cN kbd_mode -u -C /dev/tty6 m644
-/kbd_mode-tty7 d m755
-/kbd_mode-tty7/type cN oneshot m644
-/kbd_mode-tty7/up cN kbd_mode -u -C /dev/tty7 m644
-/kbd_mode-tty8 d m755
-/kbd_mode-tty8/type cN oneshot m644
-/kbd_mode-tty8/up cN kbd_mode -u -C /dev/tty8 m644
-/kbd_mode-tty9 d m755
-/kbd_mode-tty9/type cN oneshot m644
-/kbd_mode-tty9/up cN kbd_mode -u -C /dev/tty9 m644
-/kbd_mode/type cN bundle m644
-/loadkeys d m755
-/loadkeys/dependencies cN kbd_mode m644
-/loadkeys/type cN oneshot m644
-/loadkeys/up cN loadkeys --unicode /root/keymap m644
-/loopback d m755
-/loopback/type cN oneshot m644
-/loopback/up
-CN if { ip link set lo up }
- if -nt { ip addr add 127.0.0.1/8 dev lo brd + }
- pipeline { ip addr show dev lo } grep -q "inet 127\\.0\\.0\\.1"
+
+|for(tty=1; tty<=tty_max; tty++) {
+/kbd_mode-tty{{tty}} d m755
+/kbd_mode-tty{{tty}}/type cN oneshot m644
+/kbd_mode-tty{{tty}}/up cN kbd_mode -u -C /dev/tty{{tty}} m644
+|}
+
+|#/setfont d m755
+|#/setfont/contents
+|#CN setfont-tty1
+|# setfont-tty2
+|# setfont-tty3
+|# setfont-tty4
+|#m644
+|#/setfont-tty1 d m755
+|#/setfont-tty1/type cN oneshot m644
+|#/setfont-tty1/up cN redirfd -r 0 /dev/tty1 setfont ter-v14n m644
+|#/setfont-tty2 d m755
+|#/setfont-tty2/type cN oneshot m644
+|#/setfont-tty2/up cN redirfd -r 0 /dev/tty2 setfont ter-v14n m644
+|#/setfont-tty3 d m755
+|#/setfont-tty3/type cN oneshot m644
+|#/setfont-tty3/up cN redirfd -r 0 /dev/tty3 setfont ter-v14n m644
+|#/setfont-tty4 d m755
+|#/setfont-tty4/type cN oneshot m644
+|#/setfont-tty4/up cN redirfd -r 0 /dev/tty4 setfont ter-v14n m644
+|#/setfont/type cN bundle m644
+
+|for(tty=1; tty<=getty_max; tty++) {
+/tty{{tty}} d m755
+/tty{{tty}}/type cN longrun m644
+/tty{{tty}}/dependencies cN ok-sysinit m644
+/tty{{tty}}/run
+CN #!/command/execlineb -P
+ getpid SERVICE_PID
+ foreground {
+ importas -i SERVICE_PID SERVICE_PID
+ if { test -d /run/cgroup2 }
+ if { mkdir -p /run/cgroup2/s6-rc/tty{{tty}} }
+ redirfd -w 1 /run/cgroup2/s6-rc/tty{{tty}}/cgroup.procs
+ printf "%s" ${SERVICE_PID}
+ }
+ unexport SERVICE_PID
+ foreground { getty-gen }
+
+ env LOGIN_TTY=/dev/tty{{tty}} /sbin/getty 38400 tty{{tty}} linux
m755
+|}
+
/modules d m755
/modules/dependencies cN dmesg m644
/modules/type cN oneshot m644
@@ -110,74 +156,36 @@ CN foreground { modprobe fuse }
foreground { modprobe virtio_pci }
foreground { modprobe virtio_net }
m755
-/net-all d m755
-/net-all/contents
-CN dhcpcd
- unbound
- loopback
-m644
-/net-all/type cN bundle m644
-/ok-all d m755
-/ok-all-but-tty d m755
-/ok-all-but-tty/contents
-CN ok-mount
- net-all
-|# setfont
- dmesg
- hostname
- modules
- sshd
-m644
-/ok-all-but-tty/type cN bundle m644
-/ok-all/contents
-CN ok-all-but-tty
- gettys
-m644
-/ok-all/type cN bundle m644
-/ok-mount d m755
-/ok-mount/contents
-CN ok-sysinit
- ok-localmount
-m644
-/ok-mount/type cN bundle m644
+
+/loopback d m755
+/loopback/type cN oneshot m644
+/loopback/up
+CN if { ip link set lo up }
+ if -nt { ip addr add 127.0.0.1/8 dev lo brd + }
+ pipeline { ip addr show dev lo } grep -q "inet 127\\.0\\.0\\.1"
+m755
+
/openrc d m755
+/openrc/type cN oneshot m644
/openrc/dependencies
CN ok-sysinit
ok-mount
modules
m644
-/openrc/down
-CN export TERM "linux"
- /sbin/openrc shutdown
-m644
-/openrc/type cN oneshot m644
/openrc/up
CN export TERM "linux"
foreground { /sbin/openrc boot }
/sbin/openrc default
m644
+/openrc/down
+CN export TERM "linux"
+ /sbin/openrc shutdown
+m644
+
/.scripts d m755
-|#/setfont d m755
-|#/setfont/contents
-|#CN setfont-tty1
-|# setfont-tty2
-|# setfont-tty3
-|# setfont-tty4
-|#m644
-|#/setfont-tty1 d m755
-|#/setfont-tty1/type cN oneshot m644
-|#/setfont-tty1/up cN redirfd -r 0 /dev/tty1 setfont ter-v14n m644
-|#/setfont-tty2 d m755
-|#/setfont-tty2/type cN oneshot m644
-|#/setfont-tty2/up cN redirfd -r 0 /dev/tty2 setfont ter-v14n m644
-|#/setfont-tty3 d m755
-|#/setfont-tty3/type cN oneshot m644
-|#/setfont-tty3/up cN redirfd -r 0 /dev/tty3 setfont ter-v14n m644
-|#/setfont-tty4 d m755
-|#/setfont-tty4/type cN oneshot m644
-|#/setfont-tty4/up cN redirfd -r 0 /dev/tty4 setfont ter-v14n m644
-|#/setfont/type cN bundle m644
+
/sshd d m755
+/sshd/type cN longrun m644
/sshd/dependencies
CN ssh_host_ed25519_key
ssh_host_rsa_key
@@ -198,128 +206,36 @@ CN #!/command/execlineb -P
/usr/sbin/sshd -D -f /etc/ssh/sshd_config
m755
-/sshd/type cN longrun m644
+
/ssh_host_ed25519_key d m755
+/ssh_host_ed25519_key/type cN oneshot m644
/ssh_host_ed25519_key/dependencies
CN hostname
rootfs
m644
-/ssh_host_ed25519_key/type cN oneshot m644
/ssh_host_ed25519_key/up
CN if -n -t { s6-test -f /etc/ssh/ssh_host_ed25519_key }
ssh-keygen -N "" -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
m644
+
/ssh_host_rsa_key d m755
+/ssh_host_rsa_key/type cN oneshot m644
/ssh_host_rsa_key/dependencies
CN hostname
rootfs
m644
-/ssh_host_rsa_key/type cN oneshot m644
/ssh_host_rsa_key/up
CN if -n -t { s6-test -f /etc/ssh/ssh_host_rsa_key }
ssh-keygen -N "" -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key
m644
+
/swap d m755
-/swap/down cN swapoff -a m644
/swap/type cN oneshot m644
/swap/up cN swapon -a m644
-/tty1 d m755
-/tty1/dependencies cN ok-sysinit m644
-/tty1/finish
-CN #!/command/execlineb -P
- redirfd -w 1 /dev/tty1
- fdmove -c 2 1
- foreground { s6-echo "\nwaiting for session cleanup" }
- flock /run/ttylock/tty1 true
-m755
-/tty1/run
-CN #!/command/execlineb -P
- getpid SERVICE_PID
- foreground {
- importas -i SERVICE_PID SERVICE_PID
- if { test -d /run/cgroup2 }
- if { mkdir -p /run/cgroup2/s6-rc/tty1 }
- redirfd -w 1 /run/cgroup2/s6-rc/tty1/cgroup.procs
- printf "%s" ${SERVICE_PID}
- }
- unexport SERVICE_PID
-
- env LOGIN_TTY=/dev/tty1 /sbin/getty 38400 tty1 linux
-m755
-/tty1/type cN longrun m644
-/tty2 d m755
-/tty2/dependencies cN ok-sysinit m644
-/tty2/finish
-CN #!/command/execlineb -P
- redirfd -w 1 /dev/tty2
- fdmove -c 2 1
- foreground { s6-echo "\nwaiting for session cleanup" }
- flock /run/ttylock/tty2 true
-m755
-/tty2/run
-CN #!/command/execlineb -P
- getpid SERVICE_PID
- foreground {
- importas -i SERVICE_PID SERVICE_PID
- if { test -d /run/cgroup2 }
- if { mkdir -p /run/cgroup2/s6-rc/tty2 }
- redirfd -w 1 /run/cgroup2/s6-rc/tty2/cgroup.procs
- printf "%s" ${SERVICE_PID}
- }
- unexport SERVICE_PID
-
- env LOGIN_TTY=/dev/tty2 /sbin/getty 38400 tty2 linux
-m755
-/tty2/type cN longrun m644
-/tty3 d m755
-/tty3/dependencies cN ok-sysinit m644
-/tty3/finish
-CN #!/command/execlineb -P
- redirfd -w 1 /dev/tty3
- fdmove -c 2 1
- foreground { s6-echo "\nwaiting for session cleanup" }
- flock /run/ttylock/tty3 true
-m755
-/tty3/run
-CN #!/command/execlineb -P
- getpid SERVICE_PID
- foreground {
- importas -i SERVICE_PID SERVICE_PID
- if { test -d /run/cgroup2 }
- if { mkdir -p /run/cgroup2/s6-rc/tty3 }
- redirfd -w 1 /run/cgroup2/s6-rc/tty3/cgroup.procs
- printf "%s" ${SERVICE_PID}
- }
- unexport SERVICE_PID
-
- env LOGIN_TTY=/dev/tty3 /sbin/getty 38400 tty3 linux
-m755
-/tty3/type cN longrun m644
-/tty4 d m755
-/tty4/dependencies cN ok-sysinit m644
-/tty4/finish
-CN #!/command/execlineb -P
- redirfd -w 1 /dev/tty4
- fdmove -c 2 1
- foreground { s6-echo "\nwaiting for session cleanup" }
- flock /run/ttylock/tty4 true
-m755
-/tty4/run
-CN #!/command/execlineb -P
- getpid SERVICE_PID
- foreground {
- importas -i SERVICE_PID SERVICE_PID
- if { test -d /run/cgroup2 }
- if { mkdir -p /run/cgroup2/s6-rc/tty4 }
- redirfd -w 1 /run/cgroup2/s6-rc/tty4/cgroup.procs
- printf "%s" ${SERVICE_PID}
- }
- unexport SERVICE_PID
-
- env LOGIN_TTY=/dev/tty4 /sbin/getty 38400 tty4 linux
-m755
-/tty4/type cN longrun m644
+/swap/down cN swapoff -a m644
+
/unbound d m755
+/unbound/type cN longrun m644
/unbound/dependencies
CN loopback
ok-mount
@@ -339,5 +255,4 @@ CN #!/command/execlineb -P
unbound -d
m755
-/unbound/type cN longrun m644
|}
diff --git a/s6-rc.fileset b/s6-rc.fileset
@@ -111,7 +111,42 @@ CN rootfs
m644
/ok-localmount/type cN bundle m644
/ d m755
+
+/ok-all d m755
+/ok-all/type cN bundle m644
+/ok-all/contents
+CN ok-all-but-tty
+ gettys
+m644
+
+/ok-all-but-tty d m755
+/ok-all-but-tty/type cN bundle m644
+/ok-all-but-tty/contents
+CN ok-mount
+ net-all
+ dmesg
+ hostname
+ modules
+ sshd
+m644
+
+/net-all d m755
+/net-all/type cN bundle m644
+/net-all/contents
+CN dhcpcd
+ unbound
+ loopback
+m644
+
+/ok-mount d m755
+/ok-mount/type cN bundle m644
+/ok-mount/contents
+CN ok-sysinit
+ ok-localmount
+m644
+
/dhcpcd d m755
+/dhcpcd/type cN longrun m644
/dhcpcd/dependencies
CN modules
ok-mount
@@ -131,7 +166,7 @@ CN #!/command/execlineb -P
dhcpcd --nobackground
m755
-/dhcpcd/type cN longrun m644
+
/dmesg d m755
/dmesg/type cN oneshot m644
/dmesg/up
@@ -139,40 +174,50 @@ CN # description="Set the dmesg level for a cleaner boot"
# dmesg_level=1
dmesg -n1
m755
+
+/hostname d m755
+/hostname/type cN oneshot m644
+/hostname/up cN hostname -F /etc/hostname m755
+
+/loadkeys d m755
+/loadkeys/dependencies cN kbd_mode m644
+/loadkeys/type cN oneshot m644
+/loadkeys/up cN loadkeys --unicode /root/keymap m644
+
+
/gettys d m755
+/gettys/type cN bundle m644
/gettys/contents
CN tty1
- tty3
tty2
+ tty3
tty4
+ tty5
+ tty6
+ tty7
+ tty8
m644
-/gettys/type cN bundle m644
-/hostname d m755
-/hostname/type cN oneshot m644
-/hostname/up cN hostname -F /etc/hostname m755
+
/kbd_mode d m755
+/kbd_mode/type cN bundle m644
/kbd_mode/contents
CN kbd_mode-tty1
kbd_mode-tty2
kbd_mode-tty3
kbd_mode-tty4
+ kbd_mode-tty5
+ kbd_mode-tty6
+ kbd_mode-tty7
+ kbd_mode-tty8
kbd_mode-tty9
kbd_mode-tty10
kbd_mode-tty11
kbd_mode-tty12
m644
+
/kbd_mode-tty1 d m755
/kbd_mode-tty1/type cN oneshot m644
/kbd_mode-tty1/up cN kbd_mode -u -C /dev/tty1 m644
-/kbd_mode-tty10 d m755
-/kbd_mode-tty10/type cN oneshot m644
-/kbd_mode-tty10/up cN kbd_mode -u -C /dev/tty10 m644
-/kbd_mode-tty11 d m755
-/kbd_mode-tty11/type cN oneshot m644
-/kbd_mode-tty11/up cN kbd_mode -u -C /dev/tty11 m644
-/kbd_mode-tty12 d m755
-/kbd_mode-tty12/type cN oneshot m644
-/kbd_mode-tty12/up cN kbd_mode -u -C /dev/tty12 m644
/kbd_mode-tty2 d m755
/kbd_mode-tty2/type cN oneshot m644
/kbd_mode-tty2/up cN kbd_mode -u -C /dev/tty2 m644
@@ -197,18 +242,162 @@ m644
/kbd_mode-tty9 d m755
/kbd_mode-tty9/type cN oneshot m644
/kbd_mode-tty9/up cN kbd_mode -u -C /dev/tty9 m644
-/kbd_mode/type cN bundle m644
-/loadkeys d m755
-/loadkeys/dependencies cN kbd_mode m644
-/loadkeys/type cN oneshot m644
-/loadkeys/up cN loadkeys --unicode /root/keymap m644
-/loopback d m755
-/loopback/type cN oneshot m644
-/loopback/up
-CN if { ip link set lo up }
- if -nt { ip addr add 127.0.0.1/8 dev lo brd + }
- pipeline { ip addr show dev lo } grep -q "inet 127\\.0\\.0\\.1"
+/kbd_mode-tty10 d m755
+/kbd_mode-tty10/type cN oneshot m644
+/kbd_mode-tty10/up cN kbd_mode -u -C /dev/tty10 m644
+/kbd_mode-tty11 d m755
+/kbd_mode-tty11/type cN oneshot m644
+/kbd_mode-tty11/up cN kbd_mode -u -C /dev/tty11 m644
+/kbd_mode-tty12 d m755
+/kbd_mode-tty12/type cN oneshot m644
+/kbd_mode-tty12/up cN kbd_mode -u -C /dev/tty12 m644
+
+
+/tty1 d m755
+/tty1/type cN longrun m644
+/tty1/dependencies cN ok-sysinit m644
+/tty1/run
+CN #!/command/execlineb -P
+ getpid SERVICE_PID
+ foreground {
+ importas -i SERVICE_PID SERVICE_PID
+ if { test -d /run/cgroup2 }
+ if { mkdir -p /run/cgroup2/s6-rc/tty1 }
+ redirfd -w 1 /run/cgroup2/s6-rc/tty1/cgroup.procs
+ printf "%s" ${SERVICE_PID}
+ }
+ unexport SERVICE_PID
+ foreground { getty-gen }
+
+ env LOGIN_TTY=/dev/tty1 /sbin/getty 38400 tty1 linux
m755
+/tty2 d m755
+/tty2/type cN longrun m644
+/tty2/dependencies cN ok-sysinit m644
+/tty2/run
+CN #!/command/execlineb -P
+ getpid SERVICE_PID
+ foreground {
+ importas -i SERVICE_PID SERVICE_PID
+ if { test -d /run/cgroup2 }
+ if { mkdir -p /run/cgroup2/s6-rc/tty2 }
+ redirfd -w 1 /run/cgroup2/s6-rc/tty2/cgroup.procs
+ printf "%s" ${SERVICE_PID}
+ }
+ unexport SERVICE_PID
+ foreground { getty-gen }
+
+ env LOGIN_TTY=/dev/tty2 /sbin/getty 38400 tty2 linux
+m755
+/tty3 d m755
+/tty3/type cN longrun m644
+/tty3/dependencies cN ok-sysinit m644
+/tty3/run
+CN #!/command/execlineb -P
+ getpid SERVICE_PID
+ foreground {
+ importas -i SERVICE_PID SERVICE_PID
+ if { test -d /run/cgroup2 }
+ if { mkdir -p /run/cgroup2/s6-rc/tty3 }
+ redirfd -w 1 /run/cgroup2/s6-rc/tty3/cgroup.procs
+ printf "%s" ${SERVICE_PID}
+ }
+ unexport SERVICE_PID
+ foreground { getty-gen }
+
+ env LOGIN_TTY=/dev/tty3 /sbin/getty 38400 tty3 linux
+m755
+/tty4 d m755
+/tty4/type cN longrun m644
+/tty4/dependencies cN ok-sysinit m644
+/tty4/run
+CN #!/command/execlineb -P
+ getpid SERVICE_PID
+ foreground {
+ importas -i SERVICE_PID SERVICE_PID
+ if { test -d /run/cgroup2 }
+ if { mkdir -p /run/cgroup2/s6-rc/tty4 }
+ redirfd -w 1 /run/cgroup2/s6-rc/tty4/cgroup.procs
+ printf "%s" ${SERVICE_PID}
+ }
+ unexport SERVICE_PID
+ foreground { getty-gen }
+
+ env LOGIN_TTY=/dev/tty4 /sbin/getty 38400 tty4 linux
+m755
+/tty5 d m755
+/tty5/type cN longrun m644
+/tty5/dependencies cN ok-sysinit m644
+/tty5/run
+CN #!/command/execlineb -P
+ getpid SERVICE_PID
+ foreground {
+ importas -i SERVICE_PID SERVICE_PID
+ if { test -d /run/cgroup2 }
+ if { mkdir -p /run/cgroup2/s6-rc/tty5 }
+ redirfd -w 1 /run/cgroup2/s6-rc/tty5/cgroup.procs
+ printf "%s" ${SERVICE_PID}
+ }
+ unexport SERVICE_PID
+ foreground { getty-gen }
+
+ env LOGIN_TTY=/dev/tty5 /sbin/getty 38400 tty5 linux
+m755
+/tty6 d m755
+/tty6/type cN longrun m644
+/tty6/dependencies cN ok-sysinit m644
+/tty6/run
+CN #!/command/execlineb -P
+ getpid SERVICE_PID
+ foreground {
+ importas -i SERVICE_PID SERVICE_PID
+ if { test -d /run/cgroup2 }
+ if { mkdir -p /run/cgroup2/s6-rc/tty6 }
+ redirfd -w 1 /run/cgroup2/s6-rc/tty6/cgroup.procs
+ printf "%s" ${SERVICE_PID}
+ }
+ unexport SERVICE_PID
+ foreground { getty-gen }
+
+ env LOGIN_TTY=/dev/tty6 /sbin/getty 38400 tty6 linux
+m755
+/tty7 d m755
+/tty7/type cN longrun m644
+/tty7/dependencies cN ok-sysinit m644
+/tty7/run
+CN #!/command/execlineb -P
+ getpid SERVICE_PID
+ foreground {
+ importas -i SERVICE_PID SERVICE_PID
+ if { test -d /run/cgroup2 }
+ if { mkdir -p /run/cgroup2/s6-rc/tty7 }
+ redirfd -w 1 /run/cgroup2/s6-rc/tty7/cgroup.procs
+ printf "%s" ${SERVICE_PID}
+ }
+ unexport SERVICE_PID
+ foreground { getty-gen }
+
+ env LOGIN_TTY=/dev/tty7 /sbin/getty 38400 tty7 linux
+m755
+/tty8 d m755
+/tty8/type cN longrun m644
+/tty8/dependencies cN ok-sysinit m644
+/tty8/run
+CN #!/command/execlineb -P
+ getpid SERVICE_PID
+ foreground {
+ importas -i SERVICE_PID SERVICE_PID
+ if { test -d /run/cgroup2 }
+ if { mkdir -p /run/cgroup2/s6-rc/tty8 }
+ redirfd -w 1 /run/cgroup2/s6-rc/tty8/cgroup.procs
+ printf "%s" ${SERVICE_PID}
+ }
+ unexport SERVICE_PID
+ foreground { getty-gen }
+
+ env LOGIN_TTY=/dev/tty8 /sbin/getty 38400 tty8 linux
+m755
+
/modules d m755
/modules/dependencies cN dmesg m644
/modules/type cN oneshot m644
@@ -221,53 +410,36 @@ CN foreground { modprobe fuse }
foreground { modprobe virtio_pci }
foreground { modprobe virtio_net }
m755
-/net-all d m755
-/net-all/contents
-CN dhcpcd
- unbound
- loopback
-m644
-/net-all/type cN bundle m644
-/ok-all d m755
-/ok-all-but-tty d m755
-/ok-all-but-tty/contents
-CN ok-mount
- net-all
- dmesg
- hostname
- modules
- sshd
-m644
-/ok-all-but-tty/type cN bundle m644
-/ok-all/contents
-CN ok-all-but-tty
- gettys
-m644
-/ok-all/type cN bundle m644
-/ok-mount d m755
-/ok-mount/contents
-CN ok-sysinit
- ok-localmount
-m644
-/ok-mount/type cN bundle m644
+
+/loopback d m755
+/loopback/type cN oneshot m644
+/loopback/up
+CN if { ip link set lo up }
+ if -nt { ip addr add 127.0.0.1/8 dev lo brd + }
+ pipeline { ip addr show dev lo } grep -q "inet 127\\.0\\.0\\.1"
+m755
+
/openrc d m755
+/openrc/type cN oneshot m644
/openrc/dependencies
CN ok-sysinit
ok-mount
modules
m644
-/openrc/down
-CN export TERM "linux"
- /sbin/openrc shutdown
-m644
-/openrc/type cN oneshot m644
/openrc/up
CN export TERM "linux"
foreground { /sbin/openrc boot }
/sbin/openrc default
m644
+/openrc/down
+CN export TERM "linux"
+ /sbin/openrc shutdown
+m644
+
/.scripts d m755
+
/sshd d m755
+/sshd/type cN longrun m644
/sshd/dependencies
CN ssh_host_ed25519_key
ssh_host_rsa_key
@@ -288,128 +460,36 @@ CN #!/command/execlineb -P
/usr/sbin/sshd -D -f /etc/ssh/sshd_config
m755
-/sshd/type cN longrun m644
+
/ssh_host_ed25519_key d m755
+/ssh_host_ed25519_key/type cN oneshot m644
/ssh_host_ed25519_key/dependencies
CN hostname
rootfs
m644
-/ssh_host_ed25519_key/type cN oneshot m644
/ssh_host_ed25519_key/up
CN if -n -t { s6-test -f /etc/ssh/ssh_host_ed25519_key }
ssh-keygen -N "" -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
m644
+
/ssh_host_rsa_key d m755
+/ssh_host_rsa_key/type cN oneshot m644
/ssh_host_rsa_key/dependencies
CN hostname
rootfs
m644
-/ssh_host_rsa_key/type cN oneshot m644
/ssh_host_rsa_key/up
CN if -n -t { s6-test -f /etc/ssh/ssh_host_rsa_key }
ssh-keygen -N "" -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key
m644
+
/swap d m755
-/swap/down cN swapoff -a m644
/swap/type cN oneshot m644
/swap/up cN swapon -a m644
-/tty1 d m755
-/tty1/dependencies cN ok-sysinit m644
-/tty1/finish
-CN #!/command/execlineb -P
- redirfd -w 1 /dev/tty1
- fdmove -c 2 1
- foreground { s6-echo "\nwaiting for session cleanup" }
- flock /run/ttylock/tty1 true
-m755
-/tty1/run
-CN #!/command/execlineb -P
- getpid SERVICE_PID
- foreground {
- importas -i SERVICE_PID SERVICE_PID
- if { test -d /run/cgroup2 }
- if { mkdir -p /run/cgroup2/s6-rc/tty1 }
- redirfd -w 1 /run/cgroup2/s6-rc/tty1/cgroup.procs
- printf "%s" ${SERVICE_PID}
- }
- unexport SERVICE_PID
-
- env LOGIN_TTY=/dev/tty1 /sbin/getty 38400 tty1 linux
-m755
-/tty1/type cN longrun m644
-/tty2 d m755
-/tty2/dependencies cN ok-sysinit m644
-/tty2/finish
-CN #!/command/execlineb -P
- redirfd -w 1 /dev/tty2
- fdmove -c 2 1
- foreground { s6-echo "\nwaiting for session cleanup" }
- flock /run/ttylock/tty2 true
-m755
-/tty2/run
-CN #!/command/execlineb -P
- getpid SERVICE_PID
- foreground {
- importas -i SERVICE_PID SERVICE_PID
- if { test -d /run/cgroup2 }
- if { mkdir -p /run/cgroup2/s6-rc/tty2 }
- redirfd -w 1 /run/cgroup2/s6-rc/tty2/cgroup.procs
- printf "%s" ${SERVICE_PID}
- }
- unexport SERVICE_PID
-
- env LOGIN_TTY=/dev/tty2 /sbin/getty 38400 tty2 linux
-m755
-/tty2/type cN longrun m644
-/tty3 d m755
-/tty3/dependencies cN ok-sysinit m644
-/tty3/finish
-CN #!/command/execlineb -P
- redirfd -w 1 /dev/tty3
- fdmove -c 2 1
- foreground { s6-echo "\nwaiting for session cleanup" }
- flock /run/ttylock/tty3 true
-m755
-/tty3/run
-CN #!/command/execlineb -P
- getpid SERVICE_PID
- foreground {
- importas -i SERVICE_PID SERVICE_PID
- if { test -d /run/cgroup2 }
- if { mkdir -p /run/cgroup2/s6-rc/tty3 }
- redirfd -w 1 /run/cgroup2/s6-rc/tty3/cgroup.procs
- printf "%s" ${SERVICE_PID}
- }
- unexport SERVICE_PID
-
- env LOGIN_TTY=/dev/tty3 /sbin/getty 38400 tty3 linux
-m755
-/tty3/type cN longrun m644
-/tty4 d m755
-/tty4/dependencies cN ok-sysinit m644
-/tty4/finish
-CN #!/command/execlineb -P
- redirfd -w 1 /dev/tty4
- fdmove -c 2 1
- foreground { s6-echo "\nwaiting for session cleanup" }
- flock /run/ttylock/tty4 true
-m755
-/tty4/run
-CN #!/command/execlineb -P
- getpid SERVICE_PID
- foreground {
- importas -i SERVICE_PID SERVICE_PID
- if { test -d /run/cgroup2 }
- if { mkdir -p /run/cgroup2/s6-rc/tty4 }
- redirfd -w 1 /run/cgroup2/s6-rc/tty4/cgroup.procs
- printf "%s" ${SERVICE_PID}
- }
- unexport SERVICE_PID
-
- env LOGIN_TTY=/dev/tty4 /sbin/getty 38400 tty4 linux
-m755
-/tty4/type cN longrun m644
+/swap/down cN swapoff -a m644
+
/unbound d m755
+/unbound/type cN longrun m644
/unbound/dependencies
CN loopback
ok-mount
@@ -429,4 +509,3 @@ CN #!/command/execlineb -P
unbound -d
m755
-/unbound/type cN longrun m644