[ELDK] [PATCH] Use separate directories for conflicting busybox links

Wolfgang Denk wd at denx.de
Thu Apr 29 13:51:06 CEST 2010

Sometimes there are reasons to install the full-featured tool versions
for commands also provided by BusyBox.  So far, the implementation
would resolve the resulting conflicts by renaming the full-featured
tools and issuing a warning like this:

Warning: renaming conflicting binary to /usr/bin/foo.nonbb

Renaming the BusyBox version of the command does not work, as BusyBox
would not recognize such unexpected command names.

On the other hand, if someone decides to install such full-featured
tool versions he probably does because he wants to use these instead
of the BusyBox version, so the renaming is sub-optimal (especially in
cases with well-know path names like /bin/sh etc.).

This commit changes the behaviour and will create the BusyBox links in
special "bb" subdirectories and issue a warning like this:

Warning: creating conflicting link as /usr/bin/bb/foo

Signed-off-by: Wolfgang Denk <wd at denx.de>
Cc: Detlev Zundel <dzu at denx.de>
 Makefile |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 62ceb2b..dc7601c 100644
--- a/Makefile
+++ b/Makefile
@@ -193,10 +193,14 @@ $(STAMP_ELDK_PKGS):	$(STAMP_RFSB_SKEL)
 			ln -sf /sbin/busybox bin/busybox ;\
 			while read lnk; do \
 				if [ -r ./$$lnk ]; then \
-					echo "Warning: renaming conflicting binary to $$lnk.nonbb" ; \
-					mv ./$$lnk ./$$lnk.nonbb ;\
+					dname=`dirname $$lnk`/bb ;\
+					fname=`basename $$lnk` ;\
+					echo "Warning: creating conflicting link as $$dname/$$fname" ;\
+					mkdir -p ./$$dname ;\
+					ln -s /sbin/busybox ./$$dname/$$fname ;\
+				else \
+					ln -s /sbin/busybox ./$$lnk ;\
 				fi ; \
-				ln -sf /sbin/busybox ./$$lnk ;\
 			done < $$bblinks ;\
 		fi \

More information about the eldk mailing list