[arm64] port scripts named A-F

also adds patching of arm64 templates for if it doesnt include /etc/network/interfaces
adds fallback to get_arch_value for alpine
adds neon check for mongodb for arm (avx equivalent)

missing:
alpine-teamspeak-server
apprise-api
archivebox
audiobookshelf
authentik
autocaliweb
baserow
byparr
checkmate
checkmk
degoog
domain-locker
elementsynapse
flaresolverr
flatnotes
freepbx
frigate
This commit is contained in:
Sam Heinz
2026-06-18 23:14:09 +10:00
parent b1eec90772
commit 2178f72ec9
144 changed files with 280 additions and 218 deletions
+31 -3
View File
@@ -5720,9 +5720,37 @@ create_lxc_container() {
url="https://jenkins.linuxcontainers.org/job/image-${PCT_OSTYPE}/architecture=arm64,release=${CUSTOM_TEMPLATE_VARIANT},variant=default/lastStableBuild/artifact/rootfs.tar.xz"
msg_info "Downloading ${PCT_OSTYPE^} ${CUSTOM_TEMPLATE_VARIANT} ARM64 template"
if ! curl -fsSL -o "$dest" "$url"; then
msg_error "Failed to download ARM64 template from: $url"
exit 208
local patched="${dest%/*}/.${dest##*/}.patched"
(
flock -x 200
if [[ -f "$patched" ]] && [[ -s "$dest" ]] && xz -t "$dest" 2>/dev/null; then
exit 0
fi
if ! curl -fsSL -o "$dest" "$url"; then
msg_error "Failed to download ARM64 template from: $url"
exit 208
fi
# Some linuxcontainers.org rootfs builds ship without /etc/network,
# which makes pve-container's post-create hook fail when it writes the
# interfaces file. This appends an empty /etc/network/interfaces if missing.
if ! tar -tJf "$dest" 2>/dev/null | grep -q '/etc/network/$'; then
fixdir=$(mktemp -d)
tmptar="${dest%.xz}"
mkdir -p "$fixdir/etc/network"
: >"$fixdir/etc/network/interfaces"
if xz -d -f "$dest" && tar -C "$fixdir" --append -f "$tmptar" ./etc/network && xz -1 -f "$tmptar"; then
rm -rf "$fixdir"
else
rm -rf "$fixdir" "$tmptar"
msg_error "Failed to patch ARM64 template (missing /etc/network)"
exit 208
fi
fi
touch "$patched"
) 200>"${dest}.lock"
local dl_rc=$?
if [[ $dl_rc -ne 0 ]]; then
exit "$dl_rc"
fi
msg_ok "Downloaded ARM64 LXC template"
}
+5 -4
View File
@@ -370,11 +370,12 @@ arch_check() {
get_arch_value() {
local amd64_val="${1:-amd64}"
local arm64_val="${2:-arm64}"
case "$PCT_ARCH" in
amd64) echo "$amd64_val" ;;
arm64) echo "$arm64_val" ;;
local arch="${PCT_ARCH:-$(dpkg --print-architecture 2>/dev/null || uname -m)}"
case "$arch" in
amd64 | x86_64) echo "$amd64_val" ;;
arm64 | aarch64) echo "$arm64_val" ;;
*)
msg_error "Unsupported architecture: $PCT_ARCH"
msg_error "Unsupported architecture: $arch"
return 106
;;
esac
+16 -6
View File
@@ -6912,14 +6912,24 @@ setup_mongodb() {
export NEEDRESTART_MODE=a
export NEEDRESTART_SUSPEND=1
# Check AVX support
if ! grep -qm1 'avx[^ ]*' /proc/cpuinfo; then
local major="${MONGO_VERSION%%.*}"
if ((major > 5)); then
msg_error "MongoDB ${MONGO_VERSION} requires AVX support, which is not available on this system."
# Check CPU requirements: AVX on x86_64, NEON/ASIMD on arm64
case "$(uname -m)" in
aarch64)
if ! grep -qm1 'asimd' /proc/cpuinfo; then
msg_error "MongoDB ${MONGO_VERSION} requires ARMv8.2-A support, which is not available on this system."
return 236
fi
fi
;;
*)
if ! grep -qm1 'avx[^ ]*' /proc/cpuinfo; then
local major="${MONGO_VERSION%%.*}"
if ((major > 5)); then
msg_error "MongoDB ${MONGO_VERSION} requires AVX support, which is not available on this system."
return 236
fi
fi
;;
esac
case "$DISTRO_ID" in
ubuntu)