summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-core/busybox/busybox-inittab_1.36.1.bb46
1 files changed, 12 insertions, 34 deletions
diff --git a/meta/recipes-core/busybox/busybox-inittab_1.36.1.bb b/meta/recipes-core/busybox/busybox-inittab_1.36.1.bb
index 868d7a230f..462c9bb9c5 100644
--- a/meta/recipes-core/busybox/busybox-inittab_1.36.1.bb
+++ b/meta/recipes-core/busybox/busybox-inittab_1.36.1.bb
@@ -15,14 +15,17 @@ do_compile() {
15do_install() { 15do_install() {
16 install -d ${D}${sysconfdir} 16 install -d ${D}${sysconfdir}
17 install -D -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab 17 install -D -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
18 tmp="${SERIAL_CONSOLES}" 18
19 [ -n "$tmp" ] && echo >> ${D}${sysconfdir}/inittab 19 CONSOLES="${SERIAL_CONSOLES}"
20 for i in $tmp 20 for s in $CONSOLES
21 do 21 do
22 j=`echo ${i} | sed s/\;/\ /g` 22 speed=$(echo $s | cut -d\; -f 1)
23 id=`echo ${i} | sed -e 's/^.*;//' -e 's/;.*//'` 23 device=$(echo $s | cut -d\; -f 2)
24 echo "$id::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab 24 label=$(echo $device | sed -e 's/tty//' | tail --bytes=5)
25 done 25
26 echo "$label::respawn:${sbindir}/ttyrun $device ${base_bindir}/start_getty $speed $device vt102" >> ${D}${sysconfdir}/inittab
27 done
28
26 if [ "${USE_VT}" = "1" ]; then 29 if [ "${USE_VT}" = "1" ]; then
27 cat <<EOF >>${D}${sysconfdir}/inittab 30 cat <<EOF >>${D}${sysconfdir}/inittab
28# ${base_sbindir}/getty invocations for the runlevels. 31# ${base_sbindir}/getty invocations for the runlevels.
@@ -45,32 +48,6 @@ EOF
45 48
46} 49}
47 50
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
73}
74 51
75# SERIAL_CONSOLES is generally defined by the MACHINE .conf. 52# SERIAL_CONSOLES is generally defined by the MACHINE .conf.
76# Set PACKAGE_ARCH appropriately. 53# Set PACKAGE_ARCH appropriately.
@@ -79,6 +56,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
79FILES:${PN} = "${sysconfdir}/inittab" 56FILES:${PN} = "${sysconfdir}/inittab"
80CONFFILES:${PN} = "${sysconfdir}/inittab" 57CONFFILES:${PN} = "${sysconfdir}/inittab"
81 58
59RDEPENDS:${PN} = "ttyrun"
82RCONFLICTS:${PN} = "sysvinit-inittab" 60RCONFLICTS:${PN} = "sysvinit-inittab"
83 61
84USE_VT ?= "1" 62USE_VT ?= "1"