-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathsetup-container
executable file
·44 lines (33 loc) · 1.25 KB
/
setup-container
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
set -e
# Barf if not uid 0
if [ $(id -u) -ne "0" ]; then
echo "Please run me with sudo"
exit
fi
if ! grep -qa container=lxc /proc/1/environ; then
echo "You're not in an LXC container, so I'm refusing to run."
exit
fi
# Disable debconf questions.
export DEBIAN_FRONTEND=noninteractive
# If your host system is not in English, need to fix the locale for
# the lxc, as the project (and its tests) assume an English machine.
sed -i 's/LANG=.*/LC_ALL="en_US.UTF-8"/' /etc/default/locale
# install classic snaps, use ols-vms.conf as the source
for snap_ in $( grep sideload.classic_snaps ols-vms.conf | cut -d '=' -f 2 | xargs | tr " " "\n" | cut -d_ -f1 ) ; do
snap install ${snap_} --classic
done
# install strictly confined snaps
for snap_ in $(grep 'sideload.snaps\s*=' ols-vms.conf | cut -d '=' -f 2 | xargs | tr " " "\n" | cut -d_ -f1) ; do
snap install ${snap_}
done
# Let's make sure your system is up to date
apt-get update
apt-get upgrade -y --allow-downgrades --allow-remove-essential --allow-change-held-packages
apt-get autoremove -y
# Install project's OS dependencies.
cat dependencies.txt dependencies-devel.txt | xargs apt install --no-install-recommends -y
# we are done
echo All done, now you can do
echo make bootstrap