-
-
Save bmcgavin/2759578 to your computer and use it in GitHub Desktop.
Chrooted Arch Linux environment setup script for Android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USER='lrvick' | |
cd /data/local/arch | |
if ! mountpoint -q dev; then | |
mount -t proc /proc proc | |
mount -o bind /dev dev | |
mount -o bind /dev/pts /data/local/arch/dev/pts | |
fi | |
if `mount | grep ' /data ' | grep nosuid -q`; then | |
mount -o remount,suid /data | |
fi | |
chroot . /bin/bash -c "source /etc/profile; export HOME=/home/${USER}; export TERM=xterm-256color; clear; su - ${USER}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was a good basis for mine...
!/bin/bash
USER="root"
if ! busybox mountpoint -q dev; then
busybox mount -o bind /dev /data/archlinux/dev
busybox mount -o bind /dev/pts /data/archlinux/dev/pts
busybox mount -o bind /dev/shm /data/archlinux/dev/shm
busybox mount -t proc none /data/archlinux/proc
busybox mount -t sysfs none /data/archlinux/sys
busybox mount -o bind /sdcard /data/archlinux/media/disk
fi
rm /data/archlinux/etc/resolv.conf
cp /etc/resolv.conf /data/archlinux/etc/resolv.conf
chroot /data/archlinux /bin/bash -c "source /etc/profile; export HOME=/home/${USER}; export TERM=xterm-256color; clear; su - ${USER}"