blob: 236f62a568e32c71d2426b0a36a0d755fdd05177 [file] [log] [blame]
Eric Anderseneded54b1999-11-12 08:03:23 +00001#!/bin/sh
2
Eric Andersena9c95ea1999-11-15 17:33:30 +00003set -e
Eric Andersen51154ba2000-07-20 21:57:11 +00004set -x
Erik Andersen9ffdaa62000-02-11 21:55:04 +00005if [ "$1" = "" ]; then
Eric Andersena9c95ea1999-11-15 17:33:30 +00006 echo "No installation directory, aborting."
Eric Anderseneded54b1999-11-12 08:03:23 +00007 exit 1;
8fi
Eric Andersen51154ba2000-07-20 21:57:11 +00009if [ "$2" = "--hardlinks" ]; then
10 linkopts="-f"
11else
12 linkopts="-fs"
13fi
14prefix=$1
Eric Andersena9c95ea1999-11-15 17:33:30 +000015h=`sort busybox.links | uniq`
Eric Anderseneded54b1999-11-12 08:03:23 +000016
Eric Andersen51154ba2000-07-20 21:57:11 +000017
Eric Anderseneded54b1999-11-12 08:03:23 +000018rm -f $1/bin/busybox
Erik Andersen9a8195c2000-04-18 23:32:10 +000019mkdir -p $1/bin
Eric Anderseneded54b1999-11-12 08:03:23 +000020install -m 755 busybox $1/bin/busybox
21
Eric Andersen51154ba2000-07-20 21:57:11 +000022for 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
Eric Andersencb41c2e1999-11-22 07:41:00 +000051exit 0