Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
@ 2011-11-04 21:07 Matthew McClintock
  2011-11-04 21:15 ` Phil Blundell
  0 siblings, 1 reply; 12+ messages in thread
From: Matthew McClintock @ 2011-11-04 21:07 UTC (permalink / raw)
  To: openembedded-core

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 <msm@freescale.com>
---
 .../sysvinit/sysvinit-inittab_2.88dsf.bb           |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
index ba60c74..3a716d7 100644
--- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -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.
-- 
1.7.6.1





^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
  2011-11-04 21:07 [PATCH] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE Matthew McClintock
@ 2011-11-04 21:15 ` Phil Blundell
  2011-11-04 21:25   ` [PATCH v2] " Matthew McClintock
  0 siblings, 1 reply; 12+ messages in thread
From: Phil Blundell @ 2011-11-04 21:15 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, 2011-11-04 at 16:07 -0500, Matthew McClintock wrote:
> +    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.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
  2011-11-04 21:15 ` Phil Blundell
@ 2011-11-04 21:25   ` Matthew McClintock
  2011-11-04 21:34     ` Phil Blundell
  2011-11-10 17:21     ` Saul Wold
  0 siblings, 2 replies; 12+ messages in thread
From: Matthew McClintock @ 2011-11-04 21:25 UTC (permalink / raw)
  To: openembedded-core; +Cc: philb

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 <msm@freescale.com>
---
v2: handle case where SERIAL_CONSOLES is not defined

 .../sysvinit/sysvinit-inittab_2.88dsf.bb           |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
index ba60c74..adab262 100644
--- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -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.
-- 
1.7.6.1





^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
  2011-11-04 21:25   ` [PATCH v2] " Matthew McClintock
@ 2011-11-04 21:34     ` Phil Blundell
  2011-11-04 22:12       ` McClintock Matthew-B29882
  2011-11-07 23:03       ` McClintock Matthew-B29882
  2011-11-10 17:21     ` Saul Wold
  1 sibling, 2 replies; 12+ messages in thread
From: Phil Blundell @ 2011-11-04 21:34 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, 2011-11-04 at 16:25 -0500, Matthew McClintock wrote:
> v2: handle case where SERIAL_CONSOLES is not defined
> 
>  .../sysvinit/sysvinit-inittab_2.88dsf.bb           |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> index ba60c74..adab262 100644
> --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> @@ -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
> +

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.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
  2011-11-04 21:34     ` Phil Blundell
@ 2011-11-04 22:12       ` McClintock Matthew-B29882
  2011-11-07 23:03       ` McClintock Matthew-B29882
  1 sibling, 0 replies; 12+ messages in thread
From: McClintock Matthew-B29882 @ 2011-11-04 22:12 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2233 bytes --]

On Nov 4, 2011 4:35 PM, "Phil Blundell" <philb@gnu.org<mailto:philb@gnu.org>> wrote:
>
> On Fri, 2011-11-04 at 16:25 -0500, Matthew McClintock wrote:
> > v2: handle case where SERIAL_CONSOLES is not defined
> >
> >  .../sysvinit/sysvinit-inittab_2.88dsf.bb<http://sysvinit-inittab_2.88dsf.bb>           |   12 ++++++++++++
> >  1 files changed, 12 insertions(+), 0 deletions(-)
> >
> > diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb<http://sysvinit-inittab_2.88dsf.bb> b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb<http://sysvinit-inittab_2.88dsf.bb>
> > index ba60c74..adab262 100644
> > --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb<http://sysvinit-inittab_2.88dsf.bb>
> > +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb<http://sysvinit-inittab_2.88dsf.bb>
> > @@ -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
> > +
>
> 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.
>
>

Thanks for the feedback. Ill look at this again when I'm fresh.

-M

>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org<mailto:Openembedded-core@lists.openembedded.org>
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

[-- Attachment #2: Type: text/html, Size: 3425 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
  2011-11-04 21:34     ` Phil Blundell
  2011-11-04 22:12       ` McClintock Matthew-B29882
@ 2011-11-07 23:03       ` McClintock Matthew-B29882
  2011-11-08 19:36         ` McClintock Matthew-B29882
  1 sibling, 1 reply; 12+ messages in thread
From: McClintock Matthew-B29882 @ 2011-11-07 23:03 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, Nov 4, 2011 at 4:34 PM, Phil Blundell <philb@gnu.org> wrote:
>> --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>> +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
>> @@ -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
>> +
>
> 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.

I don't get it. I think the first version was still OK. The first
version is pasted below.

> +    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



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
  2011-11-07 23:03       ` McClintock Matthew-B29882
@ 2011-11-08 19:36         ` McClintock Matthew-B29882
  2011-11-08 20:47           ` Phil Blundell
  0 siblings, 1 reply; 12+ messages in thread
From: McClintock Matthew-B29882 @ 2011-11-08 19:36 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer, philb@gnu.org

On Mon, Nov 7, 2011 at 5:03 PM, Matthew McClintock <msm@freescale.com> wrote:
> I don't get it. I think the first version was still OK. The first
> version is pasted below.
>
>> +    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.

ping..

