Skip to content

Instantly share code, notes, and snippets.

@joekickass
Created September 19, 2012 13:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joekickass/3749558 to your computer and use it in GitHub Desktop.
Save joekickass/3749558 to your computer and use it in GitHub Desktop.
Schroot for Android development
[ubuntu-lucid]
description=Ubuntu
type=directory
directory=/var/chroot/ubuntu
users=myusername
root-users=myusername
aliases=lucid,default
sudo debootstrap --arch amd64 lucid </path/to/target/directory/> http://au.archive.ubuntu.com/ubuntu/
# E.g. sudo debootstrap --arch amd64 lucid /var/chroot/ubuntu http://au.archive.ubuntu.com/ubuntu/
mkdir ~/tmpdir && cd ~/tmpdir
wget https://aur.archlinux.org/packages/de/debootstrap/debootstrap.tar.gz
tar -zxvf debootstrap.tar.gz
cd debootstrap
makepkg
sudo pacman -U debootstrap-1.0.42-1-any.pkg.tar.xz
cd ~
cd /opt
cp <path/to/downloaded java installer> /opt
chmod 755 jdk-6u35-linux-x64.bin
./jdk-6u35-linux-x64.bin
update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.6.0_35/jre/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/opt/jdk1.6.0_35/bin/javac" 1
update-alternatives --set java /opt/jdk1.6.0_35/jre/bin/java
update-alternatives --set javac /opt/jdk1.6.0_35/bin/javac
pacman -S schroot
apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc
ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
# Exit schroot as user root
exit
# Enter schroot as user <username>
schroot -c ubuntu-lucid -u <username>
# Set path to JDK (for finding e.g. jar)
export PATH=/opt/jdk1.6.0_35/bin:$PATH
# System databases to copy into the chroot from the host system.
#
# <database name>
passwd
shadow
group
gshadow
services
protocols
#networks
hosts
schroot -c ubuntu-lucid -u root
#############################################################
################### OFFICIAL UBUNTU REPOS ###################
#############################################################
###### Ubuntu Main Repos
deb http://se.archive.ubuntu.com/ubuntu/ lucid main universe multiverse
###### Ubuntu Update Repos
deb http://se.archive.ubuntu.com/ubuntu/ lucid-security main universe multiverse
deb http://se.archive.ubuntu.com/ubuntu/ lucid-updates main universe multiverse
###### Ubuntu Partner Repo
deb http://archive.canonical.com/ubuntu lucid partner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment