aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
Diffstat (limited to 'applets')
-rwxr-xr-xapplets/install.sh26
1 files changed, 24 insertions, 2 deletions
diff --git a/applets/install.sh b/applets/install.sh
index 95b4719d4..f6c097e57 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -5,19 +5,26 @@ export LC_CTYPE=POSIX
5 5
6prefix=$1 6prefix=$1
7if [ -z "$prefix" ]; then 7if [ -z "$prefix" ]; then
8 echo "usage: applets/install.sh DESTINATION [--symlinks/--hardlinks/--scriptwrapper]" 8 echo "usage: applets/install.sh DESTINATION [--symlinks/--hardlinks/--binaries/--scriptwrapper]"
9 exit 1 9 exit 1
10fi 10fi
11 11
12# Source the configuration
13. ./.config
14
12h=`sort busybox.links | uniq` 15h=`sort busybox.links | uniq`
13 16
17sharedlib_dir="0_lib"
18
14linkopts="" 19linkopts=""
15scriptwrapper="n" 20scriptwrapper="n"
21binaries="n"
16cleanup="0" 22cleanup="0"
17noclobber="0" 23noclobber="0"
18case "$2" in 24case "$2" in
19 --hardlinks) linkopts="-f";; 25 --hardlinks) linkopts="-f";;
20 --symlinks) linkopts="-fs";; 26 --symlinks) linkopts="-fs";;
27 --binaries) binaries="y";;
21 --scriptwrapper) scriptwrapper="y";swrapall="y";; 28 --scriptwrapper) scriptwrapper="y";swrapall="y";;
22 --sw-sh-hard) scriptwrapper="y";linkopts="-f";; 29 --sw-sh-hard) scriptwrapper="y";linkopts="-f";;
23 --sw-sh-sym) scriptwrapper="y";linkopts="-fs";; 30 --sw-sh-sym) scriptwrapper="y";linkopts="-fs";;
@@ -40,8 +47,9 @@ if [ -n "$DO_INSTALL_LIBS" ] && [ "$DO_INSTALL_LIBS" != "n" ]; then
40 for i in $DO_INSTALL_LIBS; do 47 for i in $DO_INSTALL_LIBS; do
41 rm -f "$prefix/$libdir/$i" || exit 1 48 rm -f "$prefix/$libdir/$i" || exit 1
42 if [ -f "$i" ]; then 49 if [ -f "$i" ]; then
50 echo " Installing $i to the target at $prefix/$libdir/"
43 cp -pPR "$i" "$prefix/$libdir/" || exit 1 51 cp -pPR "$i" "$prefix/$libdir/" || exit 1
44 chmod 0644 "$prefix/$libdir/$i" || exit 1 52 chmod 0644 "$prefix/$libdir/`basename $i`" || exit 1
45 fi 53 fi
46 done 54 done
47fi 55fi
@@ -68,6 +76,7 @@ install -m 755 busybox "$prefix/bin/busybox" || exit 1
68 76
69for i in $h; do 77for i in $h; do
70 appdir=`dirname "$i"` 78 appdir=`dirname "$i"`
79 app=`basename "$i"`
71 mkdir -p "$prefix/$appdir" || exit 1 80 mkdir -p "$prefix/$appdir" || exit 1
72 if [ "$scriptwrapper" = "y" ]; then 81 if [ "$scriptwrapper" = "y" ]; then
73 if [ "$swrapall" != "y" ] && [ "$i" = "/bin/sh" ]; then 82 if [ "$swrapall" != "y" ] && [ "$i" = "/bin/sh" ]; then
@@ -78,6 +87,19 @@ for i in $h; do
78 chmod +x "$prefix/$i" 87 chmod +x "$prefix/$i"
79 fi 88 fi
80 echo " $prefix/$i" 89 echo " $prefix/$i"
90 elif [ "$binaries" = "y" ]; then
91 # Copy the binary over rather
92 if [ -e $sharedlib_dir/$app ]; then
93 if [ "$noclobber" = "0" ] || [ ! -e "$prefix/$i" ]; then
94 echo " Copying $sharedlib_dir/$app to $prefix/$i"
95 cp -pPR $sharedlib_dir/$app $prefix/$i || exit 1
96 else
97 echo " $prefix/$i already exists"
98 fi
99 else
100 echo "Error: Could not find $sharedlib_dir/$app"
101 exit 1
102 fi
81 else 103 else
82 if [ "$2" = "--hardlinks" ]; then 104 if [ "$2" = "--hardlinks" ]; then
83 bb_path="$prefix/bin/busybox" 105 bb_path="$prefix/bin/busybox"