how to build busybox for a thin client system

Rob Landley rob at landley.net
Sat Aug 12 18:46:46 UTC 2006


On Thursday 03 August 2006 5:10 am, Joey S. Eisma wrote:
> hi!
> 
> a thin client system that uses busy box has on its package directories, 
> contain these files:
> 
> -rwxr-xr-x  1 admin admin 242344 2006-07-14 11:53 [
> -rwxr-xr-x  1 admin admin 242344 2006-07-14 11:53 ash
> -rwxr-xr-x  1 admin admin  10632 2006-07-14 11:53 aumix
> -rwxr-xr-x  1 admin admin 242344 2006-07-14 11:53 awk
> -rwxr-xr-x  1 admin admin 242344 2006-07-14 11:53 basename
> -rwxr-xr-x  1 admin admin 242344 2006-07-14 11:53 busybox
> -rwxr-xr-x  1 admin admin 242344 2006-07-14 11:53 cat

Lemme guess, this is cramfs?

Your link count (the second field) is 1 for all these files.  If you are using 
hard links, your filesystem isn't reporting them correctly.  (If you aren't, 
then you're wasting a lot of space.)

In any case, you have two options:

1) Build a new version of busybox configured to provide all these applets.  
Use "make menuconfig" in busybox to configure what you want.  [ is a synonym 
for the "test" applet.  Then symlink or hardlink all the applet names (see 
the man page for the "ln" command for details on that) to point to your new 
busybox executable.

2) Replace just the dhcpd entry with your new busybox executable.  Build a 
busybox that just provides dhcpd, and then "mv busybox dhcpd".  That means 
the old busybox will still contain dhcpd functionality that you're not using 
anymore, but if you have a little space to waste that's the easy and least 
intrustive way.  (That won't break any of your old apps by accident, which is 
a real concern if you're replacing everything and don't know what you're 
doing.)

> i believe these are all forked from busybox, how do i build busybox to 
> be able to have the same set of files?

The ones of size 242344 are.  The rest are other applets.

> what im really trying to do is to have udhcpc be able to use ports other 
> than the standard 67/68. have already made changes 
> networking/udhcp/dhcpd.h to use ports 1067/1068. now i need to overwrite 
> the the existing udhcpc. running "make defconfig" only created a single 
> "busybox" binary.

"make defconfig" produces a busybox binary with _everything_ in it.  It's 
something like a megabyte, and contains around 250 different applets.  This 
probably isn't what you want, try "make menuconfig".

> i need to have the same structure as above, hoping not  
> to break the thin client system.

You can also try scripts/individual in the current svn snapshot.  That 
produces individual executables of each busybox applet.  Unfortunately, it 
only does about 220 of them so far, and I think udhcp is one of the ones 
still broken.  (I'm working on it, but it's a background task sharing 
timeslices with lots of other things...)

For the release version, you can fake something like this with "make 
allnoconfig" then "make menuconfig", switch on just the applet you need, 
make, and "mv busybox dhcpd".  Congrats, you've built one applet standalone.  
It won't work if execed with the wrong name (ala #!/bin/sh which execs 
busybox with argv[0] being the name of the _script_ rather than sh) but 
that's not a problem in this case. :)

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list