mirror of
https://git.yoctoproject.org/poky
synced 2026-04-30 12:32:12 +02:00
Set SERIAL_CONSOLES if you want to define multiple serial consoles, also if
you need to check for the presence of the serial consoles you can also define
SERIAL_CONSOLES_CHECK to determine if these are present when you boot. This
will prevent error message that pop up when the serial port is not present.
SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1 115200;ttyEHV0"
SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
The above lines in machine.conf or elsewhere will have the effect of having
two serial consoles and removing any that are not present at boot
(From OE-Core rev: 2e7dddfce4a40a56f671116a2001b13c57667c70)
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
84 lines
1.8 KiB
BlitzBasic
84 lines
1.8 KiB
BlitzBasic
DESCRIPTION = "Inittab for sysvinit"
|
|
LICENSE = "GPLv2"
|
|
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
|
|
|
|
PR = "r7"
|
|
|
|
SRC_URI = "file://inittab"
|
|
|
|
S = "${WORKDIR}/sysvinit-${PV}"
|
|
|
|
INHIBIT_DEFAULT_DEPS = "1"
|
|
|
|
do_compile() {
|
|
:
|
|
}
|
|
|
|
do_install() {
|
|
install -d ${D}${sysconfdir}
|
|
install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
|
|
if [ ! -z "${SERIAL_CONSOLE}" ]; then
|
|
echo "S:2345:respawn:${base_sbindir}/getty ${SERIAL_CONSOLE}" >> ${D}${sysconfdir}/inittab
|
|
fi
|
|
|
|
idx=0
|
|
tmp="${SERIAL_CONSOLES}"
|
|
for i in $tmp
|
|
do
|
|
j=`echo ${i} | sed s/\;/\ /g`
|
|
echo "${idx}:12345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
|
|
|
|
idx=`expr $idx + 1`
|
|
done
|
|
|
|
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
|
|
echo "$n:2345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
|
|
done
|
|
echo "" >> ${D}${sysconfdir}/inittab
|
|
fi
|
|
}
|
|
|
|
pkg_postinst_${PN} () {
|
|
# run this on the target
|
|
if [ "x$D" == "x" ]; then
|
|
tmp="${SERIAL_CONSOLES_CHECK}"
|
|
for i in $tmp
|
|
do
|
|
j=`echo ${i} | sed s/^.*\;//g`
|
|
if [ -z "`cat /proc/consoles | grep ${j}`" ]; then
|
|
sed -i /^.*${j}$/d /etc/inittab
|
|
fi
|
|
done
|
|
kill -HUP 1
|
|
else
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
# USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
|
|
# Set PACKAGE_ARCH appropriately.
|
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
|
|
|
FILES_${PN} = "${sysconfdir}/inittab"
|
|
CONFFILES_${PN} = "${sysconfdir}/inittab"
|
|
|
|
USE_VT ?= "1"
|
|
SYSVINIT_ENABLED_GETTYS ?= "1"
|
|
|
|
|
|
|