Busybox build problem

Brion Finlay brion.finlay at gmail.com
Sat Feb 3 19:15:22 UTC 2007


bbconfig.h: Yes, it seems to be a different file that is not generated by
scripts/mkconfigs.  include/config/bbconfig.h looks to be only a single
line, and it does not have quotes or "\n" in the file like
include/bbconfigopts.h.  Whether built with dash or bash using the
unmodified mkconfigs, both include/config/bbconfig.h files look like this:

#define CONFIG_BBCONFIG 1

I don't think scripts/mkconfigs generates include/config/bbconfig.h, I think
it only generates bbconfigopts.h, despite the comment in the header.  The
main evidence for this is that the include define for the .h file it
generates is always "_BBCONFIGOPTS_H", and is always generated.
include/config/bbconfig.h does not contain any of the text that is always
generated.

To be honest, though, I am not sure what IS generating the
include/config/bbconfig.h file.  Some quick greps through the source tree do
not turn anything up, but I know that this file gets replaced with a #undef
CONFIG_BBCONFIG when that option is turned off.

I could also clean up the comments and submit another patch if you are
interested.  There is another error in the comments where it refers to
scripts/config/mkconfigs instead of scripts/mkconfigs, which is propogated
to the generated bbconfigopts.h.

ash:  I just tested with ash.  The unmodified version does work with the
bbox ash.  The unmodified version also works with bash, in case that wasn't
clear from my other email.  The modified version also works with ash, bash,
and dash.

I agree, presumably there was a reason.  Maybe someone can shed some light.
I will share some of my thoughts.

It might be that the reason for using the echo "` ... `" construction is
simply to make the script look nicer, since the other lines in the script
are all echo statements.

The only difference that I see using an echo "` ... `" versus direct
execution of the command is that the echo statement could process escape
characters from the output of the backquote command.   If it isn't the
intent to process escape characters, then it seems like it might as well
execute the command directly.  In this case, the echo command of "dash" IS
processing the escape characters, and this causes a problem, so it
certainly doesn't seem like the intent is to use echo to process escape
characters (which seems like a dubious intent, anyway.)

The mkconfigs script appears to be simple.  As the comments state, it is
pulling lines from .config which start with "CONFIG_" or "# CONFIG_",
replacing " with \", and prints each line as "<string>\n".


On 2/3/07, Denis Vlasenko <vda.linux at googlemail.com> wrote:
>
> On Saturday 03 February 2007 06:14, Brion Finlay wrote:
> > Thanks for the responses.  It helped knowing that my gnu compiler/c
> library
> > configuration was correct.  It also helped knowing what the
> > bbconfigopts.hwas supposed to look like.
> >
> > I did some digging into the problem and found the following.  The
> immediate
> > cause of my problem is that Ubuntu 6.1 uses the "dash" shell 0.5.3-3 for
> > /bin/sh.  At the same time, scripts/mkconfigs uses an echo "`...`"
> > construction for generating bbconfigopts.h.  This construction contains
> a
> > "\n" sequence, which the dash echo command interprets literally.  (See
> the
> > attached bbconfigopts.h production to see what happens.)
> >
> > Linking /bin/sh to /bin/bash resolved this problem and allowed the build
> to
> > complete successfully.
> >
> > The fix that could be made to scripts/mkconfigs in order to work more
> > generally, be less indirect, and avoid some of the backslash quoting
> would
> > be to eliminate the echo "`...`" construction and just execute the
> command
> > directly.  That is, change this:
> >
> > echo "`sed 's/\"/\\\\\"/g' $config | grep "^#\? \?CONFIG_" | awk '{print
>
> > "\\"" $0 "\\\\n\\"";}'`"
> >
> > to this:
> >
> > sed 's/\"/\\\\\"/g' $config | grep "^#\? \?CONFIG_" | awk '{print "\""
> $0
> > "\\n\"";}'
> >
> > I tested this change under bash and dash and it works in both shells.
>
> There is presumably a reason why it is done that way. Is bbconfig.hdifferent?
>
> Another question, does it (unmodified version, that is) work with bbox
> ash?
> --
> vda
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20070203/2f8b8a35/attachment.htm 


More information about the busybox mailing list