From b9ac69cf577d53bc5849cc1002c2f582320b60d1 Mon Sep 17 00:00:00 2001 From: Budleigh Salterton driving a Miura Date: Mon, 4 Apr 2016 17:54:27 +0200 Subject: [PATCH] privileged is now switchable --- run.sh | 22 +++++++++++++++++++++- startup.sh | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index 861b8dc..af0095d 100755 --- a/run.sh +++ b/run.sh @@ -9,6 +9,26 @@ CONTAINER=cyanogenmod REPOSITORY=stucki/cyanogenmod TAG=cm-13.0 FORCE_BUILD=0 +PRIVILEGED= + +while [[ $# > 0 ]] +do +key="$1" + +case $key in + -r|--rebuild) + FORCE_BUILD=1 + ;; + -p|--privileged) + PRIVILEGED="--privileged -v /dev/bus/usb:/dev/bus/usb" + ;; + *) + shift # past argument or value + ;; +esac +shift + +done # Create shared folders [[ -e "$SOURCE" ]] || mkdir -p $SOURCE @@ -42,7 +62,7 @@ if [[ $IS_RUNNING == "true" ]]; then elif [[ $IS_RUNNING == "false" ]]; then docker start -i $CONTAINER else - docker run --privileged -v $SOURCE:$CONTAINER_HOME/android -v $CCACHE:/srv/ccache -v /dev/bus/usb:/dev/bus/usb -i -t --name $CONTAINER $REPOSITORY:$TAG + docker run $PRIVILEGED -v $SOURCE:$CONTAINER_HOME/android -v $CCACHE:/srv/ccache -i -t --name $CONTAINER $REPOSITORY:$TAG fi exit $? diff --git a/startup.sh b/startup.sh index 6c8dec1..de3362c 100644 --- a/startup.sh +++ b/startup.sh @@ -9,4 +9,4 @@ fi export USER="cmbuild" # Launch screen session -screen -s /bin/bash +/bin/bash --login