[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Busybox mods - awk



On Tue, Aug 10, 2004 at 04:04:26PM -0400, Mark Richards wrote:
> Thanks for the assistance with the information command.  I discovered why I
> was not seeing the output I expected.
> 
> I have yet another question - this one concerns BusyBox.
> 
> I have a script I wish to run that needs awk.  I see that busybox (current
> version) has awk as part of its toolkit.  Yet I do not see awk in the
> busybox build for the Etrax.  Is it "safe" to get the latest busybox build
> and replace the one for the axis (with mods to the makefile)?

What a coincidence, I was just studying a new version of busybox to 
figure out how to build it for ETRAX. It seems easy to build it by 
just giving it the correct cross compiler prefix 
(cris-axis-linux-gnu-) in the build options (when running "make 
menuconfig"). You do need to add /usr/local/cris/bin to your PATH 
though (note the /bin part). But the you need to tweak it a bit to 
make it install the files correctly in the target directory. I haven't 
gotten that far yet.

The "correct" way to build it using our build system would be to 
include Rules.axis from Rules.mak though. And comment out busybox's 
definitions of CC, AR etc.

> 
> I also notes that although the instructions allow for changing what's
> included in the busybox build, when I follow them, they don't work.
> 
> The instructions for including applets say:
> 
> 	Next, add an entry to applets.h.  Be *sure* to keep the list in
> alphabetical
> 	order, or else it will break the binary-search lookup algorithm in
> busybox.c
> 	and the Gods of BusyBox smite you. Yea, verily:
> 
> 		/* all programs above here are alphabetically "less than"
> 'mu' */
> 		#ifdef BB_MU
> 			APPLET("mu", mu_main, _BB_DIR_USR_BIN, mu_usage)
> 		#endif
> 		/* all programs below here are alphabetically "greater than"
> 'mu' */
> 
> 
> 	Finally, add a define for your applet to Config.h:
> 
> 		#define BB_MU
> 
> I did this for the command "free" (BB_FREE).  BusyBox then recompiled.  I
> reinstalled it and free did not show up.
> 
> It looks as if these instructions at
> axis/devboard_82/apps/busybox/docs/new-applet-HOWTO.txt are wrong.
> 
> Is there another way to add an applet into busybox?

Modifying Config.h should be enough. Maybe you have a 
packages/apps/busybox/something that contains the Config.h actually 
being used. Then modify that Config.h instead.

>
> Maybe it makes sense to build awk seperately?
> 

Well, since we haven't even tested busybox 1.0 yet, there ought to be 
some initial problems. I suspect that awk is pretty big though. Maybe 
you don't really need awk? dash (/bin/sh) and sed (busybox) are also 
quite powerful and might satisfy your needs. What exactly does your 
script use awk for?

/Jonas