blob: aa356338111b9a81a4c0cef5b0d8f675153385e1 [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
Filip Pytloun59641ac2017-03-23 17:06:08 +01009apt-get -y install curl wget tmux vim-nox byobu iputils-ping traceroute htop tree lsof
Filip Pytloun4c969992017-02-20 14:42:09 +010010
11# Add apt-mk repository
Filip Pytlounb9759492017-03-22 18:41:00 +010012echo "deb [arch=amd64] http://apt-mk.mirantis.com/xenial/ nightly salt" > /etc/apt/sources.list.d/mcp_salt.list
13echo "deb [arch=amd64] http://apt-mk.mirantis.com/xenial/ nightly extra" > /etc/apt/sources.list.d/mcp_extra.list
Filip Pytloun4c969992017-02-20 14:42:09 +010014curl -sf http://apt-mk.mirantis.com/public.gpg | apt-key add -
15
Filip Pytloun7ae5c752016-01-15 13:48:38 +010016# Cleanup old kernels, ensure latest is installed via virtual package
Filip Pytloun81fa31c2017-02-23 09:37:06 +010017apt-get purge -y linux-image-* linux-headers-*
Filip Pytloun7ae5c752016-01-15 13:48:38 +010018if [ ! -f /tmp/no_install_kernel ]; then
Filip Pytloun81fa31c2017-02-23 09:37:06 +010019 # Use HWE kernel
20 apt-get install -y linux-image-generic-hwe-16.04
Filip Pytloun7ae5c752016-01-15 13:48:38 +010021
22 # Update grub cmdline
23 sed -i 's|GRUB_CMDLINE_LINUX_DEFAULT=.*|GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
24 sed -i 's|GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
25 update-grub
26fi
27
28apt-get -y upgrade
29apt-get -y dist-upgrade
30
31apt-get autoremove --purge
32
Filip Pytloun7ae5c752016-01-15 13:48:38 +010033# Tmux fixes
34cat << 'EOF' >> /etc/tmux.conf
35set -g default-terminal "screen-256color"
36set -g set-titles on
37set -g xterm-keys on
38EOF
39
Petr Micahlec50f87e02017-04-13 11:38:22 +020040# Install common prerequisites
41apt-get -y install apt-transport-https python-apt python-m2crypto python-psutil
42
Filip Pytloun7ae5c752016-01-15 13:48:38 +010043# Setup cloud-init
44apt-get -y install cloud-init
Filip Pytloun4c969992017-02-20 14:42:09 +010045
46# Motd
47apt-get install -y update-motd
48rm -f /etc/update-motd.d/*
49cat << EOF >> /etc/update-motd.d/52-info
50Ubuntu 16.04 "Xenial" Mirantis cloud image
51Build date: $(date -u -R)
52
53EOF
54chmod +x /etc/update-motd.d/52-info