blob: 8cfae3740cd9afc2dafc8517fe4e753d5f3824c7 [file] [log] [blame]
Eric Anderseneded54b1999-11-12 08:03:23 +00001#!/bin/sh
2
Eric Andersene5db4062000-07-25 16:47:03 +00003prefix=$1
4if [ "$prefix" = "" ]; then
Eric Andersena9c95ea1999-11-15 17:33:30 +00005 echo "No installation directory, aborting."
Eric Anderseneded54b1999-11-12 08:03:23 +00006 exit 1;
7fi
Eric Andersen51154ba2000-07-20 21:57:11 +00008if [ "$2" = "--hardlinks" ]; then
9 linkopts="-f"
10else
11 linkopts="-fs"
12fi
Eric Andersena9c95ea1999-11-15 17:33:30 +000013h=`sort busybox.links | uniq`
Eric Anderseneded54b1999-11-12 08:03:23 +000014
Eric Andersen51154ba2000-07-20 21:57:11 +000015
Pavel Roskin259972e2000-07-28 19:34:02 +000016rm -f $prefix/bin/busybox || exit 1
17mkdir -p $prefix/bin || exit 1
18install -m 755 busybox $prefix/bin/busybox || exit 1
Eric Anderseneded54b1999-11-12 08:03:23 +000019
Eric Andersen51154ba2000-07-20 21:57:11 +000020for i in $h ; do
21 appdir=`dirname $i`
Pavel Roskin259972e2000-07-28 19:34:02 +000022 mkdir -p $prefix/$appdir || exit 1
Eric Andersen51154ba2000-07-20 21:57:11 +000023 if [ "$2" = "--hardlinks" ]; then
24 bb_path="$prefix/bin/busybox"
25 else
26 case "$appdir" in
27 /)
28 bb_path="bin/busybox"
29 ;;
30 /bin)
31 bb_path="busybox"
32 ;;
33 /sbin)
34 bb_path="../bin/busybox"
35 ;;
36 /usr/bin|/usr/sbin)
37 bb_path="../../bin/busybox"
38 ;;
39 *)
40 echo "Unknown installation directory: $appdir"
41 exit 1
42 ;;
43 esac
44 fi
Pavel Roskin259972e2000-07-28 19:34:02 +000045 echo " $prefix$i -> $bb_path"
46 ln $linkopts $bb_path $prefix$i || exit 1
Eric Andersen51154ba2000-07-20 21:57:11 +000047done
48
Eric Andersencb41c2e1999-11-22 07:41:00 +000049exit 0