commit 6d76fae9c7194c89886ac6aa2566877927e6247a parent 292383b558890c598e71211884c6c1f5de867350 Author: root <root@dorje.v103.te2000> Date: Wed, 13 Jul 2022 15:28:01 +0000 Disable console-log-tail before spawning ttys Diffstat:
M | install | | | 24 | +++++++++++++++--------- |
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/install b/install @@ -30,8 +30,8 @@ qc=$q_package/command # Rewrite dynamically generated scripts "$cmd/s6-cat" >"$dst/init/scripts/rc.init" <<EOF || exit $? #!$sm_dst_package/command/execlineb -S1 -export TERM "linux" -if { $qc/s6-rc-init -d -c $q_all/s6-rc-db /run/service } +$qc/export TERM "linux" +$qc/if { $qc/s6-rc-init -d -c $q_all/s6-rc-db /run/service } $q_all/init/scripts/runlevel \$1 EOF @@ -45,23 +45,29 @@ export TERM "linux" # Call it twice because the first time may spuriously "timeout" # due to the clock jumping forward. -ifelse -X { +$qc/ifelse -X { $qc/s6-rc -v 2 -t 600000 -- change ok-all-but-tty } { # no timeout, start ttys properly + $qc/s6-echo "System started normally (bundle ok-all-but-tty)" + $qc/foreground { sleep 0.1 } + $qc/foreground { $qc/s6-svc -d /run/service/console-log-tail } $qc/s6-rc -v 2 -t 600000 -- change ok-all } +$qc/s6-echo "System startup failure: retry" # try again without tty and then with -foreground { $qc/s6-rc -v 2 -t 600000 -- change ok-all-but-tty } +$qc/foreground { $qc/s6-rc -v 2 -t 600000 -- change ok-all-but-tty } +$qc/foreground { sleep 0.1 } +$qc/foreground { $qc/s6-svc -d /run/service/console-log-tail } $qc/s6-rc -v 2 -t 600000 -- change ok-all EOF "$cmd/s6-mkdir" "$dst/init/init/run-image/service/console-log-tail" || exit $? "$cmd/s6-cat" >"$dst/init/init/run-image/service/console-log-tail/run" <<EOF || exit $? -#!$qc/execlineb -P -redirfd -w 1 /dev/console -fdmove -c 2 1 -pipeline -w { s6-tai64nlocal } +#!$sm_dst_package/command/execlineb -P +$qc/redirfd -w 1 /dev/console +$qc/fdmove -c 2 1 +$qc/pipeline -w { s6-tai64nlocal } tail -F /run/uncaught-logs/current EOF -"$cmd/s6-chmod" +x >"$dst/init/init/run-image/service/console-log-tail/run" exit $? +"$cmd/s6-chmod" +x "$dst/init/init/run-image/service/console-log-tail/run" exit $?