diff --git a/configure b/configure index 2490bf03c6..b0a151e2e3 100755 --- a/configure +++ b/configure @@ -367,7 +367,7 @@ if [[ "${CONFIG[CRYPTO]}" = "y" ]]; then echo or upgrade then re-run this script. exit 1 else - if [[ "$(find /usr -name intel-ipsec-mb.h 2>/dev/null)" == "" ]]; then + if [[ "$(find /usr -xdev -name intel-ipsec-mb.h 2>/dev/null)" == "" ]]; then echo "To enable crypto you must first go to the intel-ipsec-mb directory and " echo "run 'make' then 'sudo make install' then re-run this script." exit 1 diff --git a/scripts/pkgdep.sh b/scripts/pkgdep.sh index 2ab610b07b..c99e76f917 100755 --- a/scripts/pkgdep.sh +++ b/scripts/pkgdep.sh @@ -2,6 +2,39 @@ # Please run this script as root. set -e + +function usage() +{ + echo "" + echo "This script is intended to automate the installation of package dependencies to build SPDK." + echo "Please run this script as root user." + echo "" + echo "$0" + echo " -h --help" + echo " -i --install-crypto Install ipsec dependencies" + echo "" + exit 0 +} + +INSTALL_CRYPTO=false + +while getopts 'hi-:' optchar; do + case "$optchar" in + -) + case "$OPTARG" in + help) usage;; + install-crypto) INSTALL_CRYPTO=true;; + *) echo "Invalid argument '$OPTARG'" + usage;; + esac + ;; + h) usage;; + i) INSTALL_CRYPTO=true;; + *) echo "Invalid argument '$OPTARG'" + usage;; + esac +done + trap 'set +e; trap - ERR; echo "Error!"; exit 1;' ERR scriptsdir=$(readlink -f $(dirname $0)) @@ -81,21 +114,25 @@ else fi # Only crypto needs nasm and this lib but because the lib requires root to -# install we do it here. -nasm_ver=$(nasm -v | sed 's/[^0-9]*//g' | awk '{print substr ($0, 0, 5)}') -if [ $nasm_ver -lt "21202" ]; then - echo Crypto requires NASM version 2.12.02 or newer. Please install - echo or upgrade and re-run this script if you are going to use Crypto. -else - ipsec="$(find /usr -name intel-ipsec-mb.h 2>/dev/null)" - if [ "$ipsec" == "" ]; then - ipsec_submodule_cloned="$(find $rootdir/intel-ipsec-mb -name intel-ipsec-mb.h 2>/dev/null)" - if [ "$ipsec_submodule_cloned" != "" ]; then - su - $SUDO_USER -c "make -C $rootdir/intel-ipsec-mb" - make -C $rootdir/intel-ipsec-mb install - else - echo "The intel-ipsec-mb submodule has not been cloned and will not be installed." - echo "To enable crypto, run 'git submodule update --init' and then run this script again." +# install we do it here - when asked. + +if $INSTALL_CRYPTO; then + + nasm_ver=$(nasm -v | sed 's/[^0-9]*//g' | awk '{print substr ($0, 0, 5)}') + if [ $nasm_ver -lt "21202" ]; then + echo Crypto requires NASM version 2.12.02 or newer. Please install + echo or upgrade and re-run this script if you are going to use Crypto. + else + ipsec="$(find /usr -xdev -name intel-ipsec-mb.h 2>/dev/null)" + if [ "$ipsec" == "" ]; then + ipsec_submodule_cloned="$(find $rootdir/intel-ipsec-mb -name intel-ipsec-mb.h 2>/dev/null)" + if [ "$ipsec_submodule_cloned" != "" ]; then + su - $SUDO_USER -c "make -C $rootdir/intel-ipsec-mb" + make -C $rootdir/intel-ipsec-mb install + else + echo "The intel-ipsec-mb submodule has not been cloned and will not be installed." + echo "To enable crypto, run 'git submodule update --init' and then run this script again." + fi fi fi fi diff --git a/test/common/config/vm_setup.sh b/test/common/config/vm_setup.sh index 0e70e1d895..ce92232a27 100755 --- a/test/common/config/vm_setup.sh +++ b/test/common/config/vm_setup.sh @@ -310,6 +310,7 @@ cd ~ : ${GIT_REPO_VPP=https://gerrit.fd.io/r/vpp}; export GIT_REPO_VPP : ${GIT_REPO_LIBISCSI=https://github.com/sahlberg/libiscsi}; export GIT_REPO_LIBISCSI : ${GIT_REPO_SPDK_NVME_CLI=https://github.com/spdk/nvme-cli}; export GIT_REPO_SPDK_NVME_CLI +: ${GIT_REPO_INTEL_IPSEC_MB=https://github.com/spdk/intel-ipsec-mb.git}; export GIT_REPO_INTEL_IPSEC_MB jobs=$(($(nproc)*2)) @@ -329,10 +330,11 @@ else git -C spdk_repo clone "${GIT_REPO_SPDK}" fi git -C spdk_repo/spdk config submodule.dpdk.url "${GIT_REPO_DPDK}" +git -C spdk_repo/spdk config submodule.intel-ipsec-mb.url "${GIT_REPO_INTEL_IPSEC_MB}" git -C spdk_repo/spdk submodule update --init --recursive if $INSTALL; then - sudo spdk_repo/spdk/scripts/pkgdep.sh + sudo spdk_repo/spdk/scripts/pkgdep.sh -i if echo $CONF | grep -q tsocks; then sudo dnf install -y tsocks