summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb')
-rw-r--r--meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb58
1 files changed, 15 insertions, 43 deletions
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
index d95d1a63f5..c77266e71e 100644
--- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -1,13 +1,11 @@
1SUMMARY = "Inittab configuration for SysVinit" 1SUMMARY = "Inittab configuration for SysVinit"
2LICENSE = "GPLv2" 2LICENSE = "GPL-2.0-only"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" 3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
4 4
5PR = "r10"
6
7SRC_URI = "file://inittab \ 5SRC_URI = "file://inittab \
8 file://start_getty" 6 file://start_getty"
9 7
10S = "${WORKDIR}" 8S = "${UNPACKDIR}"
11 9
12INHIBIT_DEFAULT_DEPS = "1" 10INHIBIT_DEFAULT_DEPS = "1"
13 11
@@ -17,19 +15,19 @@ do_compile() {
17 15
18do_install() { 16do_install() {
19 install -d ${D}${sysconfdir} 17 install -d ${D}${sysconfdir}
20 install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab 18 install -m 0644 ${S}/inittab ${D}${sysconfdir}/inittab
21 install -d ${D}${base_bindir} 19 install -d ${D}${base_bindir}
22 install -m 0755 ${WORKDIR}/start_getty ${D}${base_bindir}/start_getty 20 install -m 0755 ${S}/start_getty ${D}${base_bindir}/start_getty
23 sed -e 's,/usr/bin,${bindir},g' -i ${D}${base_bindir}/start_getty 21 sed -e 's,/usr/bin,${bindir},g' -i ${D}${base_bindir}/start_getty
24 22
25 set -x 23 CONSOLES="${SERIAL_CONSOLES}"
26 tmp="${SERIAL_CONSOLES}" 24 for s in $CONSOLES
27 for i in $tmp
28 do 25 do
29 j=`echo ${i} | sed s/\;/\ /g` 26 speed=$(echo $s | cut -d\; -f 1)
30 l=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'` 27 device=$(echo $s | cut -d\; -f 2)
31 label=`echo $l | sed 's/.*\(....\)/\1/'` 28 label=$(echo $device | sed -e 's/tty//' | tail --bytes=5)
32 echo "$label:12345:respawn:${base_bindir}/start_getty ${j} vt102" >> ${D}${sysconfdir}/inittab 29
30 echo "$label:12345:respawn:${sbindir}/ttyrun $device ${base_bindir}/start_getty $speed $device vt102" >> ${D}${sysconfdir}/inittab
33 done 31 done
34 32
35 if [ "${USE_VT}" = "1" ]; then 33 if [ "${USE_VT}" = "1" ]; then
@@ -53,41 +51,15 @@ EOF
53 fi 51 fi
54} 52}
55 53
56pkg_postinst_${PN} () {
57# run this on host and on target
58if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
59 exit 0
60fi
61}
62
63pkg_postinst_ontarget_${PN} () {
64# run this on the target
65if [ -e /proc/consoles ]; then
66 tmp="${SERIAL_CONSOLES_CHECK}"
67 for i in $tmp
68 do
69 j=`echo ${i} | sed -e s/^.*\;//g -e s/\:.*//g`
70 k=`echo ${i} | sed s/^.*\://g`
71 if [ -z "`grep ${j} /proc/consoles`" ]; then
72 if [ -z "${k}" ] || [ -z "`grep ${k} /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
73 sed -i -e /^.*${j}\ /d -e /^.*${j}$/d /etc/inittab
74 fi
75 fi
76 done
77 kill -HUP 1
78else
79 exit 1
80fi
81}
82
83# USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf. 54# USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf.
84# Set PACKAGE_ARCH appropriately. 55# Set PACKAGE_ARCH appropriately.
85PACKAGE_ARCH = "${MACHINE_ARCH}" 56PACKAGE_ARCH = "${MACHINE_ARCH}"
86 57
87FILES_${PN} = "${sysconfdir}/inittab ${base_bindir}/start_getty" 58FILES:${PN} = "${sysconfdir}/inittab ${base_bindir}/start_getty"
88CONFFILES_${PN} = "${sysconfdir}/inittab" 59CONFFILES:${PN} = "${sysconfdir}/inittab"
89 60
90USE_VT ?= "1" 61USE_VT ?= "1"
91SYSVINIT_ENABLED_GETTYS ?= "1" 62SYSVINIT_ENABLED_GETTYS ?= "1"
92 63
93RCONFLICTS_${PN} = "busybox-inittab" 64RDEPENDS:${PN} = "ttyrun"
65RCONFLICTS:${PN} = "busybox-inittab"