839c4500e42c0b27819cce938f73d214c25884d5
[releng/builder.git] / vagrant / ovsdb-devstack / bootstrap.sh
1 #!/bin/bash
2
3 # enable enforcing mode from the very start
4 setenforce enforcing
5
6 # configure system for enforcing mode on next boot
7 sed -i 's/SELINUX=permissive/SELINUX=enforcing/' /etc/selinux/config
8
9 yum clean all
10 yum update -y
11 yum install -q -y deltarpm python{,-{crypto,devel,lxml,setuptools}} \
12     @development {lib{xml2,xslt,ffi},openssl}-devel \
13     java git sudo
14
15 # figure out what the latest kernel installed is and switch to it
16 # NOTE: This is done like this becase the Rackspace F20 images are using
17 # extlinux / syslinux and don't switch to the newest kernel on update
18 NEWKERNEL=`rpm -qa | grep kernel-3 | sort -r | head -1 | cut -c 8-`
19 if [ -f /boot/extlinux.conf ]; then
20     BOOTLABEL=`grep ${NEWKERNEL} /boot/extlinux.conf | grep LABEL | cut -c 7-`
21     sed -i "s/ONTIMEOUT linux/ONTIMEOUT ${BOOTLABEL}/" /boot/extlinux.conf
22 fi
23
24 if [ ! -f /etc/udev/rules.d/80-net-setup-link.rules ]; then
25     ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
26 fi
27
28 echo "***************************************************"
29 echo "*   PLEASE RELOAD THIS VAGRANT BOX BEFORE USE     *"
30 echo "***************************************************"
31
32 # vim: sw=4 ts=4 sts=4 et :