Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
PATCH 1/1 Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
Just define additional serial consoles like so:
SERIAL_CONSOLES="115200;ttyS0 115200;ttyS1 ... 115200;ttySN"
Also be sure to remove SERIAL_CONSOLE (lacking the S) from your machine as they can conflict.
--- .../sysvinit/sysvinit-inittab_2.88dsf.bb | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +10 -0
@@ -25,6 +25,16 @@ do_install() { 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}:2345: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.
Signature · 1 line
1.7.6.1
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb do_install() { · line 40
Quoted 12 lines · Matthew McClintock
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +9
-0+ idx=0 + tmp="${SERIAL_CONSOLES}" + for i in $tmp + do + j=`echo ${i} | sed s/\;/\ /g` + echo "${idx}:2345: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.
That looks like it will lose if ${SERIAL_CONSOLES} is not defined at all.
p.
PATCH v2 1/1 Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
Just define additional serial consoles like so:
SERIAL_CONSOLES="115200;ttyS0 115200;ttyS1 ... 115200;ttySN"
Also be sure to remove SERIAL_CONSOLE (lacking the S) from your machine as they can conflict.
---
v2: handle case where SERIAL_CONSOLES is not defined
.../sysvinit/sysvinit-inittab_2.88dsf.bb | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +12 -0
@@ -25,6 +25,18 @@ do_install() { if [ ! -z "${SERIAL_CONSOLE}" ]; then echo "S:2345:respawn:${base_sbindir}/getty ${SERIAL_CONSOLE}" >> ${D}${sysconfdir}/inittab fi + + idx=0 + tmp="${SERIAL_CONSOLES}" + if [ "x" != "x$tmp" ]; then + for i in $tmp + do + j=`echo ${i} | sed s/\;/\ /g` + echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab + idx=`expr $idx + 1` + done + fi + if [ "${USE_VT}" = "1" ]; then cat <<EOF >>${D}${sysconfdir}/inittab # ${base_sbindir}/getty invocations for the runlevels.
Signature · 1 line
1.7.6.1
Quoted 15 lines · Matthew McClintock
v2: handle case where
SERIAL_CONSOLESis not defined.../sysvinit/sysvinit-inittab_2.88dsf.bb | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +2
-0@@ -25,6 +25,18 @@ do_install() { if [ ! -z "${SERIAL_CONSOLE}" ]; then echo "S:2345:respawn:${base_sbindir}/getty ${SERIAL_CONSOLE}" >> ${D}${sysconfdir}/inittab fi + + idx=0
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb do_install() { · line 39
Quoted 10 lines
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +10
-0+ tmp="${SERIAL_CONSOLES}" + if [ "x" != "x$tmp" ]; then + for i in $tmp + do + j=`echo ${i} | sed s/\;/\ /g` + echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab + idx=`expr $idx + 1` + done + fi +
Did you test that this actually solves the problem? It looks to me as though it will still do the wrong thing if the variable is not defined at all (as opposed to being defined to the empty string). The added "if" statement doesn't actually achieve much since, if $tmp is the empty string, the for-loop wouldn't have executed anyway and there is no need for an extra guard.
Also, for what it's worth, the "x$tmp" idiom is unnecessary if you're going to quote the strings.
p.
Quoted 35 lines · On Nov 4, 2011 4:35 PM, "Phil Blundell" <[email protected]<mailto:[email protected]>>…
Quoted 15 lines · Matthew McClintock
v2: handle case where
SERIAL_CONSOLESis not defined.../sysvinit/sysvinit-inittab_2.88dsf.bb<http://sysvinit-inittab_2.88dsf.bb> | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb<http://sysvinit-inittab_2.88dsf.bb> +2
-0@@ -25,6 +25,18 @@ do_install() { if [ ! -z "${SERIAL_CONSOLE}" ]; then echo "S:2345:respawn:${base_sbindir}/getty ${SERIAL_CONSOLE}" >> ${D}${sysconfdir}/inittab fi + + idx=0meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb<http://sysvinit-inittab_2.88dsf.bb> do_install() { · line 39
Quoted 10 lines
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb<http://sysvinit-inittab_2.88dsf.bb> +10
-0+ tmp="${SERIAL_CONSOLES}" + if [ "x" != "x$tmp" ]; then + for i in $tmp + do + j=`echo ${i} | sed s/\;/\ /g` + echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab + idx=`expr $idx + 1` + done + fi +Did you test that this actually solves the problem? It looks to me as though it will still do the wrong thing if the variable is not defined at all (as opposed to being defined to the empty string). The added "if" statement doesn't actually achieve much since, if $tmp is the empty string, the for-loop wouldn't have executed anyway and there is no need for an extra guard.
Quoted 6 lines
Also, for what it's worth, the "x$tmp" idiom is unnecessary if you're going to quote the strings.
p.
Thanks for the feedback. Ill look at this again when I'm fresh.
-M
Quoted 5 lines
_______________________________________________
Openembedded-core mailing list [email protected]<mailto:[email protected]>
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Quoted 26 lines · Phil Blundell
Quoted 8 lines
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +0
-0@@ -25,6 +25,18 @@ do_install() {if [ ! -z "${SERIAL_CONSOLE}" ]; then
echo "S:2345:respawn:${base_sbindir}/getty ${SERIAL_CONSOLE}" >> ${D}${sysconfdir}/inittab fimeta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +2
-0+ + idx=0meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb do_install() { · line 39
Quoted 10 lines
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +10
-0+ tmp="${SERIAL_CONSOLES}" + if [ "x" != "x$tmp" ]; then + for i in $tmp + do + j=`echo ${i} | sed s/\;/\ /g` + echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab + idx=`expr $idx + 1` + done + fi +Did you test that this actually solves the problem? It looks to me as though it will still do the wrong thing if the variable is not defined at all (as opposed to being defined to the empty string). The added "if" statement doesn't actually achieve much since, if $tmp is the empty string, the for-loop wouldn't have executed anyway and there is no need for an extra guard.
Quoted 2 lines
Also, for what it's worth, the "x$tmp" idiom is unnecessary if you're going to quote the strings.
I don't get it. I think the first version was still OK. The first version is pasted below.
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb do_install() { · line 37
Quoted 8 lines
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +8
-0+ idx=0 + tmp="${SERIAL_CONSOLES}" <- If it's not defined this will catch it. + for i in $tmp + do + j=`echo ${i} | sed s/\;/\ /g` + echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab + idx=`expr $idx + 1` + done
See my inline comment above, but if SERIAL_CONSOLES is not defined tmp="" and the for loop won't execute. Not sure if there is a more standard way to do this though.
-M
Quoted 12 lines · Matthew McClintock
I don't get it. I think the first version was still OK. The first version is pasted below.
Quoted 8 lines
+ idx=0
+ tmp="${SERIAL_CONSOLES}" <- If it's not defined this will catch it.
+ for i in $tmp
+ do
+ j=echo ${i} | sed s/\;/\ /g
+ echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+ idx=expr $idx + 1
+ done
Quoted 3 lines
See my inline comment above, but if
SERIAL_CONSOLESis not defined tmp="" and the for loop won't execute. Not sure if there is a more standard way to do this though.
ping..
-M
Quoted 13 lines · On Tue, 2011-11-08 at 19:36 +0000, McClintock Matthew-B29882 wrote:
Quoted 12 lines · Matthew McClintock
I don't get it. I think the first version was still OK. The first version is pasted below.
Quoted 8 lines
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +8
-0+ idx=0 + tmp="${SERIAL_CONSOLES}" <- If it's not defined this will catch it. + for i in $tmp + do + j=`echo ${i} | sed s/\;/\ /g` + echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab + idx=`expr $idx + 1` + done
Quoted 5 lines
Quoted 3 lines
See my inline comment above, but if
SERIAL_CONSOLESis not defined tmp="" and the for loop won't execute. Not sure if there is a more standard way to do this though.ping..
Yeah, now I look at this again I think it is probably OK. Bitbake won't expand ${SERIAL_CONSOLES} if it's unset, but the shell will and I think you probably will get the right results. Assuming you've actually tested that case and it does work, I think I'm happy with what you have above.
p.
Quoted 18 lines · Phil Blundell
Quoted 17 lines · On Tue, 2011-11-08 at 19:36 +0000, McClintock Matthew-B29882 wrote:
Quoted 15 lines · Matthew McClintock
I don't get it. I think the first version was still OK. The first version is pasted below.
Quoted 8 lines
+ idx=0
+ tmp="${SERIAL_CONSOLES}" <- If it's not defined this will catch it.
+ for i in $tmp
+ do
+ j=echo ${i} | sed s/\;/\ /g
+ echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+ idx=expr $idx + 1
+ doneSee my inline comment above, but if
SERIAL_CONSOLESis not defined tmp="" and the for loop won't execute. Not sure if there is a more standard way to do this though.
Quoted 7 lines
Quoted 1 line
ping..
Yeah, now I look at this again I think it is probably OK. Bitbake won't expand ${SERIAL_CONSOLES} if it's unset, but the shell will and I think you probably will get the right results. Assuming you've actually tested that case and it does work, I think I'm happy with what you have above.
Thanks Phil, I wanted to make sure I was not missing something obvious ;).
Maintainers, please consider v1 of this patch.
Thanks,
Matthew
Quoted 27 lines · On 11/08/2011 12:50 PM, McClintock Matthew-B29882 wrote:
Quoted 18 lines · Phil Blundell
Quoted 17 lines · On Tue, 2011-11-08 at 19:36 +0000, McClintock Matthew-B29882 wrote:
Quoted 15 lines · Matthew McClintock
I don't get it. I think the first version was still OK. The first version is pasted below.
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb do_install() { · line 37
Quoted 8 lines
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +8
-0+ idx=0 + tmp="${SERIAL_CONSOLES}"<- If it's not defined this will catch it. + for i in $tmp + do + j=`echo ${i} | sed s/\;/\ /g` + echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}">> ${D}${sysconfdir}/inittab + idx=`expr $idx + 1` + doneSee my inline comment above, but if
SERIAL_CONSOLESis not defined tmp="" and the for loop won't execute. Not sure if there is a more standard way to do this though.Quoted 7 lines
Quoted 1 line
ping..
Yeah, now I look at this again I think it is probably OK. Bitbake won't expand ${SERIAL_CONSOLES} if it's unset, but the shell will and I think you probably will get the right results. Assuming you've actually tested that case and it does work, I think I'm happy with what you have above.
Quoted 4 lines
Thanks Phil, I wanted to make sure I was not missing something obvious ;).
Maintainers, please consider v1 of this patch.
Just to follow up, this is now in my queue.
Sau!
Quoted 8 lines
Thanks,
Matthew_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Quoted 21 lines · On Tue, Nov 8, 2011 at 1:50 PM, McClintock Matthew-B29882…
Quoted 20 lines · Phil Blundell
Quoted 18 lines · On Tue, 2011-11-08 at 19:36 +0000, McClintock Matthew-B29882 wrote:
Quoted 12 lines · Matthew McClintock
I don't get it. I think the first version was still OK. The first version is pasted below.
Quoted 8 lines
+ idx=0
+ tmp="${SERIAL_CONSOLES}" <- If it's not defined this will catch it.
+ for i in $tmp
+ do
+ j=echo ${i} | sed s/\;/\ /g
+ echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+ idx=expr $idx + 1
+ doneQuoted 3 lines
See my inline comment above, but if
SERIAL_CONSOLESis not defined tmp="" and the for loop won't execute. Not sure if there is a more standard way to do this though.ping..
Quoted 8 lines
Quoted 5 lines
Yeah, now I look at this again I think it is probably OK. Bitbake won't expand ${SERIAL_CONSOLES} if it's unset, but the shell will and I think you probably will get the right results. Assuming you've actually tested that case and it does work, I think I'm happy with what you have above.
Thanks Phil, I wanted to make sure I was not missing something obvious ;).
Note that one could always define SERIAL_CONSOLES ?= "" somewhere appropriate. Wouldn't hurt anything to define defaults for things we use. Maybe someday we can make referencing undefined variables raise an error rather than this whole 'if bitbake doesn't expand it, let the shell do it' behavior which is unintuitive. Not easily knowing when something will be evaluated is problematic.
Signature · 5 lines
Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
Saul Wold
AppliedQuoted 27 lines · Matthew McClintock
Just define additional serial consoles like so:
SERIAL_CONSOLES="115200;ttyS0 115200;ttyS1 ... 115200;ttySN"
Also be sure to remove
SERIAL_CONSOLE(lacking the S) from your machine as they can conflict.Signed-off-by Matthew McClintock<[email protected]>---
v2: handle case whereSERIAL_CONSOLESis not defined.../sysvinit/sysvinit-inittab_2.88dsf.bb | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +5
-0@@ -25,6 +25,18 @@ do_install() { if [ ! -z "${SERIAL_CONSOLE}" ]; then echo "S:2345:respawn:${base_sbindir}/getty ${SERIAL_CONSOLE}">> ${D}${sysconfdir}/inittab fi + + idx=0 + tmp="${SERIAL_CONSOLES}" + if [ "x" != "x$tmp" ]; then + for i in $tmp
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb do_install() { · line 42
Quoted 10 lines
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +7
-0+ do + j=`echo ${i} | sed s/\;/\ /g` + echo "${idx}:2345:respawn:${base_sbindir}/getty ${j}">> ${D}${sysconfdir}/inittab + idx=`expr $idx + 1` + done + fi + if [ "${USE_VT}" = "1" ]; then cat<<EOF>>${D}${sysconfdir}/inittab # ${base_sbindir}/getty invocations for the runlevels.
Merged into OE-Core
Thanks
Sau!