[patch] proposed change to busybox option parsing.

Aurelien Jacobs aurel at gnuage.org
Mon Sep 5 11:44:26 UTC 2005


On Sun, 4 Sep 2005 21:08:59 -0500
Rob Landley <rob at landley.net> wrote:

> On Sunday 04 September 2005 15:51, Aurelien Jacobs wrote:
> > On Sat, 3 Sep 2005 00:56:03 -0500
> >
> > Rob Landley <rob at landley.net> wrote:
> > > Ok, this makes any command starting with "busybox" work as if the
> > > command was  busybox, I.E "./busybox-walrus" is acceptable.  This
> > > includes making  "./busybox-walrus --help thingy" work, in all the
> > > various permutations I  could see.
> >
> > IMHO, restricting the busybox executable name to busybox* is not a
> > very good thing. What if I rename my busybox binary to 'bb' ?
> 
> Then you broke it, just as if you renamed your busybox "ls" binary to
> "dir"  and expected it to still work.  That's never worked, yet you've
> never  complained about it before.  Working as designed.
> 
> There is now a way to do what people said they wanted to do, which was
> have  more than one version of busybox in the same directory.
> 
> You can also edit the source code if you really really really really
> really  want busybox to be called "bb", but unless you can explain
> what possible  advantage doing that has there's no point in us adding
> a gratuitous config  option that has no purpose.

I have no reason to rename busybox to bb, and indeed I don't do it.
That's just, that I dislike reducing users freedom (to rename busybox
to whatever they want) when there is not a very good reason for it.
I didn't found any good reason, but it seems I had overlooked a few
"details".

> It's built-in to busybox that the names the applets are invoked under 
> determines how they behave.  The "busybox" applet is not special in
> this  regard.

Hum... really ? But you still want to be able to run busybox-new for
example ? That would mean that we could also expect ls-new to work ?

> > Wouldn't it be better to check if $0 is a symlink to decide if we
> > are running busybox or an applet ?
> 
> No, people hardlink busybox all the time.  We even have "make 
> install-hardlinks", and the busybox --install option makes hardlinks
> by  default unless you tell it -s.

Oh ! Right ! Stupid me ! How could I forgot this !
(maybe because I only use busybox with symlinks ?)

So the only really proper solution would be to build a list of all
the possible applets in busybox (even the one which are not built-in)
to really detect if the users tried to run an applet or the busybox
binary itself. But this would enlarge busybox which is very bad and
certainly not acceptable.

So finally it seems that the busybox* hack is the more reasonable
solution.

Aurel



More information about the busybox mailing list