aboutsummaryrefslogtreecommitdiff
path: root/tools/rbp
diff options
context:
space:
mode:
authorwsnipex <wsnipex@a1.net>2014-01-31 10:54:08 +0100
committerRainer Hochecker <fernetmenta@online.de>2014-04-27 18:05:02 +0200
commitf68f4f653ba8371035e05f1532c064f2c3525817 (patch)
tree2122b0881181efd5043de4765b49252f53792234 /tools/rbp
parentfe82084c40af493bfb55718196b3e243e7227a64 (diff)
[rpi] setup-sdk.sh: allow overriding of buildroot and xbmc install paths
also don't require root if not needed
Diffstat (limited to 'tools/rbp')
-rwxr-xr-x[-rw-r--r--]tools/rbp/setup-sdk.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/rbp/setup-sdk.sh b/tools/rbp/setup-sdk.sh
index 9da68cbcb6..70f2a36e00 100644..100755
--- a/tools/rbp/setup-sdk.sh
+++ b/tools/rbp/setup-sdk.sh
@@ -5,9 +5,9 @@ SCRIPT_PATH=$(cd `dirname $0` && pwd)
USE_BUILDROOT=1
if [ "$USE_BUILDROOT" = "1" ]; then
- BUILDROOT=/opt/xbmc-bcm/buildroot
- TARBALLS=/opt/xbmc-tarballs
- XBMCPREFIX=/opt/xbmc-bcm/xbmc-bin
+ BUILDROOT=${BUILDROOT:-"/opt/xbmc-bcm/buildroot"}
+ TARBALLS=${TARBALLS:-"/opt/xbmc-tarballs"}
+ XBMCPREFIX=${XBMCPREFIX:-"/opt/xbmc-bcm/xbmc-bin"}
SDKSTAGE=$BUILDROOT/output/staging
TARGETFS=$BUILDROOT/output/target
@@ -21,8 +21,15 @@ else
BUILDROOT=/opt/bcm-rootfs
fi
-sudo mkdir -p $XBMCPREFIX
-sudo chmod 777 $XBMCPREFIX
+if [ -d $XBMCPREFIX ]
+then
+ [ -O $XBMCPREFIX ] || SUDO="sudo"
+else
+ [ -w $(dirname $XBMCPREFIX) ] || SUDO="sudo"
+fi
+
+$SUDO mkdir -p $XBMCPREFIX
+$SUDO chmod 777 $XBMCPREFIX
mkdir -p $XBMCPREFIX/lib
mkdir -p $XBMCPREFIX/include