diff --git a/.zsh/40_function.zsh b/.zsh/40_function.zsh index fe9f407..40c74be 100755 --- a/.zsh/40_function.zsh +++ b/.zsh/40_function.zsh @@ -232,6 +232,16 @@ croot () fi } +syswrite () +{ + adb wait-for-device && adb root || return 1; + if [[ -n $(adb disable-verity | grep "reboot") ]]; then + echo "rebooting"; + adb reboot && adb wait-for-device && adb root || return 1; + fi; + adb wait-for-device && adb remount || return 1 +} + function zsh_stats() { fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 } @@ -275,10 +285,10 @@ sdocker (){ AOSP_ARGS=${AOSP_ARGS:--it} img=$(docker ps | grep $1 | awk '{print $1}'); if [ -z $img ]; then - img=$(docker ps -a | grep $1 | awk '{print $1}' | head -1); + img=$(docker ps -a | grep -w $1 | awk '{print $1}' | head -1); if [ -z $img ]; then echo "Running a new container" - docker run ${AOSP_ARGS} ${=SSH_AUTH_ARGS} -h $(hostname) -e DISPLAY=${DISPLAY} --privileged -v /dev/bus/usb:/dev/bus/usb -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v ${AOSP_IMAGE}:/aosp/Project -v $HOME/Sources/:/aosp/Sources/ -v /local/:/local/ --user="$(id -u):$(id -g)" $1 + docker run ${AOSP_ARGS} ${=SSH_AUTH_ARGS} -h $(hostname) -e DISPLAY=${DISPLAY} --privileged -v /dev/bus/usb:/dev/bus/usb -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v ${AOSP_IMAGE}:/aosp/Project -v $HOME/Sources/:/aosp/Sources/ -v /local/:/local/ --user="$(id -u):$(id -g)" $1 else echo "Starting $img" docker start -i -a $img