Spdk/docker/build_base/pre-install
Josh Soref 0e47b2e4f3 spelling: docker
Part of #2256

* absolute

Change-Id: I8628c449088154c9bd2edf04b3e31d72344f897e
Signed-off-by: Josh Soref <jsoref@gmail.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10396
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-11-30 09:03:49 +00:00

45 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
spdk_repo=$(mktemp -dt "spdk.XXXXXX")
spdk_tar=/spdk.tar.gz
cleanup() {
rm -f "$HOME/rpmbuild/rpm/x86_64/"*.rpm
rm -f "$spdk_tar"
rm -rf "$spdk_repo"
}
trap 'cleanup' EXIT
if [[ ! -e $spdk_tar ]]; then
printf 'Missing %s\n' "$spdk_tar" >&2
exit 1
fi
tar -C "$spdk_repo" -xf "$spdk_tar"
# Required for building RPM
dnf install -y rpm-build
# Spice it a bit with supported sources
"$spdk_repo/scripts/pkgdep.sh" -d
"$spdk_repo/test/common/config/vm_setup.sh" --test-conf=fio
# HACK: In case we received a .tar with built SPDK we need to overwrite the
# configuration to update all the paths make would need to lookup - this is
# needed since we execute inside a different mount namespace so we won't be
# able to find any absolute paths that were used prior creating the .tar.
"$spdk_repo/configure" > /dev/null
# Deploy SPDK inside the container
DEPS="no" "$spdk_repo/rpmbuild/rpm.sh" \
--with-shared \
--with-virtio \
--with-fio
mv "$HOME/rpmbuild/rpm/x86_64/"*.rpm /tmp
mv "/usr/src/fio/fio" /tmp
dnf clean all