#! /bin/bash
set -e
set -x

# 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
cd /mnt/pd0
mkdir debugger
mkdir debugger/out
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
echo -e "\nexport PATH=/mnt/pd0/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"

#! /bin/bash
set -e
set -x

# Fix GPG Keys.
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

# 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 libpng-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
cd /mnt/pd0
mkdir debugger
mkdir debugger/out
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
echo -e "\nexport PATH=/mnt/pd0/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"

Fix packages and setup script.
[debugger] Fix packages and setup script.

Bug: skia:
Change-Id: I49b3c8a81780fce0029c948f24983b8305a7c5ca
Reviewed-on: https://skia-review.googlesource.com/128141
Reviewed-by: Stephan Altmueller <43343ec95731c0e8daa7359daf7f2f3935582b24@google.com>
Commit-Queue: Joe Gregorio <b9cf2471ff6d33504cafe8e6f356b732b2cadced@google.com>
