Merge "Correct deprecated include syntax"
[ci-management.git] / vagrant / basebuild / bootstrap.sh
1 #!/bin/bash
2
3 # die on errors
4 set -e
5
6 # pull in bootstrap functions
7 . /vagrant/lib/bootstrap-functions.sh
8
9 do_setup
10
11 # record the bootstrap.sh checksum
12 shasum $0 > /etc/bootstrap.sha
13 shasum /vagrant/lib/bootstrap-functions.sh > /etc/bootstrap-functions.sha
14
15 echo "---> Attempting to detect OS"
16 # OS selector
17 if [ -f /usr/bin/yum ]
18 then
19     echo "---> RH type system detected"
20     rh_clean_pkgs
21     rh_update_pkgs
22     rh_install_pkgs
23
24 elif [ -f /usr/bin/apt-get ]
25 then
26     echo "---> Debian type system detected"
27     export DEBIAN_FRONTEND=noninteractive
28
29     deb_enable_serial_console
30     deb_aptconf_batchconf
31     deb_sync_minor
32     deb_correct_shell
33     deb_install_pkgs
34     deb_remove_pkgs
35     deb_disable_apt_systemd_daily
36     deb_flush
37     deb_reup_certs
38
39     # It is not necessary to load uio module during bootstrap phase
40     # deb_probe_modules uio_pci_generic
41
42     # Make sure uio loads at boot time
43     deb_enable_modules 'uio_pci_generic'
44
45     deb_enable_hugepages
46
47     # It is not necessary to mount hugepages during bootstrap phase
48     # deb_mount_hugepages
49
50 fi
51
52 do_cleanup
53
54 echo "bootstrap process (PID=$$) complete."
55
56 exit 0