On Tue, Nov 8, 2011 at 1:50 PM, McClintock Matthew-B29882 <b29...@freescale.com> wrote: > On Tue, Nov 8, 2011 at 2:47 PM, Phil Blundell <ph...@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 <m...@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 _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core