blob: 96a62e93a7fed1f3ac23f55f1b24b52f38564461 [file] [log] [blame]
#! /bin/bash
set -x
/tmp/format_and_mount.sh skia-fiddle
# The same set of packages need to be installed both on the instance and within the container.
PACKAGES="systemd-container git debootstrap build-essential libosmesa-dev libfreetype6-dev libfontconfig-dev libpng12-dev libgif-dev libqt4-dev mesa-common-dev"
sudo apt-get update
sudo apt-get --assume-yes upgrade
sudo apt-get --assume-yes install ${PACKAGES}
# Install depot_tools
mkdir --parents /mnt/pd0/fiddle
cd /mnt/pd0/fiddle
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
echo -e "\nexport PATH=/mnt/pd0/fiddle/depot_tools:\$PATH" >> ~/.bashrc
# Build the containter
CONTAINER=/mnt/pd0/container
sudo debootstrap --arch=amd64 wily --include=${PACKAGES// /,} /mnt/pd0/container
sudo rm $CONTAINER/etc/machine-id
sudo rm $CONTAINER/etc/resolv.conf
echo "nameserver 8.8.8.8" > $CONTAINER/etc/resolv.conf
echo "Set the root password for root on the container."
echo "By running:"
echo " sudo systemd-nspawn -D /mnt/pd0/container"
echo " passwd"