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_2.88dsf.bb | |
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_2.88dsf.bb')
-rw-r--r-- | meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb index e70dc705c0..6bbe517df1 100644 --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | |||
@@ -28,7 +28,7 @@ do_install() { | |||
28 | device=$(echo $s | cut -d\; -f 2) | 28 | device=$(echo $s | cut -d\; -f 2) |
29 | label=$(echo $device | sed -e 's/tty//' | tail --bytes=5) | 29 | label=$(echo $device | sed -e 's/tty//' | tail --bytes=5) |
30 | 30 | ||
31 | echo "$label:12345:respawn:${base_bindir}/start_getty $speed $device vt102" >> ${D}${sysconfdir}/inittab | 31 | echo "$label:12345:respawn:${sbindir}/ttyrun $device ${base_bindir}/start_getty $speed $device vt102" >> ${D}${sysconfdir}/inittab |
32 | done | 32 | done |
33 | 33 | ||
34 | if [ "${USE_VT}" = "1" ]; then | 34 | if [ "${USE_VT}" = "1" ]; then |
@@ -52,33 +52,6 @@ EOF | |||
52 | fi | 52 | fi |
53 | } | 53 | } |
54 | 54 | ||
55 | pkg_postinst:${PN} () { | ||
56 | # run this on host and on target | ||
57 | if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then | ||
58 | exit 0 | ||
59 | fi | ||
60 | } | ||
61 | |||
62 | pkg_postinst_ontarget:${PN} () { | ||
63 | # run this on the target | ||
64 | if [ -e /proc/consoles ]; then | ||
65 | tmp="${SERIAL_CONSOLES_CHECK}" | ||
66 | for i in $tmp | ||
67 | do | ||
68 | j=`echo ${i} | sed -e s/^.*\;//g -e s/\:.*//g` | ||
69 | k=`echo ${i} | sed s/^.*\://g` | ||
70 | if [ -z "`grep ${j} /proc/consoles`" ]; then | ||
71 | if [ -z "${k}" ] || [ -z "`grep ${k} /proc/consoles`" ] || [ ! -e /dev/${j} ]; then | ||
72 | sed -i -e /^.*${j}\ /d -e /^.*${j}$/d /etc/inittab | ||
73 | fi | ||
74 | fi | ||
75 | done | ||
76 | kill -HUP 1 | ||
77 | else | ||
78 | exit 1 | ||
79 | fi | ||
80 | } | ||
81 | |||
82 | # USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf. | 55 | # USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf. |
83 | # Set PACKAGE_ARCH appropriately. | 56 | # Set PACKAGE_ARCH appropriately. |
84 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 57 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
@@ -89,4 +62,5 @@ CONFFILES:${PN} = "${sysconfdir}/inittab" | |||
89 | USE_VT ?= "1" | 62 | USE_VT ?= "1" |
90 | SYSVINIT_ENABLED_GETTYS ?= "1" | 63 | SYSVINIT_ENABLED_GETTYS ?= "1" |
91 | 64 | ||
65 | RDEPENDS:${PN} = "ttyrun" | ||
92 | RCONFLICTS:${PN} = "busybox-inittab" | 66 | RCONFLICTS:${PN} = "busybox-inittab" |