how can I override busybox builtins?
Denys Vlasenko
vda.linux at googlemail.com
Tue Oct 12 02:22:10 UTC 2010
On Tuesday 12 October 2010 00:19, Stuart Longland wrote:
> On 10/11/10 22:39, Monkey D. Luffy wrote:
> > After several hours of head banging I realized that busybox uses
> > builtins instead of the binaries in PATH.
> > Why is this the default behavior?
These options are not on by default in build system.
Whoever compiled your busybox copy turned them on deliberately.
> > If the executables are in PATH it
> > would make sense that the user wants them to be used instead.
> > Is there a way to force busybox to use the executables in $PATH
> > instead of the builtins?
IIRC in ash there is command builtin: "command foo" will run
external command foo.
> > Maybe setting a shell variable like: BB_PREFER_BUILTINS=no
> > Note that setting the full path to the executable, eg: /usr/sbin/mount
> > (I deleted the /bin/mount), doesn't solve the problem because is it
> > used in exec scenarios.
I don't understand.
What do you refer to by the word "it" above?
> There's a .config option when building Busybox:
>
> BusyBox 1.17.1 Configuration
> ──────────────────────────────────────────────────────────────────────
> ┌─────────────────────── exec prefers applets ───────────────────────┐
> │ CONFIG_FEATURE_PREFER_APPLETS: │
> │ │
> │ This is an experimental option which directs applets about to │
> │ call 'exec' to try and find an applicable busybox applet before │
> │ searching the PATH. This is typically done by exec'ing │
> │ /proc/self/exe. │
> │ This may affect shell, find -exec, xargs and similar applets. │
> │ They will use applets even if /bin/<applet> -> busybox link │
> │ is missing (or is not a link to busybox). However, this causes │
> │ problems in chroot jails without mounted /proc and with ps/top │
> │ (command name can be shown as 'exe' for applets started this way). │
> │ │
> │ Symbol: FEATURE_PREFER_APPLETS [=n] │
> │ Prompt: exec prefers applets │
> │ Defined at Config.in:373 │
> │ Location: │
> │ -> Busybox Settings │
> │ -> General Configuration │
> ├────────────────────────────────────────────────────────────(100%)──┤
> │ < Exit > │
> └────────────────────────────────────────────────────────────────────┘
>
> Not sure why exec'ing to a full path is a problem however. IIRC that
> overrode this behaviour.
Also, turn off SH_STANDALONE.
--
vda
More information about the busybox
mailing list