Skip to content

Instantly share code, notes, and snippets.

@azkadev
Forked from qb0C80aE/android_chroot.sh
Created August 9, 2024 23:41
Show Gist options
  • Save azkadev/6ddd20a44056a00c0ca47ea1cf9fa172 to your computer and use it in GitHub Desktop.
Save azkadev/6ddd20a44056a00c0ca47ea1cf9fa172 to your computer and use it in GitHub Desktop.
run linux on android by chroot in case that android device doesn't have enought free space.
#!/system/bin/sh
cd /data/local/tmp
mount -o bind /dev /data/local/tmp/linux_root/dev
mount -o bind /dev/pts /data/local/tmp/linux_root/dev/pts
mount -t sysfs /sys /data/local/tmp/linux_root/sys
mount -t proc /proc /data/local/tmp/linux_root/proc
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/system/bin:/system/xbin
export TERM=xterm
export HOME=/root
chroot /data/local/tmp/linux_root /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment