Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(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

This comment has been minimized.

Copy link

@myii 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
You can’t perform that action at this time.