Chroot from android into environment as user

0

I'm trying to use my android tablet as a dev environment. So far I have created an Arch and Ubuntu img. I can chroot into both just fine and I have created a user using adduser, but I do not know how to log in. The android shell doesn't have schroot and I can't, or if I can I don't know how to, install it.

Is there a way to schroot into a system from the chroot of that same system?

Lastly the reason I prefer this method to SSH is because I cannot connect to the SSH localhost while offline.

CogDissonance

Posted 2013-06-19T00:10:57.417

Reputation: 1

Answers

0

I found out how to do this by following this tutorial.

Incase something happens with the sight I'll post the method here:

Setup the environment:

su
bash
cd /data/local/
mkdir arch
cd arch
wget http://archlinuxarm.org/os/ArchLinuxARM-omap-smp-latest.tar.gz
tar xzf Arch*.tar.gz
rm Arch*.tar.gz
mount -o bind /dev dev
mount -t proc proc proc
mount -t sysfs sysfs sys
ln -s /proc/self/fd dev/fd
echo "nameserver 8.8.8.8" >> /data/local/arch/etc/resolv.conf

Enter the environment:

chroot . /bin/bash
source /etc/profile
export TERM=xterm-256color
export HOME=/root
mount /dev/pts
pacman -Syuu
useradd -m -G wheel,net_raw lrvick # your username here obviously

This is the part I was missing:

Setup an Init script:

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 dev/pts
fi

chroot . /bin/bash -c "source /etc/profile; export HOME=/home/${USER}; export TERM=xterm-256color; clear; su - ${USER}"

worked beautifully. Logged in as user now on every start and can setup my dev environment :D

CogDissonance

Posted 2013-06-19T00:10:57.417

Reputation: 1