diff options
author | André Draszik <andre.draszik@jci.com> | 2019-02-11 11:21:06 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-12 14:04:30 +0000 |
commit | 2e608fd1b70f00d92028688df1efa948d318292c (patch) | |
tree | 923b07b46bf6bf5a44e16d15a5a941e9c1ba3bda /meta | |
parent | be52da152a4d9f9e798844f592ec9ae7e051c658 (diff) | |
download | poky-2e608fd1b70f00d92028688df1efa948d318292c.tar.gz |
sysvinit-inittab: support non-busybox-getty on serial consoles
Busybox' getty has code to try to make itself a session leader,
whereas util-linux' agetty doesn't. It expects this to happen
from outside.
When getty is not a session leader, many things don't work on
the serial console, e.g. setting the terminal process group,
job control doesn't work, etc.
Executing image tests also fails with AssertionErrors, because
Feb 5 16:12:55 qemuarm getty[590]: /dev/ttyAMA1: cannot get controlling tty: Operation not permitted
Feb 5 16:12:55 qemuarm getty[590]: /dev/ttyAMA1: cannot set process group: Inappropriate ioctl for device
Update the start_getty script to invoke getty via the setsid
utility if needed, i.e. if /sbin/getty is not busybox getty.
[YOCTO #13058]
(From OE-Core rev: 37be77565d323fc543427ad47399996119f59ab1)
Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-core/sysvinit/sysvinit-inittab/start_getty | 14 | ||||
-rw-r--r-- | meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | 1 |
2 files changed, 14 insertions, 1 deletions
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty index e15ae35f90..96fd6cfcfd 100644 --- a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty +++ b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty | |||
@@ -13,6 +13,18 @@ active_serial=$(grep "serial" /proc/tty/drivers | cut -d/ -f1 | sed "s/ *$//") | |||
13 | # Rephrase input parameter from ttyS target index (ttyS1, ttyS2, ttyAMA0, etc). | 13 | # Rephrase input parameter from ttyS target index (ttyS1, ttyS2, ttyAMA0, etc). |
14 | runtime_tty=$(echo $2 | grep -oh '[0-9]') | 14 | runtime_tty=$(echo $2 | grep -oh '[0-9]') |
15 | 15 | ||
16 | # busybox' getty does this itself, util-linux' agetty needs extra help | ||
17 | getty="/sbin/getty" | ||
18 | case $(readlink -f "${getty}") in | ||
19 | */busybox*) | ||
20 | ;; | ||
21 | *) | ||
22 | if [ -x "/usr/bin/setsid" ] ; then | ||
23 | setsid="/usr/bin/setsid" | ||
24 | fi | ||
25 | ;; | ||
26 | esac | ||
27 | |||
16 | # Backup $IFS. | 28 | # Backup $IFS. |
17 | DEFAULT_IFS=$IFS | 29 | DEFAULT_IFS=$IFS |
18 | # Customize Internal Field Separator. | 30 | # Customize Internal Field Separator. |
@@ -31,7 +43,7 @@ for line in $active_serial; do | |||
31 | then | 43 | then |
32 | if [ -c /dev/$2 ] | 44 | if [ -c /dev/$2 ] |
33 | then | 45 | then |
34 | /sbin/getty -L $1 $2 $3 | 46 | ${setsid:-} ${getty} -L $1 $2 $3 |
35 | fi | 47 | fi |
36 | break | 48 | break |
37 | fi | 49 | fi |
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb index 8585a418ab..bfd890d924 100644 --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | |||
@@ -20,6 +20,7 @@ do_install() { | |||
20 | install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab | 20 | install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab |
21 | install -d ${D}${base_bindir} | 21 | install -d ${D}${base_bindir} |
22 | install -m 0755 ${WORKDIR}/start_getty ${D}${base_bindir}/start_getty | 22 | install -m 0755 ${WORKDIR}/start_getty ${D}${base_bindir}/start_getty |
23 | sed -e 's,/usr/bin,${bindir},g' -i ${D}${base_bindir}/start_getty | ||
23 | 24 | ||
24 | set -x | 25 | set -x |
25 | tmp="${SERIAL_CONSOLES}" | 26 | tmp="${SERIAL_CONSOLES}" |