diff options
Diffstat (limited to 'applets')
-rwxr-xr-x | applets/install.sh | 44 |
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 | ||
3 | set -e | 3 | set -e |
4 | 4 | set -x | |
5 | if [ "$1" = "" ]; then | 5 | if [ "$1" = "" ]; then |
6 | echo "No installation directory, aborting." | 6 | echo "No installation directory, aborting." |
7 | exit 1; | 7 | exit 1; |
8 | fi | 8 | fi |
9 | 9 | if [ "$2" = "--hardlinks" ]; then | |
10 | linkopts="-f" | ||
11 | else | ||
12 | linkopts="-fs" | ||
13 | fi | ||
14 | prefix=$1 | ||
10 | h=`sort busybox.links | uniq` | 15 | h=`sort busybox.links | uniq` |
11 | 16 | ||
12 | for 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 | ||
16 | done | ||
17 | rm -f $1/bin/busybox | 18 | rm -f $1/bin/busybox |
18 | mkdir -p $1/bin | 19 | mkdir -p $1/bin |
19 | install -m 755 busybox $1/bin/busybox | 20 | install -m 755 busybox $1/bin/busybox |
20 | 21 | ||
22 | for 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 | ||
49 | done | ||
50 | |||
21 | exit 0 | 51 | exit 0 |