summaryrefslogtreecommitdiff
path: root/system/gettys-openrc/gettys.initd
diff options
context:
space:
mode:
authorLaurent Bercot <ska-adelie@skarnet.org>2019-10-03 10:31:29 -0500
committerLaurent Bercot <ska-adelie@skarnet.org>2019-10-03 10:31:29 -0500
commit2c782daf6fae1b418168a5e8a9336fe9e6b9215e (patch)
tree8b749945bc1d8baca29d60e573ceadbab69e8c6f /system/gettys-openrc/gettys.initd
parent7fabe3e35d27fd34b780d135ac09b846a4083257 (diff)
downloadpackages-2c782daf6fae1b418168a5e8a9336fe9e6b9215e.tar.gz
packages-2c782daf6fae1b418168a5e8a9336fe9e6b9215e.tar.bz2
packages-2c782daf6fae1b418168a5e8a9336fe9e6b9215e.tar.xz
packages-2c782daf6fae1b418168a5e8a9336fe9e6b9215e.zip
system/s6-linux-init: make early getty configurable. PLEASE REVIEW.
Also touches gettys-openrc to avoid spawning the same getty twice.
Diffstat (limited to 'system/gettys-openrc/gettys.initd')
-rw-r--r--system/gettys-openrc/gettys.initd26
1 files changed, 15 insertions, 11 deletions
diff --git a/system/gettys-openrc/gettys.initd b/system/gettys-openrc/gettys.initd
index a1fbb2082..1f02d29f4 100644
--- a/system/gettys-openrc/gettys.initd
+++ b/system/gettys-openrc/gettys.initd
@@ -11,14 +11,11 @@ makeservice() {
tty="$1"
eval 'options="$GETTYS_'"$tty"'_OPTIONS"'
eval 'baud="$GETTYS_'"$tty"'_BAUDRATE"'
- if test -z "$baud" ; then
- baud=38400
- fi
mkdir -p -m 0755 "/var/lib/s6/services/getty-$tty"
{
echo '#!/bin/execlineb -P'
echo
- echo "/sbin/agetty $options -- $baud $tty linux"
+ echo "/sbin/agetty $options -- $tty $baud"
} > "/var/lib/s6/services/getty-$tty/run"
chmod 0755 "/var/lib/s6/services/getty-$tty/run"
}
@@ -32,6 +29,17 @@ nomatchname() {
return 0
}
+notearly() {
+ if test -d /etc/s6-linux-init/current/run-image/service/s6-linux-init-early-getty ; then
+ if early=`head -n 1 /run/kernel_env/earlygetty` ; then
+ early="${early%%,*}"
+ else
+ early=tty2
+ fi
+ test "$1" != "$early"
+ fi
+}
+
start() {
set -e
ebegin "Applying getty configuration"
@@ -46,13 +54,9 @@ start() {
done
for i in $GETTYS ; do
- if test -c /dev/"$i" ; then
- if test -d "/etc/s6-linux-init/current/run-image/service/getty-$i" ; then
- :
- else
- makeservice "$i"
- ln -nsf "/var/lib/s6/services/getty-$i" "/run/service/getty-$i"
- fi
+ if test -c /dev/"$i" && notearly "$i" ; then
+ makeservice "$i"
+ ln -nsf "/var/lib/s6/services/getty-$i" "/run/service/getty-$i"
fi
done