blob: 7f4e0941b5a133734a9cd5c508b0299a6666e3d6 [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
Marek Celoudb5ba6b72017-05-22 10:30:48 +020020 ## Temporary disable latest hwe due to: https://bugs.launchpad.net/ubuntu/+source/linux-hwe-edge/+bug/1679823
21 #apt-get install -y linux-image-generic-hwe-16.04
22 apt-get install -y linux-image-4.8.0-41-generic linux-image-extra-4.8.0-41-generic
Filip Pytloun7ae5c752016-01-15 13:48:38 +010023
24 # Update grub cmdline
25 sed -i 's|GRUB_CMDLINE_LINUX_DEFAULT=.*|GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
26 sed -i 's|GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
27 update-grub
28fi
29
30apt-get -y upgrade
31apt-get -y dist-upgrade
32
33apt-get autoremove --purge
34
Filip Pytloun7ae5c752016-01-15 13:48:38 +010035# Tmux fixes
36cat << 'EOF' >> /etc/tmux.conf
37set -g default-terminal "screen-256color"
38set -g set-titles on
39set -g xterm-keys on
40EOF
41
Petr Micahlec50f87e02017-04-13 11:38:22 +020042# Install common prerequisites
43apt-get -y install apt-transport-https python-apt python-m2crypto python-psutil
44
Filip Pytloun7ae5c752016-01-15 13:48:38 +010045# Setup cloud-init
46apt-get -y install cloud-init
Filip Pytloun4c969992017-02-20 14:42:09 +010047
48# Motd
49apt-get install -y update-motd
50rm -f /etc/update-motd.d/*
51cat << EOF >> /etc/update-motd.d/52-info
52Ubuntu 16.04 "Xenial" Mirantis cloud image
53Build date: $(date -u -R)
54
55EOF
56chmod +x /etc/update-motd.d/52-info