- echo " $1$i -> /bin/busybox"
- mkdir -p $1/`echo $i | sed -e 's/\/[^\/]*$//' `
- ln -fs /bin/busybox $1$i
+ appdir=`dirname $i`
+ mkdir -p $prefix/$appdir || exit 1
+ if [ "$2" = "--hardlinks" ]; then
+ bb_path="$prefix/bin/busybox"
+ else
+ case "$appdir" in
+ /)
+ bb_path="bin/busybox"
+ ;;
+ /bin)
+ bb_path="busybox"
+ ;;
+ /sbin)
+ bb_path="../bin/busybox"
+ ;;
+ /usr/bin|/usr/sbin)
+ bb_path="../../bin/busybox"
+ ;;
+ *)
+ echo "Unknown installation directory: $appdir"
+ exit 1
+ ;;
+ esac
+ fi
+ echo " $prefix$i -> $bb_path"
+ ln $linkopts $bb_path $prefix$i || exit 1