Convert deb_dpdk to be Packer compliant
[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 do_mvn_install
11
12 # record the bootstrap.sh checksum
13 sha1sum $0 > /etc/bootstrap.sha
14 sha1sum /vagrant/lib/bootstrap-functions.sh > /etc/bootstrap-functions.sha
15
16 echo "---> Attempting to detect OS"
17 # OS selector
18 if [ -f /usr/bin/yum ]
19 then
20     echo "---> RH type system detected"
21     rh_clean_pkgs
22     rh_update_pkgs
23     rh_install_pkgs
24
25 elif [ -f /usr/bin/apt-get ]
26 then
27     echo "---> Debian type system detected"
28     export DEBIAN_FRONTEND=noninteractive
29
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