2021-08-03 07:16:49 +00:00
|
|
|
#!/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
|
2021-11-25 01:40:57 +00:00
|
|
|
# able to find any absolute paths that were used prior creating the .tar.
|
2021-08-03 07:16:49 +00:00
|
|
|
"$spdk_repo/configure" > /dev/null
|
|
|
|
|
|
|
|
# Deploy SPDK inside the container
|
|
|
|
DEPS="no" "$spdk_repo/rpmbuild/rpm.sh" \
|
|
|
|
--with-shared \
|
2021-09-27 14:17:10 +00:00
|
|
|
--with-virtio \
|
2021-08-03 07:16:49 +00:00
|
|
|
--with-fio
|
|
|
|
|
|
|
|
mv "$HOME/rpmbuild/rpm/x86_64/"*.rpm /tmp
|
|
|
|
mv "/usr/src/fio/fio" /tmp
|
|
|
|
dnf clean all
|