1SUMMARY = "Inittab configuration for SysVinit" 2LICENSE = "GPLv2" 3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" 4 5PR = "r10" 6 7SRC_URI = "file://inittab \ 8 file://start_getty" 9 10S = "${WORKDIR}" 11 12INHIBIT_DEFAULT_DEPS = "1" 13 14do_compile() { 15 : 16} 17 18do_install() { 19 install -d ${D}${sysconfdir} 20 install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab 21 install -d ${D}${base_bindir} 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 24 25 set -x 26 tmp="${SERIAL_CONSOLES}" 27 for i in $tmp 28 do 29 j=`echo ${i} | sed s/\;/\ /g` 30 l=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'` 31 label=`echo $l | sed 's/.*\(....\)/\1/'` 32 echo "$label:12345:respawn:${base_bindir}/start_getty ${j} vt102" >> ${D}${sysconfdir}/inittab 33 done 34 35 if [ "${USE_VT}" = "1" ]; then 36 cat <<EOF >>${D}${sysconfdir}/inittab 37# ${base_sbindir}/getty invocations for the runlevels. 38# 39# The "id" field MUST be the same as the last 40# characters of the device (after "tty"). 41# 42# Format: 43# <id>:<runlevels>:<action>:<process> 44# 45 46EOF 47 48 for n in ${SYSVINIT_ENABLED_GETTYS} 49 do 50 echo "$n:12345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab 51 done 52 echo "" >> ${D}${sysconfdir}/inittab 53 fi 54} 55 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. 84# Set PACKAGE_ARCH appropriately. 85PACKAGE_ARCH = "${MACHINE_ARCH}" 86 87FILES:${PN} = "${sysconfdir}/inittab ${base_bindir}/start_getty" 88CONFFILES:${PN} = "${sysconfdir}/inittab" 89 90USE_VT ?= "1" 91SYSVINIT_ENABLED_GETTYS ?= "1" 92 93RCONFLICTS:${PN} = "busybox-inittab" 94