...
 
Commits (2)
FROM ubuntu:10.04
MAINTAINER Sylvain Beucler <beuc@beuc.net>
COPY dependencies.sh /usr/src/dependencies.sh
RUN /usr/src/dependencies.sh
RUN useradd android -m -s /bin/bash
USER android
ENV HOME=/home/android
RUN mkdir /home/android/wd/
WORKDIR /home/android/wd/
COPY repo.sh /home/android/repo.sh
RUN /home/android/repo.sh
CMD /bin/bash
.PHONY: all
all:
docker build -t android-rebuilds:sdk-1.6.0 .
if [ ! -e wd/ ]; then mkdir wd/; fi
chown 1000:1000 wd/
cp -a build.sh wd/
docker run -v "$$(pwd)/wd:/home/android/wd" android-rebuilds:sdk-1.6.0 /home/android/wd/build.sh
sys-img:
docker build -t android-rebuilds:sdk-1.6.0 .
if [ ! -e wd/ ]; then mkdir wd/; fi
chown 1000:1000 wd/
cp -a build-sys-img.sh wd/
docker run -v "$$(pwd)/wd:/home/android/wd" android-rebuilds:sdk-1.6.0 /home/android/wd/build-sys-img.sh
#!/bin/bash -ex
VERSION='1.6_r2'
BUILD_VARIANT='userdebug'
export PATH=$HOME/bin:$PATH
~/python2.7/bin/python ~/bin/repo init --quiet -u https://android.googlesource.com/platform/manifest -b android-$VERSION
~/python2.7/bin/python ~/bin/repo sync --quiet --current-branch -j4
export USER=$(whoami)
# https://android.googlesource.com/platform/sdk/+/master/docs/howto_build_SDK.txt
export BUILD_NUMBER="${BUILD_VARIANT}.${VERSION}"
# https://source.android.com/setup/build/building#initialize
. build/envsetup.sh
# https://source.android.com/setup/build/building#choose-a-target
lunch sdk-${BUILD_VARIANT}
# https://source.android.com/setup/build/building#build-the-code
# Can't build sdk and win_sdk on the same 'make':
# build/core/main.mk:392: *** The 'sdk' target may not be specified with any other targets. Stop.
# dist: https://groups.google.com/forum/?fromgroups=#!topic/android-building/Y0xduZPWtUs
# sdk_repo: https://android.googlesource.com/platform/development/+/1c875445b6fc08333872bd295527fd1359b80e78
make -j$(nproc) sdk showcommands dist
#make -j$(nproc) win_sdk showcommands dist sdk_repo
#make -j$(nproc) PRODUCT-sdk_arm64-sdk showcommands dist sdk_repo
#make -j$(nproc) PRODUCT-sdk_x86_64-sdk showcommands dist sdk_repo
#make -j$(nproc) PRODUCT-sdk_x86_64-userdebug sdk showcommands dist sdk_repo
# => build/core/main.mk:436: error: The 'sdk' target may not be specified with any other targets.
ls -lh \
out/host/linux-x86/sdk/sdk/android-sdk_${BUILD_NUMBER}_linux-x86.zip \
out/dist/android-sdk_${BUILD_NUMBER}_linux-x86.zip \
out/host/windows/sdk/sdk/android-sdk_${BUILD_NUMBER}_windows.zip \
out/dist/android-sdk_${BUILD_NUMBER}_windows.zip \
out/dist/sdk-repo*.zip \
out/dist/repo*.xml
# useful?
# out/target/product/generic/sdk-symbols-eng.android.zip
#!/bin/bash -ex
# Configuration
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/00InstallRecommends
# clean-up non-free sources
# AFAICS we need to update the base image as of 2018-11-20 as it's already partially upgraded
cat <<EOF > /etc/apt/sources.list
deb http://old-releases.ubuntu.com/ubuntu/ lucid main universe
deb http://old-releases.ubuntu.com/ubuntu/ lucid-updates main universe
#deb http://security.ubuntu.com/ubuntu/ lucid-security main universe
#deb http://old-releases.ubuntu.com/ubuntu/ lucid-backports main universe
EOF
#dpkg --add-architecture i386
apt-get update
echo 'dash dash/sh boolean false' | debconf-set-selections
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure --pri=high dash
# Java
# Your version is: java version "1.6.0_35".
# The correct version is: 1.5.
#apt-get install -y openjdk-6-jdk
apt-get -y install wget
debconf-set-selections <<'EOF'
sun-java5-jdk shared/accepted-sun-dlj-v1-1 boolean true
EOF
wget --quiet http://old-releases.ubuntu.com/ubuntu/pool/multiverse/s/sun-java5/sun-java5-jdk_1.5.0-22-0ubuntu0.8.04_amd64.deb
wget --quiet http://old-releases.ubuntu.com/ubuntu/pool/multiverse/s/sun-java5/sun-java5-jre_1.5.0-22-0ubuntu0.8.04_all.deb
wget --quiet http://old-releases.ubuntu.com/ubuntu/pool/multiverse/s/sun-java5/sun-java5-bin_1.5.0-22-0ubuntu0.8.04_amd64.deb
wget --quiet http://old-releases.ubuntu.com/ubuntu/pool/multiverse/s/sun-java5/sun-java5-demo_1.5.0-22-0ubuntu0.8.04_amd64.deb
checksumfile=$(mktemp)
cat <<'EOF' > $checksumfile
a5c1c162cdcf7fe9e3188d0ac081a983179a6defacc85d344c87ae298ea0e28 sun-java5-jdk_1.5.0-22-0ubuntu0.8.04_amd64.deb
89866c3c359e71a14d90a6e851c9a09b941a768359fa1e3fdb973c7a8f850f5d sun-java5-jre_1.5.0-22-0ubuntu0.8.04_all.deb
c63b41410819740ee64d255a7198e666c536dfa14dcf50bd816a3318dacac88e sun-java5-bin_1.5.0-22-0ubuntu0.8.04_amd64.deb
5fa084a550371fa8b761144513138cad5f6c60ed53e361674eb02be814f71c9a sun-java5-demo_1.5.0-22-0ubuntu0.8.04_amd64.deb
EOF
sha256sum -c $checksumfile || exit 1
rm -f $checksumfile
dpkg -i \
sun-java5-jdk_1.5.0-22-0ubuntu0.8.04_amd64.deb \
sun-java5-jre_1.5.0-22-0ubuntu0.8.04_all.deb \
sun-java5-bin_1.5.0-22-0ubuntu0.8.04_amd64.deb \
sun-java5-demo_1.5.0-22-0ubuntu0.8.04_amd64.deb \
|| true
apt-get -y -f install
# https://source.android.com/setup/build/initializing
apt-get install -y 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
# Repo
apt-get install -y curl ca-certificates git-core libcurl4-openssl-dev
# Note: neither python2.6 nor python3.1 are supported, need to rebuild Python 2.7
#!/bin/bash -ex
#sudo apt-get install curl ca-certificates git-core python
# Note: neither python2.6 nor python3.1 are supported, need to rebuild Python 2.7
mkdir ~/bin/
# Simulate nproc
cat <<'EOF' > ~/bin/nproc
grep '^processor' /proc/cpuinfo | wc -l
EOF
chmod 755 ~/bin/nproc
# Grab from Ubuntu, because TLS/SSL errors on main Python website :/
(
cd ~
curl http://old-releases.ubuntu.com/ubuntu/pool/main/p/python2.7/python2.7_2.7.13.orig.tar.gz > Python-2.7.13.tgz
# apt-get install libcurl4-openssl-dev
checksumfile=$(mktemp)
cat <<'EOF' > $checksumfile
a4f05a0720ce0fd92626f0278b6b433eee9a6173ddf2bced7957dfb599a5ece1 Python-2.7.13.tgz
EOF
sha256sum -c $checksumfile || exit 1
rm -f $checksumfile
tar xf Python-2.7.13.tgz
cd Python-2.7.13/
mkdir -p build
cd build/
../configure --prefix=$HOME/python2.7/
make -j$(nproc)
make install
# Keep the environment sane
#ln -s ~/python2.7/bin/python ~/bin/
)
# repo: fatal: git 1.7.2 or later required
# Note: not installing the .deb because it depends on newer dpkg-maintscript-helper
(
tmpdir=$(mktemp -d)
cd $tmpdir/
curl http://old-releases.ubuntu.com/ubuntu/pool/main/g/git/git_1.7.4.1-3_amd64.deb > git_1.7.4.1-3_amd64.deb
checksumfile=$(mktemp)
cat <<'EOF' > $checksumfile
06920b4c21050d2adcda621f6994efb21ae091cd7815dbe95cfa77dc27913443 git_1.7.4.1-3_amd64.deb
EOF
sha256sum -c $checksumfile || exit 1
rm -f $checksumfile
ar x git_1.7.4.1-3_amd64.deb
tar xf data.tar.gz
mv usr/bin/git* ~/bin/
rm -rf $tmpdir/
)
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
# avoid prompts and errors
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git config --global color.ui true
......@@ -19,7 +19,7 @@ DEBIAN_FRONTEND=noninteractive dpkg-reconfigure --pri=high dash
# https://source.android.com/setup/build/initializing
# https://source.android.com/setup/build/older-versions#for-ubuntu-14-04
export DEBIAN_FRONTEND=noninteractive
# OpenJDK 8 N/A
#apt-get -y install openjdk-8-jdk
......