Skip to content

Commit 94ccf97

Browse files
author
Paul C
committed
v22.6.12: install proxmox-backup-client on ARM (Pi etc.) by building from source
Proxmox publishes proxmox-backup-client only for amd64 — verified at http://download.proxmox.com/debian/pbs/dists/{bookworm,trixie}/pbs-no-subscription/ where only binary-amd64/ exists. Every other architecture (Raspberry Pi aarch64, Apple Silicon Linux, ARM servers, armv7l Pis) silently fell through with a generic "could not install" warning, leaving PBS backup destinations broken on those hosts. Adds pbs_build_from_source() that clones git.proxmox.com/git/proxmox-backup.git (the upstream Rust workspace which has proxmox-backup-client as a member crate), installs the build deps (libssl-dev / libacl1-dev / libfuse3-dev / libsystemd-dev / uuid-dev plus distro equivalents for dnf / pacman / zypper), and runs `cargo build --release --bin proxmox-backup-client`. Re-uses the existing low-memory -j 1 logic so a 1–4 GB Pi doesn't OOM during compile. Installs the resulting binary to /usr/local/bin/. When the upstream apt / .deb path fails: • aarch64 / arm64 / armv7l / armv6l → automatically attempt source build (the Pi case — user gets a working PBS client without flag-hunting) • amd64 → only attempt source build if --build-pbs is passed (the apt path normally works; source build is for people tracking upstream) • Other unsupported arches → attempt with an explanatory note New flags: --skip-pbs-build / --no-pbs-build Skip the source build entirely (Pi users who don't need PBS and don't want a 20–30 min compile) --build-pbs / --pbs-from-source Force a source build even on amd64 Final fallback message now lists the alternative backup destinations that work without the PBS client at all (Local, S3 / B2 / MinIO, NFS, SMB, SSHFS, WolfDisk) instead of just sending users to the upstream docs page. Source license is AGPL-3 (workspace Cargo.toml at git.proxmox.com). We're building locally rather than redistributing a binary, so AGPL obligations stay with the user's local install.
1 parent fe97639 commit 94ccf97

2 files changed

Lines changed: 138 additions & 3 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wolfstack"
3-
version = "22.6.11"
3+
version = "22.6.12"
44
edition = "2024"
55
authors = ["Wolf Software Systems Ltd"]
66
description = "Server management platform for the Wolf software suite"

setup.sh

Lines changed: 137 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ BRANCH="master"
2929
CUSTOM_INSTALL_DIR=""
3030
ASSUME_YES=false
3131
AGENT_MODE=false
32+
SKIP_PBS_BUILD=false
33+
FORCE_PBS_BUILD=false
3234
while [ $# -gt 0 ]; do
3335
case "$1" in
3436
--beta) BRANCH="beta" ;;
3537
--yes|-y|--assume-yes) ASSUME_YES=true ;;
3638
--agent) AGENT_MODE=true ;;
39+
--skip-pbs-build|--no-pbs-build) SKIP_PBS_BUILD=true ;;
40+
--build-pbs|--pbs-from-source) FORCE_PBS_BUILD=true ;;
3741
--install-dir|--install)
3842
if [ -n "$2" ]; then
3943
shift
@@ -662,9 +666,140 @@ else
662666
fi
663667
fi
664668

