Martin: use the legacycpu build on CPUs below x86-64-v3 (#19264)

Martin 2.0's x86_64 builds need AVX2 and the rest of x86-64-v3; on older
CPUs such as the Celeron J and N series or Xeon E5 v1/v2 the binary would
not start after the update. Those now get the -legacycpu build, and an
update from 1.x points to the migration guide once. The default config
starts unchanged on 2.0.
This commit is contained in:
CanbiZ (MickLesk) authored and GitHub committed 2026-12-02 16:10:48 +01:00
1 parent c9997ac852
commit fd696a839f
2 files changed
+14 -2

No files matched your search

+8 -1
View File
@@ -36,7 +36,14 @@ function update_script() {
systemctl stop martin
msg_ok "Stopped Martin"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "martin" "maplibre/martin" "prebuild" "latest" "/opt/martin" "martin-$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl.tar.gz"
if [[ "$(cat ~/.martin 2>/dev/null)" =~ (^|[^0-9])1\.[0-9] ]]; then
msg_warn "Martin 2.0 drops settings 1.x deprecated and needs PostgreSQL 15 and PostGIS 3.5 for database sources: https://maplibre.org/martin/migration-guide/"
fi
MARTIN_ASSET="martin-$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl.tar.gz"
if [[ "$(arch_resolve)" == "amd64" ]] && ! { grep -qw avx2 /proc/cpuinfo && grep -qw bmi2 /proc/cpuinfo && grep -qw fma /proc/cpuinfo && grep -qw movbe /proc/cpuinfo; }; then
MARTIN_ASSET="martin-x86_64-unknown-linux-musl-legacycpu.tar.gz"
fi
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "martin" "maplibre/martin" "prebuild" "latest" "/opt/martin" "$MARTIN_ASSET"
msg_info "Starting Martin"
systemctl start martin
+6 -1
View File
@@ -13,7 +13,12 @@ setting_up_container
network_check
update_os
fetch_and_deploy_gh_release "martin" "maplibre/martin" "prebuild" "latest" "/opt/martin" "martin-$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl.tar.gz"
# Martin 2.x builds for x86_64 need an x86-64-v3 CPU; older ones get the legacycpu build.
MARTIN_ASSET="martin-$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl.tar.gz"
if [[ "$(arch_resolve)" == "amd64" ]] && ! { grep -qw avx2 /proc/cpuinfo && grep -qw bmi2 /proc/cpuinfo && grep -qw fma /proc/cpuinfo && grep -qw movbe /proc/cpuinfo; }; then
MARTIN_ASSET="martin-x86_64-unknown-linux-musl-legacycpu.tar.gz"
fi
fetch_and_deploy_gh_release "martin" "maplibre/martin" "prebuild" "latest" "/opt/martin" "$MARTIN_ASSET"
msg_info "Configuring Martin"
mkdir -p /opt/martin_data/tiles