summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-12-13 22:01:26 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-18 22:52:24 +0000
commit105cece2259e0d3b9be44c9bb14d4f98953504ed (patch)
tree6683602ef9771dcd86043985afbfcea02012fa3e /meta/recipes-core/busybox
parent51ef6bbbd96489596d82d967078de78a40ae2fc0 (diff)
downloadpoky-105cece2259e0d3b9be44c9bb14d4f98953504ed.tar.gz
busybox-inittab: Implement SYSVINIT_ENABLED_GETTYS and USE_VT
This ensures that busybox init can generate matching tty's in inittab as system defines, secondly resepcts USE_VT for creating virtual ttys (From OE-Core rev: 7dddda7a00108f9a61da4a869514a32b9f42d16a) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/busybox')
-rw-r--r--meta/recipes-core/busybox/busybox-inittab_1.32.0.bb50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox-inittab_1.32.0.bb b/meta/recipes-core/busybox/busybox-inittab_1.32.0.bb
index 61fb8cbad1..8d0f419f4d 100644
--- a/meta/recipes-core/busybox/busybox-inittab_1.32.0.bb
+++ b/meta/recipes-core/busybox/busybox-inittab_1.32.0.bb
@@ -23,6 +23,53 @@ do_install() {
23 id=`echo ${i} | sed -e 's/^.*;//' -e 's/;.*//'` 23 id=`echo ${i} | sed -e 's/^.*;//' -e 's/;.*//'`
24 echo "$id::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab 24 echo "$id::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
25 done 25 done
26 if [ "${USE_VT}" = "1" ]; then
27 cat <<EOF >>${D}${sysconfdir}/inittab
28# ${base_sbindir}/getty invocations for the runlevels.
29#
30# The "id" field MUST be the same as the last
31# characters of the device (after "tty").
32#
33# Format:
34# <id>:<runlevels>:<action>:<process>
35#
36
37EOF
38
39 for n in ${SYSVINIT_ENABLED_GETTYS}
40 do
41 echo "tty$n:12345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
42 done
43 echo "" >> ${D}${sysconfdir}/inittab
44 fi
45
46}
47
48pkg_postinst_${PN} () {
49# run this on host and on target
50if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
51 exit 0
52fi
53}
54
55pkg_postinst_ontarget_${PN} () {
56# run this on the target
57if [ -e /proc/consoles ]; then
58 tmp="${SERIAL_CONSOLES_CHECK}"
59 for i in $tmp
60 do
61 j=`echo ${i} | sed -e s/^.*\;//g -e s/\:.*//g`
62 k=`echo ${i} | sed s/^.*\://g`
63 if [ -z "`grep ${j} /proc/consoles`" ]; then
64 if [ -z "${k}" ] || [ -z "`grep ${k} /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
65 sed -i -e /^.*${j}\ /d -e /^.*${j}$/d /etc/inittab
66 fi
67 fi
68 done
69 kill -HUP 1
70else
71 exit 1
72fi
26} 73}
27 74
28# SERIAL_CONSOLES is generally defined by the MACHINE .conf. 75# SERIAL_CONSOLES is generally defined by the MACHINE .conf.
@@ -33,3 +80,6 @@ FILES_${PN} = "${sysconfdir}/inittab"
33CONFFILES_${PN} = "${sysconfdir}/inittab" 80CONFFILES_${PN} = "${sysconfdir}/inittab"
34 81
35RCONFLICTS_${PN} = "sysvinit-inittab" 82RCONFLICTS_${PN} = "sysvinit-inittab"
83
84USE_VT ?= "1"
85SYSVINIT_ENABLED_GETTYS ?= "1"