Eric Andersen | eded54b | 1999-11-12 08:03:23 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Eric Andersen | a9c95ea | 1999-11-15 17:33:30 +0000 | [diff] [blame] | 3 | set -e |
Eric Andersen | 51154ba | 2000-07-20 21:57:11 +0000 | [diff] [blame^] | 4 | set -x |
Erik Andersen | 9ffdaa6 | 2000-02-11 21:55:04 +0000 | [diff] [blame] | 5 | if [ "$1" = "" ]; then |
Eric Andersen | a9c95ea | 1999-11-15 17:33:30 +0000 | [diff] [blame] | 6 | echo "No installation directory, aborting." |
Eric Andersen | eded54b | 1999-11-12 08:03:23 +0000 | [diff] [blame] | 7 | exit 1; |
| 8 | fi |
Eric Andersen | 51154ba | 2000-07-20 21:57:11 +0000 | [diff] [blame^] | 9 | if [ "$2" = "--hardlinks" ]; then |
| 10 | linkopts="-f" |
| 11 | else |
| 12 | linkopts="-fs" |
| 13 | fi |
| 14 | prefix=$1 |
Eric Andersen | a9c95ea | 1999-11-15 17:33:30 +0000 | [diff] [blame] | 15 | h=`sort busybox.links | uniq` |
Eric Andersen | eded54b | 1999-11-12 08:03:23 +0000 | [diff] [blame] | 16 | |
Eric Andersen | 51154ba | 2000-07-20 21:57:11 +0000 | [diff] [blame^] | 17 | |
Eric Andersen | eded54b | 1999-11-12 08:03:23 +0000 | [diff] [blame] | 18 | rm -f $1/bin/busybox |
Erik Andersen | 9a8195c | 2000-04-18 23:32:10 +0000 | [diff] [blame] | 19 | mkdir -p $1/bin |
Eric Andersen | eded54b | 1999-11-12 08:03:23 +0000 | [diff] [blame] | 20 | install -m 755 busybox $1/bin/busybox |
| 21 | |
Eric Andersen | 51154ba | 2000-07-20 21:57:11 +0000 | [diff] [blame^] | 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 | |
Eric Andersen | cb41c2e | 1999-11-22 07:41:00 +0000 | [diff] [blame] | 51 | exit 0 |