Skip to content

Instantly share code, notes, and snippets.

@SkypLabs
Created May 25, 2018 19:56
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 SkypLabs/af5e18de8bbb846438f45315552007c8 to your computer and use it in GitHub Desktop.
Save SkypLabs/af5e18de8bbb846438f45315552007c8 to your computer and use it in GitHub Desktop.
Script used to chroot into a Debian system from an Android system - See https://blog.skyplabs.net/2012/01/20/allier-android-en-gui-et-debian-en-cli-sur-la-asus-transformer-prime/ (French)
ROOT=/data/local/tmp/mydebian
BB=/system/xbin
if ! ls $ROOT/proc/1 > /dev/null
then
$BB/mount --bind /dev $ROOT/dev
$BB/mount --bind /proc $ROOT/proc
$BB/mount --bind /sys $ROOT/sys
$BB/mount --bind /dev/pts $ROOT/dev/pts
fi
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
$BB/chroot $ROOT /bin/su -c "/bin/bash"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment