Busybox build problem

Brion Finlay brion.finlay at gmail.com
Fri Feb 2 21:14:36 PST 2007


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.


Alternatively, since awk is being invoked anyway, this line could be changed
to just a single line awk invocation to do away with the sed, the grep, and
the echo:

awk '/^#? ?CONFIG_/ {gsub(/\"/,"\\\\\"",$0); print "\"" $0 "\\n\"";}'
$config

I tested this change under bash and dash and it also works in both shells.

I have also attached a patch file to mkconfigs for the single line awk
version.


On 2/1/07, Denis Vlasenko <vda.linux at googlemail.com> wrote:
>
> On Thursday 01 February 2007 07:26, Brion Finlay wrote:
> > This seems like it should be a simple question that other people have
> had
> > problems with, but I cannot get Busybox to build.  I have tried
> google-ing
> > for similar problems, searching the mail archives, and reading the FAQs
> and
> > all of the documentation, but I cannot figure out what is going on.
> >
> > I am using a fairly fresh install of Ubuntu 6.1, and I have installed
> enough
> > of the development packages to build a custom kernel.  (I mention this
> > because Ubuntu does not preinstall many development packages, so it is
> > possible I am still missing some, but I have installed quite a few.)
> >
> > The GCC version is 4.1.2.
> > sed is GNU Sed version 4.1.5
> >
> > Here are the compile problems that I get:
> >
> > Busybox 1.4.1
> > # make defconfig; make
> >
> > ...
> > include/bbconfigopts.h:1088: error: missing terminating " character
> > (repeated for each line)
> > include/bbconfigopts.h:1089: error: expected expression before ';' token
> > make[1]: *** [miscutils/bbconfig.o] Error 1
> > make: *** [miscutils] Error 2
>
> gcc 4.1.1, glibc 2.4, gnu sed 4.1.5, bbox 1.4.1:
>
> # make defconfig; make
>   HOSTCC  scripts/basic/fixdep
>   HOSTCC  scripts/basic/split-include
>   HOSTCC  scripts/basic/docproc
>   HOSTCC  scripts/kconfig/conf.o
>   HOSTCC  scripts/kconfig/kxgettext.o
>   HOSTCC  scripts/kconfig/mconf.o
>   SHIPPED scripts/kconfig/zconf.tab.c
>   SHIPPED scripts/kconfig/lex.zconf.c
>   SHIPPED scripts/kconfig/zconf.hash.c
>   HOSTCC  scripts/kconfig/zconf.tab.o
>   HOSTLD  scripts/kconfig/conf
> scripts/kconfig/conf -d Config.in
> /.local/tmp/busybox-1.4.1/scripts/defconfig:351:warning: trying to assign
> nonexistent symbol E2FSCK
> /.local/tmp/busybox-1.4.1/scripts/defconfig:354:warning: trying to assign
> nonexistent symbol MKE2FS
> /.local/tmp/busybox-1.4.1/scripts/defconfig:355:warning: trying to assign
> nonexistent symbol TUNE2FS
> /.local/tmp/busybox-1.4.1/scripts/defconfig:356:warning: trying to assign
> nonexistent symbol E2LABEL
> /.local/tmp/busybox-1.4.1/scripts/defconfig:357:warning: trying to assign
> nonexistent symbol FINDFS
> /.local/tmp/busybox-1.4.1/scripts/defconfig:635:warning: symbol value ''
> invalid for FEATURE_COMMAND_HISTORY
> *
> * Busybox Configuration
> *
> *
> * Busybox Settings
> *
> *
> * General Configuration
> *
> See lots more (probably unnecessary) configuration options. (NITPICK)
> [N/y/?] n
> Enable options for full-blown desktop systems (DESKTOP) [N/y/?] n
> ...
> envdir (ENVDIR) [Y/n/?] y
> softlimit (SOFTLIMIT) [Y/n/?] y
>   SPLIT   include/autoconf.h -> include/config/*
>   GEN     include/bbconfigopts.h
>   HOSTCC  applets/usage
>   GEN     include/usage_compressed.h
>   CC      applets/applets.o
>   CC      applets/busybox.o
> ...
>   CC      util-linux/switch_root.o
>   CC      util-linux/umount.o
>   AR      util-linux/lib.a
>   LINK    busybox_unstripped
>
> include/bbconfigopts.h from build tree is attached.
> --
> vda
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/busybox/attachments/20070202/802bfa3b/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bbconfigopts.h
Type: text/x-chdr
Size: 20606 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070202/802bfa3b/attachment-0001.h 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mkconfigs.patch
Type: text/x-patch
Size: 429 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070202/802bfa3b/attachment-0001.bin 


More information about the busybox mailing list