[patch] proposed change to busybox option parsing.
Rob Landley
rob at landley.net
Mon Sep 5 02:08:59 UTC 2005
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.
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.
> 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.
Also, we get the name we were invoked under in $0, but if we were called via
$PATH figuring out where that file is gets a bit tricky. (For the standalone
shell we added a dependency on /proc/self/exe, but that's not 100% reliable
and having that in the busybox base applet is distasteful and unnecessary
complexity even if you get past the previous objection which is that this
distinction has historically never meant anything, would be way too subtle if
it did, and is generally a bad idea.)
I.E. "no".
Rob
More information about the busybox
mailing list