Improve arm64 support and arch-specific downloads

Add clearer architecture error messages and gate arm64 usage, plus implement architecture-aware behavior across the toolkit. Changes include: update exit-code messages to reference amd64/arm64, refuse arm64 unless explicitly enabled, show architecture in summaries, and use arch-specific package lists when installing in containers. Make downloads for FFmpeg and yq choose the correct amd64/arm64 binaries, tighten template download error handling and formatting, and clean up minor whitespace/comment issues. These changes aim to make arm64 handling explicit and downloads/installations more robust for non-amd64 systems.
This commit is contained in:
CanbiZ (MickLesk)
2026-03-11 14:23:56 +01:00
parent 6f8aa6eadc
commit 7c051fb648
6 changed files with 110 additions and 82 deletions
+5 -5
View File
@@ -196,7 +196,7 @@ explain_exit_code() {
103) echo "Validation: Shell is not Bash" ;; 103) echo "Validation: Shell is not Bash" ;;
104) echo "Validation: Not running as root (or invoked via sudo)" ;; 104) echo "Validation: Not running as root (or invoked via sudo)" ;;
105) echo "Validation: Proxmox VE version not supported" ;; 105) echo "Validation: Proxmox VE version not supported" ;;
106) echo "Validation: Architecture not supported (ARM / PiMox)" ;; 106) echo "Validation: Unsupported architecture (requires amd64 or arm64)" ;;
107) echo "Validation: Kernel key parameters unreadable" ;; 107) echo "Validation: Kernel key parameters unreadable" ;;
108) echo "Validation: Kernel key limits exceeded" ;; 108) echo "Validation: Kernel key limits exceeded" ;;
109) echo "Proxmox: No available container ID after max attempts" ;; 109) echo "Proxmox: No available container ID after max attempts" ;;
@@ -348,10 +348,10 @@ explain_exit_code() {
json_escape() { json_escape() {
# Escape a string for safe JSON embedding using awk (handles any input size). # Escape a string for safe JSON embedding using awk (handles any input size).
# Pipeline: strip ANSI → remove control chars → escape \ " TAB → join lines with \n # Pipeline: strip ANSI → remove control chars → escape \ " TAB → join lines with \n
printf '%s' "$1" \ printf '%s' "$1" |
| sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' \ sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' |
| tr -d '\000-\010\013\014\016-\037\177\r' \ tr -d '\000-\010\013\014\016-\037\177\r' |
| awk ' awk '
BEGIN { ORS = "" } BEGIN { ORS = "" }
{ {
gsub(/\\/, "\\\\") # backslash → \\ gsub(/\\/, "\\\\") # backslash → \\
+81 -72
View File
@@ -1826,9 +1826,9 @@ advanced_settings() {
while [ $STEP -le $MAX_STEP ]; do while [ $STEP -le $MAX_STEP ]; do
case $STEP in case $STEP in
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 1: Container Type # STEP 1: Container Type
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
1) 1)
local default_on="ON" local default_on="ON"
local default_off="OFF" local default_off="OFF"
@@ -1851,9 +1851,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 2: Root Password # STEP 2: Root Password
# ══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
2) 2)
if PW1=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if PW1=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "ROOT PASSWORD" \ --title "ROOT PASSWORD" \
@@ -1905,9 +1905,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 3: Container ID # STEP 3: Container ID
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
3) 3)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "CONTAINER ID" \ --title "CONTAINER ID" \
@@ -1939,9 +1939,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 4: Hostname # STEP 4: Hostname
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
4) 4)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "HOSTNAME" \ --title "HOSTNAME" \
@@ -1962,9 +1962,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 5: Disk Size # STEP 5: Disk Size
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
5) 5)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "DISK SIZE" \ --title "DISK SIZE" \
@@ -1983,9 +1983,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 6: CPU Cores # STEP 6: CPU Cores
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
6) 6)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "CPU CORES" \ --title "CPU CORES" \
@@ -2004,9 +2004,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 7: RAM Size # STEP 7: RAM Size
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
7) 7)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "RAM SIZE" \ --title "RAM SIZE" \
@@ -2025,9 +2025,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 8: Network Bridge # STEP 8: Network Bridge
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
8) 8)
if [[ ${#BRIDGE_MENU_OPTIONS[@]} -eq 0 ]]; then if [[ ${#BRIDGE_MENU_OPTIONS[@]} -eq 0 ]]; then
# Validate default bridge exists # Validate default bridge exists
@@ -2063,9 +2063,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 9: IPv4 Configuration # STEP 9: IPv4 Configuration
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
9) 9)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "IPv4 CONFIGURATION" \ --title "IPv4 CONFIGURATION" \
@@ -2160,9 +2160,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 10: IPv6 Configuration # STEP 10: IPv6 Configuration
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
10) 10)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "IPv6 CONFIGURATION" \ --title "IPv6 CONFIGURATION" \
@@ -2235,9 +2235,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 11: MTU Size # STEP 11: MTU Size
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
11) 11)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "MTU SIZE" \ --title "MTU SIZE" \
@@ -2255,9 +2255,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 12: DNS Search Domain # STEP 12: DNS Search Domain
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
12) 12)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "DNS SEARCH DOMAIN" \ --title "DNS SEARCH DOMAIN" \
@@ -2271,9 +2271,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 13: DNS Server # STEP 13: DNS Server
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
13) 13)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "DNS SERVER" \ --title "DNS SERVER" \
@@ -2287,9 +2287,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 14: MAC Address # STEP 14: MAC Address
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
14) 14)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "MAC ADDRESS" \ --title "MAC ADDRESS" \
@@ -2307,9 +2307,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 15: VLAN Tag # STEP 15: VLAN Tag
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
15) 15)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "VLAN TAG" \ --title "VLAN TAG" \
@@ -2327,9 +2327,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 16: Tags # STEP 16: Tags
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
16) 16)
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
--title "CONTAINER TAGS" \ --title "CONTAINER TAGS" \
@@ -2349,18 +2349,18 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 17: SSH Settings # STEP 17: SSH Settings
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
17) 17)
configure_ssh_settings "Step $STEP/$MAX_STEP" configure_ssh_settings "Step $STEP/$MAX_STEP"
# configure_ssh_settings handles its own flow, always advance # configure_ssh_settings handles its own flow, always advance
((STEP++)) ((STEP++))
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 18: FUSE Support # STEP 18: FUSE Support
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
18) 18)
local fuse_default_flag="--defaultno" local fuse_default_flag="--defaultno"
[[ "$_enable_fuse" == "yes" || "$_enable_fuse" == "1" ]] && fuse_default_flag="" [[ "$_enable_fuse" == "yes" || "$_enable_fuse" == "1" ]] && fuse_default_flag=""
@@ -2382,9 +2382,9 @@ advanced_settings() {
((STEP++)) ((STEP++))
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 19: TUN/TAP Support # STEP 19: TUN/TAP Support
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
19) 19)
local tun_default_flag="--defaultno" local tun_default_flag="--defaultno"
[[ "$_enable_tun" == "yes" || "$_enable_tun" == "1" ]] && tun_default_flag="" [[ "$_enable_tun" == "yes" || "$_enable_tun" == "1" ]] && tun_default_flag=""
@@ -2406,9 +2406,9 @@ advanced_settings() {
((STEP++)) ((STEP++))
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 20: Nesting Support # STEP 20: Nesting Support
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
20) 20)
local nesting_default_flag="" local nesting_default_flag=""
[[ "$_enable_nesting" == "0" || "$_enable_nesting" == "no" ]] && nesting_default_flag="--defaultno" [[ "$_enable_nesting" == "0" || "$_enable_nesting" == "no" ]] && nesting_default_flag="--defaultno"
@@ -2436,9 +2436,9 @@ advanced_settings() {
((STEP++)) ((STEP++))
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 21: GPU Passthrough # STEP 21: GPU Passthrough
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
21) 21)
local gpu_default_flag="--defaultno" local gpu_default_flag="--defaultno"
[[ "$_enable_gpu" == "yes" ]] && gpu_default_flag="" [[ "$_enable_gpu" == "yes" ]] && gpu_default_flag=""
@@ -2460,9 +2460,9 @@ advanced_settings() {
((STEP++)) ((STEP++))
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 22: Keyctl Support (Docker/systemd) # STEP 22: Keyctl Support (Docker/systemd)
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
22) 22)
local keyctl_default_flag="--defaultno" local keyctl_default_flag="--defaultno"
[[ "$_enable_keyctl" == "1" ]] && keyctl_default_flag="" [[ "$_enable_keyctl" == "1" ]] && keyctl_default_flag=""
@@ -2484,9 +2484,9 @@ advanced_settings() {
((STEP++)) ((STEP++))
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 23: APT Cacher Proxy # STEP 23: APT Cacher Proxy
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
23) 23)
local apt_cacher_default_flag="--defaultno" local apt_cacher_default_flag="--defaultno"
[[ "$_apt_cacher" == "yes" ]] && apt_cacher_default_flag="" [[ "$_apt_cacher" == "yes" ]] && apt_cacher_default_flag=""
@@ -2516,9 +2516,9 @@ advanced_settings() {
((STEP++)) ((STEP++))
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 24: Container Timezone # STEP 24: Container Timezone
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
24) 24)
local tz_hint="$_ct_timezone" local tz_hint="$_ct_timezone"
[[ -z "$tz_hint" ]] && tz_hint="(empty - will use host timezone)" [[ -z "$tz_hint" ]] && tz_hint="(empty - will use host timezone)"
@@ -2541,9 +2541,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 25: Container Protection # STEP 25: Container Protection
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
25) 25)
local protect_default_flag="--defaultno" local protect_default_flag="--defaultno"
[[ "$_protect_ct" == "yes" || "$_protect_ct" == "1" ]] && protect_default_flag="" [[ "$_protect_ct" == "yes" || "$_protect_ct" == "1" ]] && protect_default_flag=""
@@ -2565,9 +2565,9 @@ advanced_settings() {
((STEP++)) ((STEP++))
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 26: Device Node Creation (mknod) # STEP 26: Device Node Creation (mknod)
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
26) 26)
local mknod_default_flag="--defaultno" local mknod_default_flag="--defaultno"
[[ "$_enable_mknod" == "1" ]] && mknod_default_flag="" [[ "$_enable_mknod" == "1" ]] && mknod_default_flag=""
@@ -2589,9 +2589,9 @@ advanced_settings() {
((STEP++)) ((STEP++))
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 27: Mount Filesystems # STEP 27: Mount Filesystems
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
27) 27)
local mount_hint="" local mount_hint=""
[[ -n "$_mount_fs" ]] && mount_hint="$_mount_fs" || mount_hint="(none)" [[ -n "$_mount_fs" ]] && mount_hint="$_mount_fs" || mount_hint="(none)"
@@ -2608,9 +2608,9 @@ advanced_settings() {
fi fi
;; ;;
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# STEP 28: Verbose Mode & Confirmation # STEP 28: Verbose Mode & Confirmation
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
28) 28)
local verbose_default_flag="--defaultno" local verbose_default_flag="--defaultno"
[[ "$_verbose" == "yes" ]] && verbose_default_flag="" [[ "$_verbose" == "yes" ]] && verbose_default_flag=""
@@ -2676,9 +2676,9 @@ Advanced:
esac esac
done done
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
# Apply all collected values to global variables # Apply all collected values to global variables
# ═══════════════════════════════════════════════════════════════════════════ # ------------------------------------------------------------------------------
CT_TYPE="$_ct_type" CT_TYPE="$_ct_type"
PW="$_pw" PW="$_pw"
CT_ID="$_ct_id" CT_ID="$_ct_id"
@@ -2895,6 +2895,9 @@ echo_default() {
echo -e "${DISKSIZE}${BOLD}${DGN}Disk Size: ${BGN}${DISK_SIZE} GB${CL}" echo -e "${DISKSIZE}${BOLD}${DGN}Disk Size: ${BGN}${DISK_SIZE} GB${CL}"
echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}${CORE_COUNT}${CL}" echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}${CORE_COUNT}${CL}"
echo -e "${RAMSIZE}${BOLD}${DGN}RAM Size: ${BGN}${RAM_SIZE} MiB${CL}" echo -e "${RAMSIZE}${BOLD}${DGN}RAM Size: ${BGN}${RAM_SIZE} MiB${CL}"
if [[ "$(dpkg --print-architecture)" == "arm64" ]]; then
echo -e "${INFO}${BOLD}${DGN}Architecture: ${BGN}arm64${CL}"
fi
if [[ -n "${var_gpu:-}" && "${var_gpu}" == "yes" ]]; then if [[ -n "${var_gpu:-}" && "${var_gpu}" == "yes" ]]; then
echo -e "${GPU}${BOLD}${DGN}GPU Passthrough: ${BGN}Enabled${CL}" echo -e "${GPU}${BOLD}${DGN}GPU Passthrough: ${BGN}Enabled${CL}"
fi fi
@@ -3425,9 +3428,6 @@ start() {
set_std_mode set_std_mode
ensure_profile_loaded ensure_profile_loaded
get_lxc_ip get_lxc_ip
if [[ "$(dpkg --print-architecture)" == "arm64" ]] && declare -f update_script_arm64 >/dev/null 2>&1; then
update_script_arm64
fi
update_script update_script
update_motd_ip update_motd_ip
cleanup_lxc cleanup_lxc
@@ -3456,9 +3456,6 @@ start() {
esac esac
ensure_profile_loaded ensure_profile_loaded
get_lxc_ip get_lxc_ip
if [[ "$(dpkg --print-architecture)" == "arm64" ]] && declare -f update_script_arm64 >/dev/null 2>&1; then
update_script_arm64
fi
update_script update_script
update_motd_ip update_motd_ip
cleanup_lxc cleanup_lxc
@@ -4071,7 +4068,11 @@ EOF'
msg_warn "Skipping timezone setup zone '$tz' not found in container" msg_warn "Skipping timezone setup zone '$tz' not found in container"
fi fi
pct exec "$CTID" -- bash -c "apt-get update 2>&1 && apt-get install -y sudo curl mc gnupg2 jq 2>&1" >>"$BUILD_LOG" 2>&1 || { local _base_pkgs="sudo curl mc gnupg2 jq"
if [[ "${ARCH:-amd64}" == "arm64" ]]; then
_base_pkgs+=" openssh-server wget gcc"
fi
pct exec "$CTID" -- bash -c "apt-get update 2>&1 && apt-get install -y ${_base_pkgs} 2>&1" >>"$BUILD_LOG" 2>&1 || {
msg_error "apt-get base packages installation failed" msg_error "apt-get base packages installation failed"
install_exit_code=1 install_exit_code=1
} }
@@ -5026,13 +5027,15 @@ create_lxc_container() {
case "$2" in case "$2" in
12 | 12.*) echo "bookworm" ;; 13 | 13.*) echo "trixie" ;; 12 | 12.*) echo "bookworm" ;; 13 | 13.*) echo "trixie" ;;
*) echo "trixie" ;; *) echo "trixie" ;;
esac ;; esac
;;
alpine) echo "3.22" ;; alpine) echo "3.22" ;;
ubuntu) ubuntu)
case "$2" in case "$2" in
24.04* | noble) echo "noble" ;; 24.10* | oracular) echo "oracular" ;; 24.04* | noble) echo "noble" ;; 24.10* | oracular) echo "oracular" ;;
*) echo "jammy" ;; *) echo "jammy" ;;
esac ;; esac
;;
*) return 1 ;; *) return 1 ;;
esac esac
} }
@@ -5043,12 +5046,18 @@ create_lxc_container() {
download_arm64_template() { download_arm64_template() {
local dest="$1" url local dest="$1" url
mkdir -p "$(dirname "$dest")" || { msg_error "Cannot create template dir."; exit 207; } mkdir -p "$(dirname "$dest")" || {
msg_error "Cannot create template dir."
exit 207
}
if [[ "$PCT_OSTYPE" == "debian" ]]; then if [[ "$PCT_OSTYPE" == "debian" ]]; then
url=$(curl -fsSL "https://api.github.com/repos/asylumexp/debian-ifupdown2-lxc/releases/latest" \ url=$(curl -fsSL "https://api.github.com/repos/asylumexp/debian-ifupdown2-lxc/releases/latest" |
| grep -Eo "https://[^\"]*debian-${CUSTOM_TEMPLATE_VARIANT}-arm64-rootfs\.tar\.xz" | head -n1) grep -Eo "https://[^\"]*debian-${CUSTOM_TEMPLATE_VARIANT}-arm64-rootfs\.tar\.xz" | head -n1)
[[ -n "$url" ]] || { msg_error "Could not find Debian ${CUSTOM_TEMPLATE_VARIANT} ARM64 template URL."; exit 207; } [[ -n "$url" ]] || {
msg_error "Could not find Debian ${CUSTOM_TEMPLATE_VARIANT} ARM64 template URL."
exit 207
}
else else
url="https://jenkins.linuxcontainers.org/job/image-${PCT_OSTYPE}/architecture=arm64,release=${CUSTOM_TEMPLATE_VARIANT},variant=default/lastStableBuild/artifact/rootfs.tar.xz" url="https://jenkins.linuxcontainers.org/job/image-${PCT_OSTYPE}/architecture=arm64,release=${CUSTOM_TEMPLATE_VARIANT},variant=default/lastStableBuild/artifact/rootfs.tar.xz"
fi fi
+5
View File
@@ -351,6 +351,11 @@ arch_check() {
sleep 2 sleep 2
exit 106 exit 106
fi fi
if [[ "$arch" == "arm64" && "${var_arm64:-}" != "yes" ]]; then
msg_error "This script does not yet support arm64."
sleep 2
exit 106
fi
} }
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
+1 -1
View File
@@ -99,7 +99,7 @@ if ! declare -f explain_exit_code &>/dev/null; then
103) echo "Validation: Shell is not Bash" ;; 103) echo "Validation: Shell is not Bash" ;;
104) echo "Validation: Not running as root (or invoked via sudo)" ;; 104) echo "Validation: Not running as root (or invoked via sudo)" ;;
105) echo "Validation: Proxmox VE version not supported" ;; 105) echo "Validation: Proxmox VE version not supported" ;;
106) echo "Validation: Architecture not supported (ARM / PiMox)" ;; 106) echo "Validation: Unsupported architecture (requires amd64 or arm64)" ;;
107) echo "Validation: Kernel key parameters unreadable" ;; 107) echo "Validation: Kernel key parameters unreadable" ;;
108) echo "Validation: Kernel key limits exceeded" ;; 108) echo "Validation: Kernel key limits exceeded" ;;
109) echo "Proxmox: No available container ID after max attempts" ;; 109) echo "Proxmox: No available container ID after max attempts" ;;
-1
View File
@@ -235,7 +235,6 @@ EOF
fi fi
apt_update_safe apt_update_safe
$STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade $STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade
$STD apt-get install -y sudo curl mc gnupg2 openssh-server wget gcc
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
msg_ok "Updated Container OS" msg_ok "Updated Container OS"
post_progress_to_api post_progress_to_api
+18 -3
View File
@@ -3651,7 +3651,12 @@ function setup_ffmpeg() {
# Binary fallback mode # Binary fallback mode
if [[ "$TYPE" == "binary" ]]; then if [[ "$TYPE" == "binary" ]]; then
if ! CURL_TIMEOUT=300 curl_with_retry "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" "$TMP_DIR/ffmpeg.tar.xz"; then local ffmpeg_arch
case "$(dpkg --print-architecture 2>/dev/null || echo amd64)" in
arm64) ffmpeg_arch="arm64" ;;
*) ffmpeg_arch="amd64" ;;
esac
if ! CURL_TIMEOUT=300 curl_with_retry "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-${ffmpeg_arch}-static.tar.xz" "$TMP_DIR/ffmpeg.tar.xz"; then
msg_error "Failed to download FFmpeg binary" msg_error "Failed to download FFmpeg binary"
rm -rf "$TMP_DIR" rm -rf "$TMP_DIR"
return 1 return 1
@@ -3733,7 +3738,12 @@ function setup_ffmpeg() {
# If no source download (either VERSION empty or download failed), use binary # If no source download (either VERSION empty or download failed), use binary
if [[ -z "$VERSION" ]]; then if [[ -z "$VERSION" ]]; then
msg_info "Setup FFmpeg from pre-built binary" msg_info "Setup FFmpeg from pre-built binary"
if ! CURL_TIMEOUT=300 curl_with_retry "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" "$TMP_DIR/ffmpeg.tar.xz"; then local ffmpeg_arch
case "$(dpkg --print-architecture 2>/dev/null || echo amd64)" in
arm64) ffmpeg_arch="arm64" ;;
*) ffmpeg_arch="amd64" ;;
esac
if ! CURL_TIMEOUT=300 curl_with_retry "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-${ffmpeg_arch}-static.tar.xz" "$TMP_DIR/ffmpeg.tar.xz"; then
msg_error "Failed to download FFmpeg pre-built binary" msg_error "Failed to download FFmpeg pre-built binary"
rm -rf "$TMP_DIR" rm -rf "$TMP_DIR"
return 1 return 1
@@ -7706,7 +7716,12 @@ function setup_yq() {
msg_info "Setup yq $LATEST_VERSION" msg_info "Setup yq $LATEST_VERSION"
fi fi
if ! curl_with_retry "https://github.com/${GITHUB_REPO}/releases/download/v${LATEST_VERSION}/yq_linux_amd64" "$TMP_DIR/yq"; then local yq_arch
case "$(dpkg --print-architecture 2>/dev/null || echo amd64)" in
arm64) yq_arch="arm64" ;;
*) yq_arch="amd64" ;;
esac
if ! curl_with_retry "https://github.com/${GITHUB_REPO}/releases/download/v${LATEST_VERSION}/yq_linux_${yq_arch}" "$TMP_DIR/yq"; then
msg_error "Failed to download yq" msg_error "Failed to download yq"
rm -rf "$TMP_DIR" rm -rf "$TMP_DIR"
return 1 return 1