Commit 0fb1e1c5 authored by Paul Luse's avatar Paul Luse Committed by Jim Harris
Browse files

ipsec: updates to require ipsec installation



Although a pre-req to crypto only, the latest ipsec library now
requires root to install.  This patch takes 2 approaches to making
sure the ipsec module is installed properly.  First, in configure,
if crypto is enabled it will check to see if ipsec is already installed
and if so do nothing.  If it is not it will exit and instruct the user
to manually install and re-run the configure script.

Secondly, to be proactive, this patch adds the installation, if not
already installed, to the pkg dependency script because it is already
executed as root.

It also does the same for nasm, checking the required versions in both
places.

Change-Id: I037629f21be474b88c12451733ac12ff0b1651f5
Signed-off-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/422746


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent d6d0e494
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -338,7 +338,22 @@ than or equal to 4.14 will see significantly reduced performance.
	fi
fi


if [[ "$CONFIG_CRYPTO" = "y" ]]; then
	set +e
	nasm_ver=$(nasm -v | sed 's/[^0-9]*//g' | awk '{print substr ($0, 0, 5)}')
	ipsec="$(find /usr -name intel-ipsec-mb.h 2>/dev/null)"
	set -e
	if [[ $nasm_ver -lt "21202" ]]; then
		echo Crypto requires NASM version 2.12.02 or newer.  Please install
		echo or upgrade then re-run this scrip.
        else
		if [[ "$ipsec" == "" ]]; 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
		fi
	fi
fi

echo -n "Creating CONFIG.local..."

+24 −0
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@

SYSTEM=`uname -s`

scriptsdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $scriptsdir/..)

if [ -s /etc/redhat-release ]; then
	# Includes Fedora, CentOS
	if [ -f /etc/centos-release ]; then
@@ -62,3 +65,24 @@ else
	echo "pkgdep: unknown system type."
	exit 1
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
		if [[ -d "$rootdir/intel-ipsec-mb" ]]; then
			cd $rootdir/intel-ipsec-mb
			make
			make install
			cd -
		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