3 # Top level scripts to build basic setup for the host
6 # Copyright 2015 OPNFV, Intel Corporation.
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
22 # Aihua Li, Huawei Technologies.
23 # Abdul Halim, Intel Corporation.
24 # Martin Klozik, Intel Corporation.
29 export VSPERFENV_DIR="$HOME/vsperfenv"
31 # function to emit error message before quitting
37 # Detect OS name and version from systemd based os-release file
41 if [ "$UID" -ne "$ROOT_UID" ]
43 # installation must be run via sudo
47 # If there is version specific dir available then set distro_dir to that
48 if [ -d "$NAME/$VERSION_ID" ]; then
49 distro_dir="$NAME/$VERSION_ID"
51 # Fallback - Default distro_dir = OS name
55 # build base system using OS specific scripts
56 if [ -d "$distro_dir" ] && [ -e "$distro_dir/build_base_machine.sh" ]; then
57 $SUDO $distro_dir/build_base_machine.sh || die "$distro_dir/build_base_machine.sh failed"
59 die "$distro_dir is not yet supported"
62 if [ -d "$distro_dir" ] && [ -e "$distro_dir/prepare_python_env.sh" ] ; then
63 $distro_dir/prepare_python_env.sh || die "prepare_python_env.sh failed"
65 die "$distro_dir is not yet supported"
68 if [ ! -d /lib/modules/`uname -r`/build ] ; then
69 die "Kernel devel is not available for active kernel. It can be caused by recent kernel update. Please reboot and run $0 again."
72 # download and compile DPDK, OVS and QEMU
73 if [ -f ../src/Makefile ] ; then
75 make || die "Make failed"
78 die "Make failed; No Makefile"