669+
# ─── Source-build fallback for architectures Proxmox doesn't ship binaries for ─
670+
# Proxmox publishes proxmox-backup-client ONLY for amd64
671+
# (http://download.proxmox.com/debian/pbs/dists/{bookworm,trixie}/pbs-no-subscription/
672+
# only has binary-amd64/). Every other architecture — Raspberry Pi (aarch64),
673+
# Apple Silicon Linux (aarch64), ARM servers (aarch64), armv7l Pis — silently
674+
# fails the .deb extraction path above. This block builds the client crate from
675+
# source via cargo so PBS backup destinations work on ARM hosts.
676+
#
677+
# Skip with --skip-pbs-build if you don't need PBS and don't want to wait
678+
# 20-30 min on a Pi. Force a rebuild attempt with --build-pbs even on amd64.
679+
pbs_build_from_source() {
680+
local target_arch="${HOST_ARCH:-$(uname -m)}"
681+
echo ""
682+
echo " Building proxmox-backup-client from source for $target_arch..."
683+
echo " This takes ~20-30 minutes on a Raspberry Pi 4. Re-run setup.sh"
684+
echo " with --skip-pbs-build to skip on next upgrade if you don't need PBS."
685+
686+
if ! command -v cargo >/dev/null 2>&1; then
687+
echo " ✗ Cargo (Rust toolchain) not found — cannot build from source."
688+
echo " Install Rust first: https://rustup.rs/ then re-run setup.sh"
689+
return 1
690+
fi
691+
692+
# Build dependencies. The proxmox-backup-client crate links libssl, libacl,
693+
# libfuse3 (for fuse-mount of pxar archives), and libsystemd. Names vary
694+
# by distro — best-effort install, build will fail loudly if any are missing.
695+
if command -v apt-get >/dev/null 2>&1; then
696+
apt-get install -y --no-install-recommends \
697+
git build-essential pkg-config clang \
698+
libssl-dev libacl1-dev libfuse3-dev libsystemd-dev uuid-dev 2>/dev/null \
699+
|| echo " ⚠ Some build deps may be missing — continuing anyway"
700+
elif command -v dnf >/dev/null 2>&1; then
701+
dnf install -y git gcc gcc-c++ make pkgconf-pkg-config clang \
702+
openssl-devel libacl-devel fuse3-devel systemd-devel libuuid-devel 2>/dev/null \
703+
|| echo " ⚠ Some build deps may be missing — continuing anyway"
704+
elif command -v pacman >/dev/null 2>&1; then
705+
pacman -S --needed --noconfirm git base-devel pkg-config clang \
706+
openssl acl fuse3 systemd-libs util-linux 2>/dev/null \
707+
|| echo " ⚠ Some build deps may be missing — continuing anyway"
708+
elif command -v zypper >/dev/null 2>&1; then
709+
zypper install -y git gcc gcc-c++ make pkg-config clang \
710+
libopenssl-devel libacl-devel fuse3-devel systemd-devel libuuid-devel 2>/dev/null \
711+
|| echo " ⚠ Some build deps may be missing — continuing anyway"
712+
fi
713+
714+
local src="${CUSTOM_INSTALL_DIR:-/var/cache/wolfstack}/proxmox-backup-src"
715+
rm -rf "$src"
716+
mkdir -p "$(dirname "$src")"
717+
718+
if ! git clone --depth 1 https://git.proxmox.com/git/proxmox-backup.git "$src" 2>&1 | tail -3; then
719+
echo " ✗ Could not clone proxmox-backup source from git.proxmox.com"
720+
rm -rf "$src"
721+
return 1
722+
fi
723+
724+
# Build only the client crate. The wider workspace pulls in PBS-server
725+
# crates (proxmox-backup-server, daemons, web UI assets) that need
726+
# extra build infrastructure we don't want to drag in for the client.
727+
# Re-use the swap created earlier in the wolfstack source-build block
728+
# if memory is tight (1GB Pi 3, 2GB Pi 4).
729+
local cargo_jobs=""
730+
local total_kb
731+
total_kb=$(grep MemTotal /proc/meminfo 2>/dev/null | awk '{print $2}')
732+
if [ -n "$total_kb" ] && [ "$total_kb" -lt 4000000 ]; then
733+
cargo_jobs="-j 1"
734+
echo " Low memory detected — limiting build to one job"
735+
fi
736+
737+
if ! ( cd "$src" && cargo build --release $cargo_jobs --bin proxmox-backup-client ) 2>&1 | tail -15; then
738+
echo " ✗ cargo build failed — see output above"
739+
echo " The proxmox-backup workspace can be sensitive to system library"
740+
echo " versions. If openssl-sys, libfuse-sys, or proxmox-* crates"
741+
echo " failed, install the matching -devel/-dev packages and re-run."
742+
rm -rf "$src"
743+
return 1
744+
fi
745+
746+
if [ -x "$src/target/release/proxmox-backup-client" ]; then
747+
install -m 0755 "$src/target/release/proxmox-backup-client" /usr/local/bin/proxmox-backup-client
748+
echo " ✓ proxmox-backup-client built and installed to /usr/local/bin/"
749+
rm -rf "$src"
750+
return 0
751+
fi
752+
rm -rf "$src"
753+
return 1
754+
}
755+
756+
if [ "$pbs_install_success" != "true" ] && [ "$SKIP_PBS_BUILD" != "true" ]; then
757+
# Tell the user WHY the install failed (most likely: arch mismatch).
758+
case "$HOST_ARCH" in
759+
x86_64)
760+
echo " ⚠ proxmox-backup-client install failed on x86_64 — unusual."
761+
echo " Network or repo issue likely. Skipping source build (the apt"
762+
echo " path should have worked). Re-run with --build-pbs to force"
763+
echo " a from-source attempt anyway."
764+
;;
765+
aarch64|arm64|armv7l|armv6l)
766+
echo ""
767+
echo " ℹ Proxmox doesn't publish proxmox-backup-client binaries for $HOST_ARCH."
768+
echo " The Debian PBS repo at download.proxmox.com only has binary-amd64/."
769+
echo " Falling back to source build so PBS backup destinations work here."
770+
pbs_build_from_source && pbs_install_success=true
771+
;;
772+
*)
773+
echo " ℹ No upstream proxmox-backup-client binary for $HOST_ARCH."
774+
echo " Attempting source build via cargo..."
775+
pbs_build_from_source && pbs_install_success=true
776+
;;
777+
esac
778+
fi
779+
780+
# Allow `--build-pbs` to force a source build on amd64 too (useful for users
781+
# who want to track upstream master rather than the published bookworm/trixie
782+
# .deb releases).
783+
if [ "$pbs_install_success" = "true" ] && [ "$FORCE_PBS_BUILD" = "true" ]; then
784+
echo " --build-pbs requested — replacing installed binary with source build"
785+
pbs_build_from_source || true
786+
fi
787+
if [ "$pbs_install_success" != "true" ] && [ "$FORCE_PBS_BUILD" = "true" ]; then
788+
pbs_build_from_source && pbs_install_success=true
789+
fi
790+
665791
if [ "$pbs_install_success" != "true" ]; then
666-
echo "⚠ Could not install proxmox-backup-client. PBS integration will be unavailable."
667-
echo " You can install manually later. See: https://pbs.proxmox.com/docs/backup-client.html"
792+
echo ""
793+
echo " ⚠ proxmox-backup-client is NOT installed on this host."
794+
echo " Impact: PBS backup destinations in WolfStack will not work."
795+
echo " Workarounds — these backup destinations all work without PBS client:"
796+
echo " • Local filesystem"
797+
echo " • S3 / S3-compatible (Backblaze B2, MinIO, etc.)"
798+
echo " • NFS mount"
799+
echo " • SMB / CIFS share"
800+
echo " • SSHFS to a remote WolfStack node"
801+
echo " • WolfDisk replication"
802+
echo " Manual install (if you really need PBS): https://pbs.proxmox.com/docs/backup-client.html"
668803
fi
669804

670805
# Fix libfuse3 soname: proxmox-backup-client links against libfuse3.so.3

0 commit comments

Comments
 (0)