test: Add support to configure ipsec git repo
Also make ipsec configuration and install optional in pkgdep.sh. Change-Id: I0c973398cebce0f50c704b21f6397e8d996ba9f9 Signed-off-by: Ed rodriguez <edwinr@netapp.com> Signed-off-by: John Meneghini <johnm@netapp.com> Reviewed-on: https://review.gerrithub.io/432424 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
b3db2a65ea
commit
9ba446a25c
2
configure
vendored
2
configure
vendored
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user