The attached patch allows to change the name of the main busybox binary to something other than "busybox". This makes it easy to have two or more busybox binaries (different versions, different feature sets, etc.) installed in the same filesystem.
The patch adds a new config option (CONFIG_BINARY_NAME), and changes Makefile.custom to pass its value to applets/install.sh. Tobias
diff -ur busybox-1.18.3.orig/Config.in busybox-1.18.3/Config.in --- busybox-1.18.3.orig/Config.in 2011-02-08 18:24:57.000000000 +0100 +++ busybox-1.18.3/Config.in 2011-03-01 21:42:50.875516023 +0100 @@ -732,6 +732,13 @@ help Define your directory to install BusyBox files/subdirs in. +config BINARY_NAME + string "BusyBox binary name" + default "busybox" + help + Choose a name for the main busybox program file. Traditionally, + this is just "busybox". + endmenu source libbb/Config.in diff -ur busybox-1.18.3.orig/Makefile.custom busybox-1.18.3/Makefile.custom --- busybox-1.18.3.orig/Makefile.custom 2011-02-04 14:12:01.000000000 +0100 +++ busybox-1.18.3/Makefile.custom 2011-03-01 21:47:56.960380091 +0100 @@ -25,7 +25,7 @@ endif install: $(srctree)/applets/install.sh busybox busybox.links $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \ - $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS) + bb_bin=$(CONFIG_BINARY_NAME) $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS) ifeq ($(strip $(CONFIG_FEATURE_SUID)),y) @echo @echo diff -ur busybox-1.18.3.orig/applets/install.sh busybox-1.18.3/applets/install.sh --- busybox-1.18.3.orig/applets/install.sh 2011-02-04 14:12:01.000000000 +0100 +++ busybox-1.18.3/applets/install.sh 2011-03-01 21:48:18.094541750 +0100 @@ -24,6 +24,10 @@ *) echo "Unknown install option: $2"; exit 1;; esac +if [ -z "$bb_bin" ]; then + bb_bin="busybox" +fi + if [ -n "$DO_INSTALL_LIBS" ] && [ "$DO_INSTALL_LIBS" != "n" ]; then # get the target dir for the libs # assume it starts with lib @@ -43,8 +47,8 @@ done fi -if [ "$cleanup" = "1" ] && [ -e "$prefix/bin/busybox" ]; then - inode=`ls -i "$prefix/bin/busybox" | awk '{print $1}'` +if [ "$cleanup" = "1" ] && [ -e "$prefix/bin/$bb_bin" ]; then + inode=`ls -i "$prefix/bin/$bb_bin" | awk '{print $1}'` sub_shell_it=` cd "$prefix" for d in usr/sbin usr/bin sbin bin; do @@ -59,38 +63,38 @@ exit 0 fi -rm -f $prefix/bin/busybox || exit 1 +rm -f $prefix/bin/$bb_bin || exit 1 mkdir -p $prefix/bin || exit 1 -install -m 755 busybox $prefix/bin/busybox || exit 1 +install -m 755 busybox $prefix/bin/$bb_bin || exit 1 for i in $h; do appdir=`dirname $i` mkdir -p $prefix/$appdir || exit 1 if [ "$scriptwrapper" = "y" ]; then if [ "$swrapall" != "y" ] && [ "$i" = "/bin/sh" ]; then - ln $linkopts busybox $prefix$i || exit 1 + ln $linkopts $bb_bin $prefix$i || exit 1 else rm -f $prefix$i - echo "#!/bin/busybox" > $prefix$i + echo "#!/bin/$bb_bin" > $prefix$i chmod +x $prefix/$i fi echo " $prefix$i" else if [ "$2" = "--hardlinks" ]; then - bb_path="$prefix/bin/busybox" + bb_path="$prefix/bin/$bb_bin" else case "$appdir" in /) - bb_path="bin/busybox" + bb_path="bin/$bb_bin" ;; /bin) - bb_path="busybox" + bb_path="$bb_bin" ;; /sbin) - bb_path="../bin/busybox" + bb_path="../bin/$bb_bin" ;; /usr/bin|/usr/sbin) - bb_path="../../bin/busybox" + bb_path="../../bin/$bb_bin" ;; *) echo "Unknown installation directory: $appdir"
_______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox