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? 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?
> 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.

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.
-- 
Stuart Longland (aka Redhatter, VK4MSL)      .'''.
Gentoo Linux/MIPS Cobalt and Docs Developer  '.'` :
. . . . . . . . . . . . . . . . . . . . . .   .'.'
http://dev.gentoo.org/~redhatter             :.'

I haven't lost my mind...
  ...it's backed up on a tape somewhere.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to