summaryrefslogtreecommitdiffstats
path: root/satellit_upgrader/updater.template.sh
diff options
context:
space:
mode:
Diffstat (limited to 'satellit_upgrader/updater.template.sh')
-rw-r--r--satellit_upgrader/updater.template.sh26
1 files changed, 23 insertions, 3 deletions
diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh
index 88f6639..48d8cab 100644
--- a/satellit_upgrader/updater.template.sh
+++ b/satellit_upgrader/updater.template.sh
@@ -139,7 +139,7 @@ declare -rg PATH_TFTP="/srv/openslx/tftp"
declare -rg PATH_IPXE="/opt/openslx/ipxe"
declare -rg PATH_LDADP="/opt/ldadp"
declare -rg PATH_DNBD3="/opt/openslx/dnbd3"
-declare -rg PACKAGE_LIBJANSSON="libjansson4" # needed by dnbd3
+declare -rg PACKAGE_LIBJANSSON="libjansson-dev" # needed by dnbd3
# ** Check if constants have been filled, bail out otherwise
if [ -z "$TARGET_WEBIF_VERSION" ] || [[ "$TARGET_WEBIF_VERSION" == %*% ]]; then
@@ -547,8 +547,28 @@ diffcp "dnbd3/rpc.acl" "/etc/dnbd3-server/rpc.acl"
diffcp "dnbd3/is-enabled" "$PATH_DNBD3/is-enabled"
if [ -n "$TGZ_DNBD3" ]; then
- echo "Extracting new dnbd3-server binary"
- tar -x -C "$PATH_DNBD3" -f "$TMPDIR/$TGZ_DNBD3" || perror "Could not extract $TGZ_DNBD3 to $PATH_DNBD3"
+ mkdir -p "$TMPDIR/dnbd3.tmp"
+ tar -x -C "$TMPDIR/dnbd3.tmp" -f "$TMPDIR/$TGZ_DNBD3" || perror "Could not extract $TGZ_DNBD3 to $TMPDIR/dnbd3.tmp"
+ cver=$( /opt/openslx/dnbd3/dnbd3-server --version 2> /dev/null )
+ nver=$( cat "$TMPDIR/dnbd3.tmp/version.txt" )
+ [ -z "$nver" ] && pwarning "BUG BUG! Updater package contains no dnbd3 version information!"
+ mkdir -p /opt/openslx/dnbd3
+ if [ "$cver" != "$nver" ]; then
+ echo "Compiling new dnbd3-server binary..."
+ cd "$TMPDIR/dnbd3.tmp"
+ mkdir build
+ cd build
+ if ! failprint cmake -DBUILD_FUSE_CLIENT=OFF -DBUILD_KERNEL_MODULE=OFF -DBUILD_STRESSTEST=OFF -DBUILD_SERVER=ON -DCMAKE_BUILD_TYPE=Release ..; then
+ pwarning "Could not cmake new version $nver of dnbd3-server"
+ elif ! failprint make -j2 dnbd3-server; then
+ pwarning "Could not compile new version $nver of dnbd3-server"
+ elif ! cp -f dnbd3-server /opt/openslx/dnbd3/dnbd3-server; then
+ pwarning "Successfully built new dnbd3-server, but could not copy binary to /opt/openslx/dnbd3/dnbd3-server"
+ else # Clear this so we know not to print the "trying to keep going.." message
+ cver=
+ fi
+ [ -n "$cver" ] && pwarning "Trying to keep going with current version $cver"
+ fi
fi
# ********************** dnbd3.service *******************