aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
Diffstat (limited to 'applets')
-rwxr-xr-xapplets/install.sh44
1 files changed, 37 insertions, 7 deletions
diff --git a/applets/install.sh b/applets/install.sh
index 65190f59d..236f62a56 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -1,21 +1,51 @@
1#!/bin/sh 1#!/bin/sh
2 2
3set -e 3set -e
4 4set -x
5if [ "$1" = "" ]; then 5if [ "$1" = "" ]; then
6 echo "No installation directory, aborting." 6 echo "No installation directory, aborting."
7 exit 1; 7 exit 1;
8fi 8fi
9 9if [ "$2" = "--hardlinks" ]; then
10 linkopts="-f"
11else
12 linkopts="-fs"
13fi
14prefix=$1
10h=`sort busybox.links | uniq` 15h=`sort busybox.links | uniq`
11 16
12for i in $h ; do 17
13 echo " $1$i -> /bin/busybox"
14 mkdir -p $1/`echo $i | sed -e 's/\/[^\/]*$//' `
15 ln -fs /bin/busybox $1$i
16done
17rm -f $1/bin/busybox 18rm -f $1/bin/busybox
18mkdir -p $1/bin 19mkdir -p $1/bin
19install -m 755 busybox $1/bin/busybox 20install -m 755 busybox $1/bin/busybox
20 21
22for i in $h ; do
23 appdir=`dirname $i`
24 mkdir -p $prefix/$appdir
25 if [ "$2" = "--hardlinks" ]; then
26 bb_path="$prefix/bin/busybox"
27 else
28 case "$appdir" in
29 /)
30 bb_path="bin/busybox"
31 ;;
32 /bin)
33 bb_path="busybox"
34 ;;
35 /sbin)
36 bb_path="../bin/busybox"
37 ;;
38 /usr/bin|/usr/sbin)
39 bb_path="../../bin/busybox"
40 ;;
41 *)
42 echo "Unknown installation directory: $appdir"
43 exit 1
44 ;;
45 esac
46 fi
47 echo " $prefix$i -> /bin/busybox"
48 ln $linkopts $bb_path $prefix$i
49done
50
21exit 0 51exit 0