Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 1 | ## Base packages and setup |
Filip Pytloun | 2516a61 | 2016-02-12 10:50:29 +0100 | [diff] [blame] | 2 | export DEBIAN_FRONTEND=noninteractive |
Filip Pytloun | cb52dd5 | 2016-02-01 10:42:54 +0100 | [diff] [blame] | 3 | echo "exit 101" > /usr/sbin/policy-rc.d |
| 4 | chmod +x /usr/sbin/policy-rc.d |
Filip Pytloun | 2516a61 | 2016-02-12 10:50:29 +0100 | [diff] [blame] | 5 | apt-get clean |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 6 | apt-get update |
| 7 | |
Filip Pytloun | 4c96999 | 2017-02-20 14:42:09 +0100 | [diff] [blame] | 8 | # Useful tools |
| 9 | apt-get -y install curl wget tmux vim-nox byobu iputils-ping traceroute htop tree |
| 10 | |
| 11 | # Add apt-mk repository |
Filip Pytloun | 5557814 | 2017-03-09 18:46:53 +0000 | [diff] [blame^] | 12 | echo "deb [arch=amd64] http://apt-mk.mirantis.com/xenial/ nightly extra salt salt-latest" > /etc/apt/sources.list.d/apt-mk.list |
Filip Pytloun | 4c96999 | 2017-02-20 14:42:09 +0100 | [diff] [blame] | 13 | curl -sf http://apt-mk.mirantis.com/public.gpg | apt-key add - |
| 14 | |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 15 | # Cleanup old kernels, ensure latest is installed via virtual package |
Filip Pytloun | 81fa31c | 2017-02-23 09:37:06 +0100 | [diff] [blame] | 16 | apt-get purge -y linux-image-* linux-headers-* |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 17 | if [ ! -f /tmp/no_install_kernel ]; then |
Filip Pytloun | 81fa31c | 2017-02-23 09:37:06 +0100 | [diff] [blame] | 18 | # Use HWE kernel |
| 19 | apt-get install -y linux-image-generic-hwe-16.04 |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 20 | |
| 21 | # Update grub cmdline |
| 22 | sed -i 's|GRUB_CMDLINE_LINUX_DEFAULT=.*|GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub |
| 23 | sed -i 's|GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub |
| 24 | update-grub |
| 25 | fi |
| 26 | |
| 27 | apt-get -y upgrade |
| 28 | apt-get -y dist-upgrade |
| 29 | |
| 30 | apt-get autoremove --purge |
| 31 | |
Filip Pytloun | 7ae5c75 | 2016-01-15 13:48:38 +0100 | [diff] [blame] | 32 | # Tmux fixes |
| 33 | cat << 'EOF' >> /etc/tmux.conf |
| 34 | set -g default-terminal "screen-256color" |
| 35 | set -g set-titles on |
| 36 | set -g xterm-keys on |
| 37 | EOF |
| 38 | |
| 39 | # Setup cloud-init |
| 40 | apt-get -y install cloud-init |
Filip Pytloun | 4c96999 | 2017-02-20 14:42:09 +0100 | [diff] [blame] | 41 | |
| 42 | # Motd |
| 43 | apt-get install -y update-motd |
| 44 | rm -f /etc/update-motd.d/* |
| 45 | cat << EOF >> /etc/update-motd.d/52-info |
| 46 | Ubuntu 16.04 "Xenial" Mirantis cloud image |
| 47 | Build date: $(date -u -R) |
| 48 | |
| 49 | EOF |
| 50 | chmod +x /etc/update-motd.d/52-info |