Using disk image builder to create rapid VM
[samplevnf.git] / rapidvm / dib / elements / rapid / post-install.d / 50-compile-dpdk
1 #!/usr/bin/env bash
2 #
3 # Copyright (c) 2021 Intel Corporation
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # pick up the kernel version for the target image
18 BUILD_DIR="/opt/rapid"
19 export RTE_SDK="${BUILD_DIR}/dpdk"
20 export RTE_TARGET="x86_64-native-linuxapp-gcc"
21
22 LATEST_KERNEL_INSTALLED=`ls -v1 /lib/modules/ | tail -1`
23 export RTE_KERNELDIR="/lib/modules/${LATEST_KERNEL_INSTALLED}/build"
24
25 pushd ${RTE_SDK} > /dev/null 2>&1
26 make config T=${RTE_TARGET}
27 #sed -i 's/CONFIG_RTE_EAL_IGB_UIO=n/CONFIG_RTE_EAL_IGB_UIO=y/g' ${RTE_SDK}/build/.config
28 #sed -i 's/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=n/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=y/g' ${RTE_SDK}/build/.config
29 sed -i 's/CONFIG_RTE_APP_TEST=y/CONFIG_RTE_APP_TEST=n/g' ${RTE_SDK}/build/.config
30 sed -i 's/CONFIG_RTE_TEST_PMD=y/CONFIG_RTE_TEST_PMD=n/g' ${RTE_SDK}/build/.config
31 sed -i 's/CONFIG_RTE_TEST_BBDEV=y/CONFIG_RTE_TEST_BBDEV=n/g' ${RTE_SDK}/build/.config
32 sed -i 's/CONFIG_RTE_APP_COMPRESS_PERF=y/CONFIG_RTE_APP_COMPRESS_PERF=n/g' ${RTE_SDK}/build/.config
33 sed -i 's/CONFIG_RTE_APP_CRYPTO_PERF=y/CONFIG_RTE_APP_CRYPTO_PERF=n/g' ${RTE_SDK}/build/.config
34 #sed -i 's/CONFIG_RTE_APP_EVENTDEV=y/CONFIG_RTE_APP_EVENTDEV=n/g' ${RTE_SDK}/build/.config
35 make -j`getconf _NPROCESSORS_ONLN`
36 popd > /dev/null 2>&1