[BusyBox] BB_FEATURE_SH_STANDALONE_SHELL, ash cd etc.

Tomi Ollila Tomi.Ollila at sonera.com
Tue Aug 28 05:53:23 UTC 2001


Hi

So, what will be the final way how BB_FEATURE_STANDALONE_SHELL and
BB_FEATURE_SH_APPLETS_ALWAYS_WIN affect the behaviour of the shell.

I, like many others, would like that when just BB_FEATURE_STANDALONE_SHELL,
shell executed the busybox commands (if any) in preference to searching
the command using the PATH variable.

Upto atleast BusyBox v0.61.pre (2001.08.28-10:40+0000) Built-in shell (ash)
it doesn't work this way. 

In order to make that work, also BB_FEATURE_SH_APPLETS_ALWAYS_WIN needs to
be defined -- but in this case, shell would always run busybox command,
even user explicitly tries to run (perhaps different) command w/ full
path from command line (supposedly, I did not try).

I compiled busybox with BB_FEATURE_SH_STANDALONE_SHELL defined and
without BB_FEATURE_SH_APPLETS_ALWAYS_WIN (I don't want this feature)... 
it did not work as I expected so I just run the following to do the links:

./busybox 2>&1 | sed -n -e 'y/,/ /' -e '/^Curr/,$ p' | \
	tail +2 | xargs -n 1 echo ln busybox

(echo needs to be removed in final run after it is verified that the cmd works)


I vote that just the definition of BB_FEATURE_SH_STANDALONE_SHELL should
be enough for the busybox internal commands to be found even those are not
linked to the filesystem (maybe PATH -environment variable could be used
to decide the order ? --- or just search busybox first and then go to the
filesystem, to lessen code size increase).


Then,  something else:

I have /etc/inittab line:

::askfirst:-/bin/sh

So, when I press enter on console, I get ash -shell w/ output:

--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
BusyBox v0.61.pre (2001.08.28-10:40+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--

... and shell works fine. except:

--8<----8<----8<----8<----8<----8<----8<--
# cd /bin
command: No such file or directory
# chdir /bin
# pwd
/bin
# cd /
command: No such file or directory
# chdir /
# ash


BusyBox v0.61.pre (2001.08.28-10:40+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

# cd /bin
# pwd
/bin
# exit
# cd /bin
command: No such file or directory
#
--8<----8<----8<----8<----8<----8<----8<--

Anybody have an idea why this happens ?

Tomi





More information about the busybox mailing list