* [PATCH] sysvinit-inittab_2.88dsf.bb: Allow multiple serial port consoles to be defined
@ 2012-07-11 23:15 Matthew McClintock
2012-07-17 16:15 ` Saul Wold
0 siblings, 1 reply; 2+ messages in thread
From: Matthew McClintock @ 2012-07-11 23:15 UTC (permalink / raw)
To: openembedded-core
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
---
.../sysvinit/sysvinit-inittab_2.88dsf.bb | 22 ++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
index 9bd087c..1089edb 100644
--- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Inittab for sysvinit"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
-PR = "r6"
+PR = "r7"
SRC_URI = "file://inittab"
@@ -26,7 +26,8 @@ do_install() {
for i in $tmp
do
j=`echo ${i} | sed s/\;/\ /g`
- echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+ echo "${idx}:12345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+
idx=`expr $idx + 1`
done
@@ -51,6 +52,23 @@ EOF
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}"
--
1.7.10
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sysvinit-inittab_2.88dsf.bb: Allow multiple serial port consoles to be defined
2012-07-11 23:15 [PATCH] sysvinit-inittab_2.88dsf.bb: Allow multiple serial port consoles to be defined Matthew McClintock
@ 2012-07-17 16:15 ` Saul Wold
0 siblings, 0 replies; 2+ messages in thread
From: Saul Wold @ 2012-07-17 16:15 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer; +Cc: Matthew McClintock
On 07/11/2012 04:15 PM, Matthew McClintock wrote:
> 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
> ---
> .../sysvinit/sysvinit-inittab_2.88dsf.bb | 22 ++++++++++++++++++--
> 1 file changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> index 9bd087c..1089edb 100644
> --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> @@ -2,7 +2,7 @@ DESCRIPTION = "Inittab for sysvinit"
> LICENSE = "GPLv2"
> LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
>
> -PR = "r6"
> +PR = "r7"
>
> SRC_URI = "file://inittab"
>
> @@ -26,7 +26,8 @@ do_install() {
> for i in $tmp
> do
> j=`echo ${i} | sed s/\;/\ /g`
> - echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
> + echo "${idx}:12345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
> +
> idx=`expr $idx + 1`
> done
>
> @@ -51,6 +52,23 @@ EOF
> 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}"
>
Merged into OE-Core
Thanks
Sau!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-17 16:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-11 23:15 [PATCH] sysvinit-inittab_2.88dsf.bb: Allow multiple serial port consoles to be defined Matthew McClintock
2012-07-17 16:15 ` Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox