blob: dea0a7230319ec9bcb7ffacd94c3d7bebd637237 [file] [log] [blame]
Filip Pytloun7ae5c752016-01-15 13:48:38 +01001## Base packages and setup
Filip Pytloun2516a612016-02-12 10:50:29 +01002export DEBIAN_FRONTEND=noninteractive
Filip Pytlouncb52dd52016-02-01 10:42:54 +01003echo "exit 101" > /usr/sbin/policy-rc.d
4chmod +x /usr/sbin/policy-rc.d
Filip Pytloun2516a612016-02-12 10:50:29 +01005apt-get clean
Filip Pytloun7ae5c752016-01-15 13:48:38 +01006apt-get update
7
Filip Pytloun4c969992017-02-20 14:42:09 +01008# Useful tools
9apt-get -y install curl wget tmux vim-nox byobu iputils-ping traceroute htop tree
10
11# Add apt-mk repository
Filip Pytloun55578142017-03-09 18:46:53 +000012echo "deb [arch=amd64] http://apt-mk.mirantis.com/xenial/ nightly extra salt salt-latest" > /etc/apt/sources.list.d/apt-mk.list
Filip Pytloun4c969992017-02-20 14:42:09 +010013curl -sf http://apt-mk.mirantis.com/public.gpg | apt-key add -
14
Filip Pytloun7ae5c752016-01-15 13:48:38 +010015# Cleanup old kernels, ensure latest is installed via virtual package
Filip Pytloun81fa31c2017-02-23 09:37:06 +010016apt-get purge -y linux-image-* linux-headers-*
Filip Pytloun7ae5c752016-01-15 13:48:38 +010017if [ ! -f /tmp/no_install_kernel ]; then
Filip Pytloun81fa31c2017-02-23 09:37:06 +010018 # Use HWE kernel
19 apt-get install -y linux-image-generic-hwe-16.04
Filip Pytloun7ae5c752016-01-15 13:48:38 +010020
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
25fi
26
27apt-get -y upgrade
28apt-get -y dist-upgrade
29
30apt-get autoremove --purge
31
Filip Pytloun7ae5c752016-01-15 13:48:38 +010032# Tmux fixes
33cat << 'EOF' >> /etc/tmux.conf
34set -g default-terminal "screen-256color"
35set -g set-titles on
36set -g xterm-keys on
37EOF
38
39# Setup cloud-init
40apt-get -y install cloud-init
Filip Pytloun4c969992017-02-20 14:42:09 +010041
42# Motd
43apt-get install -y update-motd
44rm -f /etc/update-motd.d/*
45cat << EOF >> /etc/update-motd.d/52-info
46Ubuntu 16.04 "Xenial" Mirantis cloud image
47Build date: $(date -u -R)
48
49EOF
50chmod +x /etc/update-motd.d/52-info