2013-12-19 15:13:01 +00:00
|
|
|
SUMMARY = "Inittab configuration for SysVinit"
|
2011-06-09 08:16:49 +00:00
|
|
|
LICENSE = "GPLv2"
|
2012-03-20 02:36:11 +00:00
|
|
|
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
|
2011-06-09 08:16:49 +00:00
|
|
|
|
2014-03-05 17:17:18 +00:00
|
|
|
PR = "r10"
|
2011-06-09 08:16:49 +00:00
|
|
|
|
2012-03-20 02:36:11 +00:00
|
|
|
SRC_URI = "file://inittab"
|
2011-06-09 08:16:49 +00:00
|
|
|
|
2015-01-06 21:29:04 +00:00
|
|
|
S = "${WORKDIR}"
|
2011-06-09 08:16:49 +00:00
|
|
|
|
2011-06-10 08:12:26 +00:00
|
|
|
INHIBIT_DEFAULT_DEPS = "1"
|
|
|
|
|
2011-06-09 08:16:49 +00:00
|
|
|
do_compile() {
|
|
|
|
:
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
|
|
|
install -d ${D}${sysconfdir}
|
|
|
|
install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
|
2011-11-04 21:07:52 +00:00
|
|
|
|
|
|
|
tmp="${SERIAL_CONSOLES}"
|
|
|
|
for i in $tmp
|
|
|
|
do
|
|
|
|
j=`echo ${i} | sed s/\;/\ /g`
|
2013-10-07 15:05:04 +00:00
|
|
|
label=`echo ${i} | sed -e 's/^.*;tty//' -e 's/;.*//'`
|
2014-11-12 10:33:25 +00:00
|
|
|
echo "$label:12345:respawn:${base_sbindir}/getty -L ${j}" >> ${D}${sysconfdir}/inittab
|
2011-11-04 21:07:52 +00:00
|
|
|
done
|
|
|
|
|
2011-06-09 08:16:49 +00:00
|
|
|
if [ "${USE_VT}" = "1" ]; then
|
|
|
|
cat <<EOF >>${D}${sysconfdir}/inittab
|
|
|
|
# ${base_sbindir}/getty invocations for the runlevels.
|
|
|
|
#
|
|
|
|
# The "id" field MUST be the same as the last
|
|
|
|
# characters of the device (after "tty").
|
|
|
|
#
|
|
|
|
# Format:
|
|
|
|
# <id>:<runlevels>:<action>:<process>
|
|
|
|
#
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
for n in ${SYSVINIT_ENABLED_GETTYS}
|
|
|
|
do
|
2015-03-19 13:45:48 +00:00
|
|
|
echo "$n:12345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
|
2011-06-09 08:16:49 +00:00
|
|
|
done
|
|
|
|
echo "" >> ${D}${sysconfdir}/inittab
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2012-07-11 23:15:27 +00:00
|
|
|
pkg_postinst_${PN} () {
|
|
|
|
# run this on the target
|
2012-09-26 07:18:37 +00:00
|
|
|
if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
|
2012-07-11 23:15:27 +00:00
|
|
|
tmp="${SERIAL_CONSOLES_CHECK}"
|
|
|
|
for i in $tmp
|
|
|
|
do
|
|
|
|
j=`echo ${i} | sed s/^.*\;//g`
|
2014-05-06 12:17:51 +00:00
|
|
|
if [ -z "`grep ${j} /proc/consoles`" ]; then
|
2012-07-11 23:15:27 +00:00
|
|
|
sed -i /^.*${j}$/d /etc/inittab
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
kill -HUP 1
|
|
|
|
else
|
2012-09-11 17:56:53 +00:00
|
|
|
if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2012-07-11 23:15:27 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2013-04-30 14:31:00 +00:00
|
|
|
# USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf.
|
2011-06-09 08:16:49 +00:00
|
|
|
# Set PACKAGE_ARCH appropriately.
|
|
|
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
|
|
|
|
|
|
|
FILES_${PN} = "${sysconfdir}/inittab"
|
|
|
|
CONFFILES_${PN} = "${sysconfdir}/inittab"
|
|
|
|
|
|
|
|
USE_VT ?= "1"
|
|
|
|
SYSVINIT_ENABLED_GETTYS ?= "1"
|
|
|
|
|
|
|
|
|
|
|
|
|