2
# This file is part of Checkbox.
4
# Copyright 2013 Canonical Ltd.
6
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
8
# Checkbox is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License version 3,
10
# as published by the Free Software Foundation.
13
# Checkbox is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
21
# Helper script to provision vagrant image
22
# ========================================
24
# Set CHECKBOX_TOP for all shared scripts
25
export CHECKBOX_TOP=/vagrant
27
# Make sure that dpkg never stops to have a chat with the user
28
export DEBIAN_FRONTEND=noninteractive
30
# Vagrant sanity check, see if /vagrant really works.
32
# On various installations of Ubuntu this is not the case as the cloud images
33
# we depend on seem to have broken virtualbox tools installation inside. This
34
# causes the filesystem mounted on /vagrant to crash horribly and kill all
35
# processes attempting to use it.
36
if ! find /vagrant -mindepth 1 -maxdepth 1 >/dev/null; then
38
E: It seems that /vagrant directory is broken
39
E: This is a known issue.
40
E: See this link for a workaround if you have recent-enough VirtualBox:
41
E: https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1252872
42
E: Alternatively you can use NFS on any version of VirtualBox:
43
E: http://docs.vagrantup.com/v2/synced-folders/nfs.html
47
echo "I: it seems that /vagrant is working okay"
50
# Add any necessary PPA repositories
51
$CHECKBOX_TOP/support/install-ppa-dependencies
53
# Update to have the latest packages, this is needed because the image comes
54
# with an old (and no longer working) apt cache and links to many packages no
55
# longer work. This is also needed if the step above actually added any PPAs.
58
# Update all packages to latest version
59
# NOTE: this is disabled as it takes a lot of time and we haven't found the
60
# need to run this. It might have to be re-enabled later if we find that some
61
# bug (that gets fixed) is affecting our behavior but so far that has not been
63
# apt-get dist-upgrade --yes
65
# Ensure that certain Debian dependencies are *not* installed
66
$CHECKBOX_TOP/support/remove-deb-anty-dependencies
69
$CHECKBOX_TOP/support/install-deb-dependencies
70
$CHECKBOX_TOP/support/get-external-tarballs
71
$CHECKBOX_TOP/support/install-pip-from-source
72
# Pip executable name is a variable that depends on python version
73
export PIP=/usr/local/bin/pip-3.*
74
$CHECKBOX_TOP/support/install-pip-dependencies
75
$CHECKBOX_TOP/support/develop-projects
77
# Create a cool symlink so that everyone knows where to go to
78
ln --no-dereference --force --symbolic /vagrant /home/vagrant/src