Skip to content

Instantly share code, notes, and snippets.

@Ingo-FP-Angel
Created November 26, 2018 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ingo-FP-Angel/63927c2d03acddfc89dd5097f5210bbe to your computer and use it in GitHub Desktop.
Save Ingo-FP-Angel/63927c2d03acddfc89dd5097f5210bbe to your computer and use it in GitHub Desktop.
(Re-)Install anbox and adb on Ubuntu Touch (incl. freeing space on system image)
#!/bin/bash -x
SUDO=''
if (( $EUID != 0 )); then
SUDO='sudo'
fi
$SUDO mount -o rw,remount /
$SUDO rm -r /var/cache/apt
$SUDO tune2fs -m 0 /dev/loop0
$SUDO apt update
$SUDO apt -y install anbox-ubuntu-touch android-tools-adb
$SUDO mount -o ro,remount /
@myii
Copy link

myii commented Jan 15, 2019

@Ingo-FP-Angel Following on from my comment in the main Telegram group, how about the following improvement?

RORW_SETTING=$(mount | grep " on / " | cut -d\( -f2 | cut -d, -f1)

if [[ $RORW_SETTING == "ro" ]] ; then
    $SUDO mount -o rw,remount /
fi

...

if [[ $RORW_SETTING == "ro" ]] ; then
    $SUDO mount -o ro,remount /
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment