summaryrefslogtreecommitdiffstats
path: root/vagrant/basebuild/bootstrap.sh
blob: a0f5c7f2562d53d35ef8c1bb4e4cfa6b7070b600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash

# die on errors
set -e

# pull in bootstrap functions
. /vagrant/lib/bootstrap-functions.sh

do_setup

# record the bootstrap.sh checksum
shasum $0 > /etc/bootstrap.sha

echo "---> Attempting to detect OS"
# OS selector
if [ -f /usr/bin/yum ]
then
    echo "---> RH type system detected"
    rh_clean_pkgs
    rh_update_pkgs
    rh_install_pkgs

elif [ -f /usr/bin/apt-get ]
then
    echo "---> Debian type system detected"
    export DEBIAN_FRONTEND=noninteractive

    deb_enable_serial_console
    deb_aptconf_batchconf
    deb_sync_minor
    deb_correct_shell
    deb_install_pkgs
    deb_remove_pkgs
    deb_disable_apt_systemd_daily
    deb_flush
    deb_reup_certs

    # It is not necessary to load uio module during bootstrap phase
    # deb_probe_modules uio_pci_generic

    # Make sure uio loads at boot time
    deb_enable_modules 'uio_pci_generic'

    deb_enable_hugepages

    # It is not necessary to mount hugepages during bootstrap phase
    # deb_mount_hugepages

fi

do_cleanup

echo "bootstrap process (PID=$$) complete."

exit 0