blob: e4283e19ac95b3eb9125ac074b56c67bb063e0ce [file] [log] [blame]
Filip Pytloun60411d12015-06-25 21:14:41 +02001## 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
jan kaufmana519d7b2015-03-04 00:51:47 +01006apt-get update
Filip Pytloune3181af2015-06-25 22:11:22 +02007
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/trusty/ nightly salt" > /etc/apt/sources.list.d/mcp_salt.list
13echo "deb [arch=amd64] http://apt-mk.mirantis.com/trusty/ 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 Pytloune3181af2015-06-25 22:11:22 +020016# Cleanup old kernels, ensure latest is installed via virtual package
Filip Pytloun896f37b2015-06-25 18:35:42 +020017apt-get purge -y linux-image-* linux-headers-*
Filip Pytloun7b48fd22015-06-30 23:34:01 +020018if [ ! -f /tmp/no_install_kernel ]; then
Jakub Josefcbf20152017-03-10 16:05:08 +010019 apt-get install -y linux-generic-lts-xenial
Filip Pytloun7b48fd22015-06-30 23:34:01 +020020
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
Filip Pytloune3181af2015-06-25 22:11:22 +020026
jan kaufmana519d7b2015-03-04 00:51:47 +010027apt-get -y upgrade
28apt-get -y dist-upgrade
jan kaufmandfc08f02015-04-29 20:17:55 +020029
Filip Pytloune3181af2015-06-25 22:11:22 +020030apt-get autoremove --purge
31
Filip Pytloun39832362015-06-25 18:05:47 +020032# Tmux fixes
33cat << 'EOF' >> /etc/tmux.conf
34set -g default-terminal "screen-256color"
35set -g set-titles on
36set -g xterm-keys on
37EOF
Filip Pytloundd27ad82015-06-18 11:12:08 +020038
Petr Micahlec50f87e02017-04-13 11:38:22 +020039# Install common prerequisites
40apt-get -y install apt-transport-https python-apt python-m2crypto python-psutil
41
Filip Pytloundd27ad82015-06-18 11:12:08 +020042# Setup cloud-init
jan kaufman0fcf1a72015-05-06 10:16:12 +020043apt-get -y install cloud-init
Filip Pytloun4c969992017-02-20 14:42:09 +010044
45# Motd
46apt-get install -y update-motd
47rm -f /etc/update-motd.d/*
48cat << EOF >> /etc/update-motd.d/52-info
49Ubuntu 14.04 "Trusty" Mirantis cloud image
50Build date: $(date -u -R)
51
52EOF
53chmod +x /etc/update-motd.d/52-info