diff options
Diffstat (limited to 'meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb')
-rw-r--r-- | meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | 58 |
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 @@ | |||
1 | SUMMARY = "Inittab configuration for SysVinit" | 1 | SUMMARY = "Inittab configuration for SysVinit" |
2 | LICENSE = "GPLv2" | 2 | LICENSE = "GPL-2.0-only" |
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" | 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" |
4 | 4 | ||
5 | PR = "r10" | ||
6 | |||
7 | SRC_URI = "file://inittab \ | 5 | SRC_URI = "file://inittab \ |
8 | file://start_getty" | 6 | file://start_getty" |
9 | 7 | ||
10 | S = "${WORKDIR}" | 8 | S = "${UNPACKDIR}" |
11 | 9 | ||
12 | INHIBIT_DEFAULT_DEPS = "1" | 10 | INHIBIT_DEFAULT_DEPS = "1" |
13 | 11 | ||
@@ -17,19 +15,19 @@ do_compile() { | |||
17 | 15 | ||
18 | do_install() { | 16 | do_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 | ||
56 | pkg_postinst_${PN} () { | ||
57 | # run this on host and on target | ||
58 | if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then | ||
59 | exit 0 | ||
60 | fi | ||
61 | } | ||
62 | |||
63 | pkg_postinst_ontarget_${PN} () { | ||
64 | # run this on the target | ||
65 | if [ -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 | ||
78 | else | ||
79 | exit 1 | ||
80 | fi | ||
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. |
85 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 56 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
86 | 57 | ||
87 | FILES_${PN} = "${sysconfdir}/inittab ${base_bindir}/start_getty" | 58 | FILES:${PN} = "${sysconfdir}/inittab ${base_bindir}/start_getty" |
88 | CONFFILES_${PN} = "${sysconfdir}/inittab" | 59 | CONFFILES:${PN} = "${sysconfdir}/inittab" |
89 | 60 | ||
90 | USE_VT ?= "1" | 61 | USE_VT ?= "1" |
91 | SYSVINIT_ENABLED_GETTYS ?= "1" | 62 | SYSVINIT_ENABLED_GETTYS ?= "1" |
92 | 63 | ||
93 | RCONFLICTS_${PN} = "busybox-inittab" | 64 | RDEPENDS:${PN} = "ttyrun" |
65 | RCONFLICTS:${PN} = "busybox-inittab" | ||