diff options
author | Ross Burton <ross.burton@arm.com> | 2023-10-06 12:22:00 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-09 15:51:13 +0100 |
commit | 42d35e89a343eb28d85f8c4ab4da486bed8ae160 (patch) | |
tree | 8db3044283ac2e941d0a479dddd9d7ce44d4e611 /meta/recipes-core/sysvinit/sysvinit-inittab | |
parent | b3fa551d64d94baf9dd9e56d7e42d20e0819cd0b (diff) | |
download | poky-42d35e89a343eb28d85f8c4ab4da486bed8ae160.tar.gz |
sysvinit-inittab: use ttyrun to run getty only if the terminal exists
Wrap calls to start_getty with ttyrun, so that getty isn't started if
the device doesn't exist. As we know start_getty is only called when
the device exists we can remove the partial workaround for this problem
in that scripts too.
This neatly obsoletes SERIAL_CONSOLES_CHECK, whose sole purpose was to
check what terminals are present at boot and rewrite inittab. Notably,
this meant that SERIAL_CONSOLES_CHECK made using a read-only rootfs
impossible.
(From OE-Core rev: f4fd17d5a5e4eaa31995d3ca52c871cfbdc0df68)
(From OE-Core rev: 8e48297621311116d3edd7e3aa0de1b8ef2431b1)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/sysvinit/sysvinit-inittab')
-rw-r--r-- | meta/recipes-core/sysvinit/sysvinit-inittab/start_getty | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty index f60409eae3..f5671ee53d 100644 --- a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty +++ b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty | |||
@@ -1,5 +1,9 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | SPEED=$1 | ||
4 | DEVICE=$2 | ||
5 | TERM=$3 | ||
6 | |||
3 | # busybox' getty does this itself, util-linux' agetty needs extra help | 7 | # busybox' getty does this itself, util-linux' agetty needs extra help |
4 | getty="/sbin/getty" | 8 | getty="/sbin/getty" |
5 | case $(readlink -f "${getty}") in | 9 | case $(readlink -f "${getty}") in |
@@ -13,9 +17,4 @@ case $(readlink -f "${getty}") in | |||
13 | ;; | 17 | ;; |
14 | esac | 18 | esac |
15 | 19 | ||
16 | if [ -e /sys/class/tty/$2 -a -c /dev/$2 ]; then | 20 | ${setsid:-} ${getty} ${options:-} -L $SPEED $DEVICE $TERM |
17 | ${setsid:-} ${getty} ${options:-} -L $1 $2 $3 | ||
18 | else | ||
19 | # Prevent respawning to fast error if /dev entry does not exist | ||
20 | sleep 1000 | ||
21 | fi | ||