-M



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
  2011-11-08 19:36         ` McClintock Matthew-B29882
@ 2011-11-08 20:47           ` Phil Blundell
  2011-11-08 20:50             ` McClintock Matthew-B29882
  0 siblings, 1 reply; 12+ messages in thread
From: Phil Blundell @ 2011-11-08 20:47 UTC (permalink / raw)
  To: McClintock Matthew-B29882,
	Patches and discussions about the oe-core layer

On Tue, 2011-11-08 at 19:36 +0000, McClintock Matthew-B29882 wrote:
> On Mon, Nov 7, 2011 at 5:03 PM, Matthew McClintock <msm@freescale.com> wrote:
> > I don't get it. I think the first version was still OK. The first
> > version is pasted below.
> >
> >> +    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.
> 
> 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.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
  2011-11-08 20:47           ` Phil Blundell
@ 2011-11-08 20:50             ` McClintock Matthew-B29882
  2011-11-08 21:06               ` Saul Wold
  2011-11-11  1:06               ` Chris Larson
  0 siblings, 2 replies; 12+ messages in thread
From: McClintock Matthew-B29882 @ 2011-11-08 20:50 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: McClintock Matthew-B29882

On Tue, Nov 8, 2011 at 2:47 PM, Phil Blundell <philb@gnu.org> wrote:
> On Tue, 2011-11-08 at 19:36 +0000, McClintock Matthew-B29882 wrote:
>> On Mon, Nov 7, 2011 at 5:03 PM, Matthew McClintock <msm@freescale.com> wrote:
>> > I don't get it. I think the first version was still OK. The first
>> > version is pasted below.
>> >
>> >> +    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.
>>
>> 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



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
  2011-11-08 20:50             ` McClintock Matthew-B29882
@ 2011-11-08 21:06               ` Saul Wold
  2011-11-11  1:06               ` Chris Larson
  1 sibling, 0 replies; 12+ messages in thread
From: Saul Wold @ 2011-11-08 21:06 UTC (permalink / raw)
  To: McClintock Matthew-B29882,
	Patches and discussions about the oe-core layer

On 11/08/2011 12:50 PM, McClintock Matthew-B29882 wrote:
> On Tue, Nov 8, 2011 at 2:47 PM, Phil Blundell<philb@gnu.org>  wrote:
>> On Tue, 2011-11-08 at 19:36 +0000, McClintock Matthew-B29882 wrote:
>>> On Mon, Nov 7, 2011 at 5:03 PM, Matthew McClintock<msm@freescale.com>  wrote:
>>>> I don't get it. I think the first version was still OK. The first
>>>> version is pasted below.
>>>>
>>>>> +    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.
>>>
>>> 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.
>
Just to follow up, this is now in my queue.

Sau!

> Thanks,
> Matthew
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
  2011-11-04 21:25   ` [PATCH v2] " Matthew McClintock
  2011-11-04 21:34     ` Phil Blundell
@ 2011-11-10 17:21     ` Saul Wold
  1 sibling, 0 replies; 12+ messages in thread
From: Saul Wold @ 2011-11-10 17:21 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Matthew McClintock, philb

On 11/04/2011 02:25 PM, Matthew McClintock wrote:
> 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<msm@freescale.com>
> ---
> v2: handle case where SERIAL_CONSOLES is not defined
>
>   .../sysvinit/sysvinit-inittab_2.88dsf.bb           |   12 ++++++++++++
>   1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> index ba60c74..adab262 100644
> --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
> @@ -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.

Merged into OE-Core

Thanks
	Sau!



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE
  2011-11-08 20:50             ` McClintock Matthew-B29882
  2011-11-08 21:06               ` Saul Wold
@ 2011-11-11  1:06               ` Chris Larson
  1 sibling, 0 replies; 12+ messages in thread
From: Chris Larson @ 2011-11-11  1:06 UTC (permalink / raw)
  To: McClintock Matthew-B29882,
	Patches and discussions about the oe-core layer

On Tue, Nov 8, 2011 at 1:50 PM, McClintock Matthew-B29882
<B29882@freescale.com> wrote:
> On Tue, Nov 8, 2011 at 2:47 PM, Phil Blundell <philb@gnu.org> wrote:
>> On Tue, 2011-11-08 at 19:36 +0000, McClintock Matthew-B29882 wrote:
>>> On Mon, Nov 7, 2011 at 5:03 PM, Matthew McClintock <msm@freescale.com> wrote:
>>> > I don't get it. I think the first version was still OK. The first
>>> > version is pasted below.
>>> >
>>> >> +    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.
>>>
>>> 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 ;).
>

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.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-11-11  1:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-04 21:07 [PATCH] Introduce new SERIAL_CONSOLES to add multiple consoles for your MACHINE Matthew McClintock
2011-11-04 21:15 ` Phil Blundell
2011-11-04 21:25   ` [PATCH v2] " Matthew McClintock
2011-11-04 21:34     ` Phil Blundell
2011-11-04 22:12       ` McClintock Matthew-B29882
2011-11-07 23:03       ` McClintock Matthew-B29882
2011-11-08 19:36         ` McClintock Matthew-B29882
2011-11-08 20:47           ` Phil Blundell
2011-11-08 20:50             ` McClintock Matthew-B29882
2011-11-08 21:06               ` Saul Wold
2011-11-11  1:06               ` Chris Larson
2011-11-10 17:21     ` Saul Wold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox