Skip to content

Instantly share code, notes, and snippets.

@qb0C80aE
Last active August 9, 2024 23:41
Show Gist options
  • Save qb0C80aE/c65afb5dbf83c4b27b0b to your computer and use it in GitHub Desktop.
Save qb0C80aE/c65afb5dbf83c4b27b0b 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