Bug 10801

Summary: applets/install.sh handles hardlinks incorrectly
Product: Busybox Reporter: opal hart <opal>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.28.x   
Target Milestone: ---   
Hardware: All   
OS: All   
Host: Target:
Build:

Description opal hart 2018-02-23 01:33:19 UTC
Trying to install busybox with hardlinks and a custom PREFIX will fail for applets not in the /bin directory, because relative pathnames are used. applets/install.sh is *supposed to* use the absolute pathname for hardlinks but it fails to do so because the wrong check is used in the if statement. Patch below fixes it.

diff --git a/applets/install.sh b/applets/install.sh                                                                                                                                                                                          
index ae99381d7..c6f23c7e4 100755                                                                                                                                                                                                             
--- a/applets/install.sh                                                                                                                                                                                                                      
+++ b/applets/install.sh                                                                                                                                                                                                                      
@@ -105,7 +105,7 @@ for i in $h; do                                                                                                                                                                                                           
                        exit 1                                                                                                                                                                                                                
                fi                                                                                                                                                                                                                            
        else                                                                                                                                                                                                                                  
-               if [ "$2" = "--hardlinks" ]; then                                                                                                                                                                                             
+               if [ "$linkopts" = "-f" ]; then                                                                                                                                                                                               
                        bb_path="$prefix/bin/busybox"                                                                                                                                                                                         
                else                                                                                                                                                                                                                          
                        case "$appdir" in
Comment 1 Denys Vlasenko 2018-02-23 15:32:11 UTC
Fixed in git, thanks