Commit f0b3db3f authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Gerrit Code Review
Browse files

autobuild: FreeBSD portability fixes



Change-Id: Id6db5d80ee7fa602da8763372f92555e7e299445
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 8780063f
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -3,10 +3,9 @@
set -e

src=$(readlink -f $(dirname $0))
out=$PWD
source "$src/scripts/autotest_common.sh"

MAKEFLAGS=${MAKEFLAGS:--j16}
DPDK_DIR=/usr/local/dpdk-2.1.0/x86_64-native-linuxapp-gcc
out=$PWD

umask 022

@@ -19,16 +18,16 @@ if hash scan-build; then
	scanbuild="scan-build -o $out/scan-build-tmp --status-bugs"
fi

make $MAKEFLAGS clean
$MAKE $MAKEFLAGS clean
fail=0
time $scanbuild make $MAKEFLAGS DPDK_DIR=$DPDK_DIR || fail=1
time $scanbuild $MAKE $MAKEFLAGS DPDK_DIR=$DPDK_DIR || fail=1

# Check that header file dependencies are working correctly by
#  capturing a binary's stat data before and after touching a
#  header file and re-making.
STAT1=`stat examples/nvme/identify/identify`
touch lib/nvme/nvme_internal.h
make $MAKEFLAGS DPDK_DIR=$DPDK_DIR || fail=1
$MAKE $MAKEFLAGS DPDK_DIR=$DPDK_DIR || fail=1
STAT2=`stat examples/nvme/identify/identify`

if [ "$STAT1" == "$STAT2" ]; then
@@ -43,7 +42,7 @@ if [ -d $out/scan-build-tmp ]; then
fi

if hash doxygen; then
	(cd "$src"/doc; make $MAKEFLAGS)
	(cd "$src"/doc; $MAKE $MAKEFLAGS)
	mkdir -p "$out"/doc
	for d in "$src"/doc/output.*; do
		component=$(basename "$d" | sed -e 's/^output.//')
+4 −4
Original line number Diff line number Diff line
@@ -2,15 +2,15 @@

set -xe

DPDK_DIR=/usr/local/dpdk-2.1.0/x86_64-native-linuxapp-gcc

src=$(readlink -f $(dirname $0))
source "$src/scripts/autotest_common.sh"

out=$PWD

MAKEFLAGS=${MAKEFLAGS:--j16}
cd $src

make clean
$MAKE clean

if [ `git status --porcelain | wc -l` -ne 0 ]; then
	echo make clean left the following files:
@@ -36,6 +36,6 @@ tar -C "$tmpdir" -xf $out/$tarball
	cd "$tmpdir"/spdk-*
	cp CONFIG CONFIG.orig
	sed -e 's/CONFIG_DEBUG=y/CONFIG_DEBUG=n/' <CONFIG.orig >CONFIG
	time make ${MAKEFLAGS} DPDK_DIR=$DPDK_DIR
	time $MAKE ${MAKEFLAGS} DPDK_DIR=$DPDK_DIR
)
rm -rf "$tmpdir"
+2 −12
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ if [ $EUID -ne 0 ]; then
	exit 1
fi

trap "process_core; exit 1" SIGINT SIGTERM EXIT
trap "process_core; $rootdir/scripts/cleanup.sh; exit 1" SIGINT SIGTERM EXIT

timing_enter autotest

@@ -36,17 +36,7 @@ time test/lib/memory/memory.sh

timing_exit lib

# detach pci devices from uio driver
grep -q "^uio_pci_generic" /proc/modules && rmmod uio_pci_generic

# bind NVMe devices to NVMe driver if no kernel device
if [ -d "/sys/bus/pci/drivers/nvme" ]; then
	device=`find /sys/bus/pci/drivers/nvme -name "0000*" -print`
	if [ -z "$device" ]; then
		rmmod nvme
		modprobe nvme
	fi
fi
./scripts/cleanup.sh

timing_exit autotest
chmod a+r $output_dir/timing.txt
+17 −0
Original line number Diff line number Diff line
set -xe
ulimit -c unlimited

case `uname` in
	FreeBSD)
		DPDK_DIR=/usr/local/share/dpdk/x86_64-native-bsdapp-clang
		MAKE=gmake
		;;
	Linux)
		DPDK_DIR=/usr/local/dpdk-2.1.0/x86_64-native-linuxapp-gcc
		MAKE=make
		;;
	*)
		echo "Unknown OS in $0"
		exit 1
		;;
esac

MAKEFLAGS=${MAKEFLAGS:--j16}

if [ -z "$rootdir" ] || [ ! -d "$rootdir/../output" ]; then
	output_dir=.
else

scripts/cleanup.sh

0 → 100755
+27 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash

set -e

function cleanup_linux() {
	# detach pci devices from uio driver
	grep -q "^uio_pci_generic" /proc/modules && rmmod uio_pci_generic

	# bind NVMe devices to NVMe driver if no kernel device
	if [ -d "/sys/bus/pci/drivers/nvme" ]; then
		device=`find /sys/bus/pci/drivers/nvme -name "0000*" -print`
		if [ -z "$device" ]; then
			rmmod nvme
			modprobe nvme
		fi
	fi
}

function cleanup_freebsd {
	kldunload contigmem.ko || true
}

if [ `uname` = Linux ]; then
	cleanup_linux
else
	cleanup_freebsd
fi
Loading