Add support for linux-386 and linux-armv6 architectures (related to #674)
Adds build support for 32-bit x86 (i386/i686) and ARMv6 (older Raspberry Pi models) architectures across all agents and install scripts. Changes: - Add linux-386 and linux-armv6 to build-release.sh builds array - Update Dockerfile to build docker-agent, host-agent, and sensor-proxy for new architectures - Update all install scripts to detect and handle i386/i686 and armv6l architectures - Add architecture normalization in router download endpoints - Update update manager architecture mapping - Update validate-release.sh to expect 24 binaries (was 18) This enables Pulse agents to run on older/legacy hardware including 32-bit x86 systems and Raspberry Pi Zero/Zero W devices.
This commit is contained in:
parent
1b221cca71
commit
4834dea05b
9 changed files with 67 additions and 4 deletions
30
Dockerfile
30
Dockerfile
|
|
@ -70,14 +70,24 @@ RUN --mount=type=cache,id=pulse-go-mod,target=/go/pkg/mod \
|
|||
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build \
|
||||
-ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/dockeragent.Version=${VERSION}" \
|
||||
-trimpath \
|
||||
-o pulse-docker-agent-linux-armv7 ./cmd/pulse-docker-agent; \
|
||||
-o pulse-docker-agent-linux-armv7 ./cmd/pulse-docker-agent && \
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build \
|
||||
-ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/dockeragent.Version=${VERSION}" \
|
||||
-trimpath \
|
||||
-o pulse-docker-agent-linux-armv6 ./cmd/pulse-docker-agent && \
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=386 go build \
|
||||
-ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/dockeragent.Version=${VERSION}" \
|
||||
-trimpath \
|
||||
-o pulse-docker-agent-linux-386 ./cmd/pulse-docker-agent; \
|
||||
else \
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
|
||||
-ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/dockeragent.Version=${VERSION}" \
|
||||
-trimpath \
|
||||
-o pulse-docker-agent-linux-amd64 ./cmd/pulse-docker-agent && \
|
||||
cp pulse-docker-agent-linux-amd64 pulse-docker-agent-linux-arm64 && \
|
||||
cp pulse-docker-agent-linux-amd64 pulse-docker-agent-linux-armv7; \
|
||||
cp pulse-docker-agent-linux-amd64 pulse-docker-agent-linux-armv7 && \
|
||||
cp pulse-docker-agent-linux-amd64 pulse-docker-agent-linux-armv6 && \
|
||||
cp pulse-docker-agent-linux-amd64 pulse-docker-agent-linux-386; \
|
||||
fi && \
|
||||
cp pulse-docker-agent-linux-amd64 pulse-docker-agent
|
||||
|
||||
|
|
@ -97,6 +107,14 @@ RUN --mount=type=cache,id=pulse-go-mod,target=/go/pkg/mod \
|
|||
-ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/hostagent.Version=${VERSION}" \
|
||||
-trimpath \
|
||||
-o pulse-host-agent-linux-armv7 ./cmd/pulse-host-agent && \
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build \
|
||||
-ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/hostagent.Version=${VERSION}" \
|
||||
-trimpath \
|
||||
-o pulse-host-agent-linux-armv6 ./cmd/pulse-host-agent && \
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=386 go build \
|
||||
-ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/hostagent.Version=${VERSION}" \
|
||||
-trimpath \
|
||||
-o pulse-host-agent-linux-386 ./cmd/pulse-host-agent && \
|
||||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build \
|
||||
-ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/hostagent.Version=${VERSION}" \
|
||||
-trimpath \
|
||||
|
|
@ -132,6 +150,14 @@ RUN --mount=type=cache,id=pulse-go-mod,target=/go/pkg/mod \
|
|||
-ldflags="-s -w -X main.Version=${VERSION} -X main.BuildTime=${BUILD_TIME} -X main.GitCommit=${GIT_COMMIT}" \
|
||||
-trimpath \
|
||||
-o pulse-sensor-proxy-linux-armv7 ./cmd/pulse-sensor-proxy && \
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build \
|
||||
-ldflags="-s -w -X main.Version=${VERSION} -X main.BuildTime=${BUILD_TIME} -X main.GitCommit=${GIT_COMMIT}" \
|
||||
-trimpath \
|
||||
-o pulse-sensor-proxy-linux-armv6 ./cmd/pulse-sensor-proxy && \
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=386 go build \
|
||||
-ldflags="-s -w -X main.Version=${VERSION} -X main.BuildTime=${BUILD_TIME} -X main.GitCommit=${GIT_COMMIT}" \
|
||||
-trimpath \
|
||||
-o pulse-sensor-proxy-linux-386 ./cmd/pulse-sensor-proxy && \
|
||||
cp pulse-sensor-proxy-linux-amd64 pulse-sensor-proxy
|
||||
|
||||
# Runtime image for the Docker agent (offered via --target agent_runtime)
|
||||
|
|
|
|||
|
|
@ -3520,6 +3520,10 @@ func (r *Router) handleDownloadPulseSensorProxy(w http.ResponseWriter, req *http
|
|||
filename = "pulse-sensor-proxy-linux-arm64"
|
||||
case "linux-armv7", "armv7", "armhf":
|
||||
filename = "pulse-sensor-proxy-linux-armv7"
|
||||
case "linux-armv6", "armv6":
|
||||
filename = "pulse-sensor-proxy-linux-armv6"
|
||||
case "linux-386", "386", "i386", "i686":
|
||||
filename = "pulse-sensor-proxy-linux-386"
|
||||
default:
|
||||
writeErrorResponse(w, http.StatusBadRequest, "unsupported_arch", fmt.Sprintf("Unsupported architecture: %s", arch), nil)
|
||||
return
|
||||
|
|
@ -3702,6 +3706,10 @@ func normalizeDockerAgentArch(arch string) string {
|
|||
return "linux-arm64"
|
||||
case "linux-armv7", "armv7", "armv7l", "armhf":
|
||||
return "linux-armv7"
|
||||
case "linux-armv6", "armv6", "armv6l":
|
||||
return "linux-armv6"
|
||||
case "linux-386", "386", "i386", "i686":
|
||||
return "linux-386"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -253,6 +253,7 @@ func (m *Manager) CheckForUpdatesWithChannel(ctx context.Context, channel string
|
|||
"amd64": "amd64",
|
||||
"arm64": "arm64",
|
||||
"arm": "armv7",
|
||||
"386": "386",
|
||||
}
|
||||
|
||||
targetArch, ok := archMap[arch]
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ declare -A builds=(
|
|||
["linux-amd64"]="GOOS=linux GOARCH=amd64"
|
||||
["linux-arm64"]="GOOS=linux GOARCH=arm64"
|
||||
["linux-armv7"]="GOOS=linux GOARCH=arm GOARM=7"
|
||||
["linux-armv6"]="GOOS=linux GOARCH=arm GOARM=6"
|
||||
["linux-386"]="GOOS=linux GOARCH=386"
|
||||
)
|
||||
|
||||
for build_name in "${!builds[@]}"; do
|
||||
|
|
|
|||
|
|
@ -451,6 +451,12 @@ determine_arch() {
|
|||
armv7l|armhf|armv7)
|
||||
DOWNLOAD_ARCH="linux-armv7"
|
||||
;;
|
||||
armv6l)
|
||||
DOWNLOAD_ARCH="linux-armv6"
|
||||
;;
|
||||
i386|i686)
|
||||
DOWNLOAD_ARCH="linux-386"
|
||||
;;
|
||||
*)
|
||||
DOWNLOAD_ARCH=""
|
||||
;;
|
||||
|
|
|
|||
|
|
@ -1218,6 +1218,12 @@ if [[ "$UNINSTALL" != true ]]; then
|
|||
armv7l|armhf|armv7)
|
||||
DOWNLOAD_ARCH="linux-armv7"
|
||||
;;
|
||||
armv6l)
|
||||
DOWNLOAD_ARCH="linux-armv6"
|
||||
;;
|
||||
i386|i686)
|
||||
DOWNLOAD_ARCH="linux-386"
|
||||
;;
|
||||
*)
|
||||
DOWNLOAD_ARCH=""
|
||||
log_warn "Unknown architecture '$ARCH'. Falling back to default agent binary."
|
||||
|
|
|
|||
|
|
@ -213,6 +213,12 @@ case "$ARCH" in
|
|||
armv7l|armhf)
|
||||
ARCH="armv7"
|
||||
;;
|
||||
armv6l)
|
||||
ARCH="armv6"
|
||||
;;
|
||||
i386|i686)
|
||||
ARCH="386"
|
||||
;;
|
||||
*)
|
||||
log_warn "Unknown architecture $ARCH, defaulting to amd64"
|
||||
ARCH="amd64"
|
||||
|
|
|
|||
|
|
@ -427,6 +427,14 @@ else
|
|||
BINARY_NAME="pulse-sensor-proxy-linux-armv7"
|
||||
ARCH_LABEL="linux-armv7"
|
||||
;;
|
||||
armv6l)
|
||||
BINARY_NAME="pulse-sensor-proxy-linux-armv6"
|
||||
ARCH_LABEL="linux-armv6"
|
||||
;;
|
||||
i386|i686)
|
||||
BINARY_NAME="pulse-sensor-proxy-linux-386"
|
||||
ARCH_LABEL="linux-386"
|
||||
;;
|
||||
*)
|
||||
print_error "Unsupported architecture: $ARCH"
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ success "All installer/uninstaller scripts present and executable"
|
|||
|
||||
# Validate all required binaries exist and are non-empty
|
||||
info "Checking downloadable binaries in /opt/pulse/bin/..."
|
||||
docker run --rm --entrypoint /bin/sh "$IMAGE" -c 'set -euo pipefail; cd /opt/pulse/bin; required="pulse pulse-docker-agent pulse-docker-agent-linux-amd64 pulse-docker-agent-linux-arm64 pulse-docker-agent-linux-armv7 pulse-host-agent-linux-amd64 pulse-host-agent-linux-arm64 pulse-host-agent-linux-armv7 pulse-host-agent-darwin-amd64 pulse-host-agent-darwin-arm64 pulse-host-agent-windows-amd64.exe pulse-host-agent-windows-amd64 pulse-host-agent-windows-arm64.exe pulse-host-agent-windows-arm64 pulse-sensor-proxy pulse-sensor-proxy-linux-amd64 pulse-sensor-proxy-linux-arm64 pulse-sensor-proxy-linux-armv7"; for f in $required; do [ -e "$f" ] || { echo "missing binary $f" >&2; exit 1; }; [ -s "$f" ] || { echo "empty binary $f" >&2; exit 1; }; done; [ "$(readlink pulse-host-agent-windows-amd64)" = "pulse-host-agent-windows-amd64.exe" ] || { echo "windows amd64 symlink broken" >&2; exit 1; }; [ "$(readlink pulse-host-agent-windows-arm64)" = "pulse-host-agent-windows-arm64.exe" ] || { echo "windows arm64 symlink broken" >&2; exit 1; }; echo "All binaries present"' || { error "Binary validation failed"; exit 1; }
|
||||
success "All downloadable binaries present (18 binaries + 2 Windows symlinks)"
|
||||
docker run --rm --entrypoint /bin/sh "$IMAGE" -c 'set -euo pipefail; cd /opt/pulse/bin; required="pulse pulse-docker-agent pulse-docker-agent-linux-amd64 pulse-docker-agent-linux-arm64 pulse-docker-agent-linux-armv7 pulse-docker-agent-linux-armv6 pulse-docker-agent-linux-386 pulse-host-agent-linux-amd64 pulse-host-agent-linux-arm64 pulse-host-agent-linux-armv7 pulse-host-agent-linux-armv6 pulse-host-agent-linux-386 pulse-host-agent-darwin-amd64 pulse-host-agent-darwin-arm64 pulse-host-agent-windows-amd64.exe pulse-host-agent-windows-amd64 pulse-host-agent-windows-arm64.exe pulse-host-agent-windows-arm64 pulse-sensor-proxy pulse-sensor-proxy-linux-amd64 pulse-sensor-proxy-linux-arm64 pulse-sensor-proxy-linux-armv7 pulse-sensor-proxy-linux-armv6 pulse-sensor-proxy-linux-386"; for f in $required; do [ -e "$f" ] || { echo "missing binary $f" >&2; exit 1; }; [ -s "$f" ] || { echo "empty binary $f" >&2; exit 1; }; done; [ "$(readlink pulse-host-agent-windows-amd64)" = "pulse-host-agent-windows-amd64.exe" ] || { echo "windows amd64 symlink broken" >&2; exit 1; }; [ "$(readlink pulse-host-agent-windows-arm64)" = "pulse-host-agent-windows-arm64.exe" ] || { echo "windows arm64 symlink broken" >&2; exit 1; }; echo "All binaries present"' || { error "Binary validation failed"; exit 1; }
|
||||
success "All downloadable binaries present (24 binaries + 2 Windows symlinks)"
|
||||
|
||||
# Validate version embedding in Docker image binaries
|
||||
info "Validating version embedding in Docker image binaries..."
|
||||
|
|
|
|||
Loading…
Reference in a new issue