Bug 10801 - applets/install.sh handles hardlinks incorrectly
Summary: applets/install.sh handles hardlinks incorrectly
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.28.x
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-23 01:33 UTC by opal hart
Modified: 2018-02-23 15:32 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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