Mark Korondi 525e4cdd51 Moving to diskimage-builder
This patch makes it possible to build the Virtualbox-compatible OVA
archive withouth using vagrant, virtualbox, or vmware-specific tools.

Currently the created ova archive can be imported on VirtualBox and
VMWare Player, the disk image itself can be used with libvirt
(qemu-kvm). It contains all the drivers that enables using it
as a desktop system with shared clipboard, auto-resizing display, etc.

Since the diskimage-builder method installs in chroot, there is no way
to pre-install devstack by running stack.sh. The image makes a best
effort including all the deb and pip packages to make the first run of
stack.sh as short as possible.

Change-Id: Ie1f6e44db7e0af8d072cfdf16ace1ba3f749c246
2018-03-12 20:47:44 +01:00

32 lines
614 B
Bash
Executable File

#!/usr/bin/env bash
# Empty user caches
set -x
rm -rf ~/.cache
rm -rf /home/ubuntu/.cache
# Remove compiled pyc files
sudo updatedb
count=$(locate -- *.pyc | wc -l)
i=1
for pyc in $(locate -- *.pyc); do
rm -rf "$pyc"
echo -en "\r$((i++)) of $count deleted"
done
echo ""
sudo updatedb
# Empty packages cache
apt clean
apt autoclean
apt update
# Disable Console serial port redirection
sed -i "s/console=ttyS0//g" /etc/default/grub
sed -i "s/console=ttyS0//g" /etc/default/grub.d/*
update-grub
# Set hostname
echo "upstream-training" > "/etc/hostname"
echo "127.0.1.1 upstream-training" >> "/etc/hosts"