[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: "bash" alias is added
From: Denys Vlasenko <vda.linux () googlemail ! com>
Date: 2010-05-20 0:12:07
Message-ID: 201005200212.07365.vda.linux () googlemail ! com
[Download RAW message or body]
On Wednesday 19 May 2010 06:12, Rob Landley wrote:
> Which is why you say #!/bin/bash and then teach busybox's shells to understand
> the name "bash". The name is a promise of an API beyond Posix.
>
> > I'm not understanding the argument
> > for using bash-specific functionality, but not using bash as the shell.
> > Yes dash has "gratuitous bash incompatibilities", but you are
> > *explicitly* saying to use /bin/sh, which dash *is* compatible with.
>
> No, he said #!/bin/bash and somebody complained that busybox couldn't work
> with that. I agree that's a problem, but the _bug_ is that busybox needs to
> be extended to route the name "bash" to hush and then hush taught to do more
> stuff.
See attached. Now it's possible to run ash or hush using "bash" name.
Of course, this is trivial...
--
vda
["4.patch" (text/x-diff)]
diff -ad -urpN busybox.3/include/applets.h busybox.4/include/applets.h
--- busybox.3/include/applets.h 2010-05-15 20:42:19.000000000 +0200
+++ busybox.4/include/applets.h 2010-05-20 02:05:06.000000000 +0200
@@ -79,6 +79,8 @@ IF_ARPING(APPLET(arping, _BB_DIR_USR_BIN
IF_ASH(APPLET(ash, _BB_DIR_BIN, _BB_SUID_DROP))
IF_AWK(APPLET_NOEXEC(awk, awk, _BB_DIR_USR_BIN, _BB_SUID_DROP, awk))
IF_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_DROP, basename))
+IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, _BB_DIR_BIN, _BB_SUID_DROP, bash))
+IF_FEATURE_BASH_IS_HUSH(APPLET_ODDNAME(bash, hush, _BB_DIR_BIN, _BB_SUID_DROP, bash))
IF_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_DROP))
//IF_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_DROP))
IF_BEEP(APPLET(beep, _BB_DIR_USR_BIN, _BB_SUID_DROP))
diff -ad -urpN busybox.3/include/usage.h busybox.4/include/usage.h
--- busybox.3/include/usage.h 2010-05-17 23:01:23.000000000 +0200
+++ busybox.4/include/usage.h 2010-05-20 02:05:39.000000000 +0200
@@ -123,6 +123,8 @@
#define lash_full_usage ""
#define msh_trivial_usage NOUSAGE_STR
#define msh_full_usage ""
+#define bash_trivial_usage NOUSAGE_STR
+#define bash_full_usage ""
#define awk_trivial_usage \
"[OPTIONS] [AWK_PROGRAM] [FILE]..."
diff -ad -urpN busybox.3/shell/Config.in busybox.4/shell/Config.in
--- busybox.3/shell/Config.in 2010-05-17 23:01:23.000000000 +0200
+++ busybox.4/shell/Config.in 2010-05-20 02:03:05.000000000 +0200
@@ -6,11 +6,11 @@
menu "Shells"
choice
- prompt "Choose your default shell"
+ prompt "Choose which shell is aliased to 'sh' name"
default FEATURE_SH_IS_NONE
help
- Choose a shell. The ash shell is the most bash compatible
- and full featured one.
+ Choose which shell you want to be executed by 'sh' alias.
+ The ash shell is the most bash compatible and full featured one.
config FEATURE_SH_IS_ASH
select ASH
@@ -21,15 +21,38 @@ config FEATURE_SH_IS_HUSH
select HUSH
bool "hush"
-####config FEATURE_SH_IS_LASH
-#### select LASH
-#### bool "lash"
+config FEATURE_SH_IS_NONE
+ bool "none"
-####config FEATURE_SH_IS_MSH
-#### select MSH
-#### bool "msh"
+endchoice
-config FEATURE_SH_IS_NONE
+choice
+ prompt "Choose which shell is aliased to 'bash' name"
+ default FEATURE_BASH_IS_NONE
+ help
+ Choose which shell you want to be executed by 'bash' alias.
+ The ash shell is the most bash compatible and full featured one.
+
+ Note that selecting this option does not switch on any bash
+ compatibility code. It merely makes it possible to install
+ /bin/bash (sym)link and run scripts which start with
+ #!/bin/bash line.
+
+ Many systems use it in scripts which use bash-specific features,
+ even simple ones like $RANDOM. Without this option, busybox
+ can't be used for running them because it won't recongnize
+ "bash" as a supported applet name.
+
+config FEATURE_BASH_IS_ASH
+ select ASH
+ bool "ash"
+ depends on !NOMMU
+
+config FEATURE_BASH_IS_HUSH
+ select HUSH
+ bool "hush"
+
+config FEATURE_BASH_IS_NONE
bool "none"
endchoice
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic