[BusyBox] command path shortcut.

Erik Andersen andersen at codepoet.org
Wed Feb 18 08:40:05 UTC 2004


On Wed Feb 18, 2004 at 02:23:03AM -0600, Rob Landley wrote:
> On Tuesday 17 February 2004 15:28, Nick Gully wrote:
> > Hello,
> > 	I was wondering if it is worth to anybody the byte saving (at 12
> > bytes a command or so, 2k or so for all the busybox commands) of
> > having  the shell by default feed commands to
> > busybox instead of traversing symbolic links (so remove all the symbolic
> > links to programs busybox replaces).  Or is any reason I missing
> > that this wouldn't work? I tried to find it on this list and came up
> > empty.
> >
> > Best Regards,
> > 	Nick
> > trying to fit a small kernel, busybox, and mozilla on an iOpener.
> > and mozilla is truly the huge monster. ;)
> 
> Right now, the built-in-commands functionality of the busybox shell is kind of 
> broken.  It turns out ash isn't reentrant, it has to exec something to 
> reinitialize its state, so it execs /bin/busybox and feeds it the appropriate 
> command line to run the command in question.
> 
> See shell/ash.c line 3715 or so.
> 
> So it may do what you want if you configure it right, albeit for really bad 
> reasons.  Fixing this is on my to-do list, but Vladimir showed me that it's 
> one of those "drill through from the other side of the mountain to get there" 
> kind of problems.  I have to change a lot of stuff to fix this right.  (Make 
> ash reentrant so it can run_applet_by_name(), basically.)

And not just ash...  Every single applet would need to be
reentrant for this to work.  Some apps, for example depend on
having their vars zero'd out in the .bss, which isn't the case
when called the second time via run_applet_by_name().  Some use
global vars, but do not reset that global to its initial state
when the applet starts up. etc.

On the other hand, it is awfully cool to be able to chroot into
and empty directory with a full bag of tools builtin into your
shell.

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the busybox mailing list