[PATCH] add-shell, remove-shell: new applets

Alexander Shishkin virtuoso at slind.org
Tue Oct 19 23:23:25 UTC 2010


On Tue, Oct 19, 2010 at 11:18:43 +0200, Denys Vlasenko wrote:
> On Tuesday 19 October 2010 22:33, Alexander Shishkin wrote:
> > [Sorry, the previous mail seems to have been eaten by the smarthost,
> > apologies if it comes twice.]
> > 
> > function                                             old     new   delta
> > add_shell_main                                         -     459    +459
> > .rodata                                            50375   50495    +120
> > chomp                                                  -      24     +24
> > applet_names                                         920     943     +23
> > packed_usage                                        1640    1661     +21
> > applet_main                                         1232    1248     +16
> > applet_nameofs                                       308     312      +4
> > ------------------------------------------------------------------------------
> > (add/remove: 4/0 grow/shrink: 5/0 up/down: 667/0)             Total: 667 bytes
> > 
> > Signed-off-by: Alexander Shishkin <virtuoso at slind.org>
> 
> This seems to be trivially scriptable in sh.
> 
> Why do you need it? (I ask because sometimes there _is_ a valid,
> but unknown to me, reason to have this or that tool in bbox).

Well, I like my busybox to be a real swiss army knife, so that I can
grab it, compile it and put a single binary to where I need it and
have all the tools that I need in that binary. (as opposed to dragging
scripts and their dependencies around) And sometimes the only thing
that you can rely on a system is a statically linked busybox.

Also, I would like to see busybox as a potential replacement for the
base GNU tools in a desktop system one day. Adding applets that you
don't necessarily have to compile in, but that get busybox closer to
being all-in-one drop-in replacement is something worth doing, imo.

Other than that, I try to avoid shell scripting if I can help it and
my script-foo is not good enough to produce a tolerably good version
of add/remove-shell in 667 bytes. A C implementation is something
that I'm willing to work on, though.

Regards,
--
Alex


More information about the busybox mailing list