mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-28 13:20:40 +00:00
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:
+81
-72
@@ -1826,9 +1826,9 @@ advanced_settings() {
|
||||
while [ $STEP -le $MAX_STEP ]; do
|
||||
case $STEP in
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 1: Container Type
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
1)
|
||||
local default_on="ON"
|
||||
local default_off="OFF"
|
||||
@@ -1851,9 +1851,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 2: Root Password
|
||||
# ════════════════════════════════════════════════════════════════════════���══
|
||||
# ------------------------------------------------------------------------------
|
||||
2)
|
||||
if PW1=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "ROOT PASSWORD" \
|
||||
@@ -1905,9 +1905,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 3: Container ID
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
3)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "CONTAINER ID" \
|
||||
@@ -1939,9 +1939,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 4: Hostname
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
4)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "HOSTNAME" \
|
||||
@@ -1962,9 +1962,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 5: Disk Size
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
5)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "DISK SIZE" \
|
||||
@@ -1983,9 +1983,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 6: CPU Cores
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
6)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "CPU CORES" \
|
||||
@@ -2004,9 +2004,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 7: RAM Size
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
7)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "RAM SIZE" \
|
||||
@@ -2025,9 +2025,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 8: Network Bridge
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
8)
|
||||
if [[ ${#BRIDGE_MENU_OPTIONS[@]} -eq 0 ]]; then
|
||||
# Validate default bridge exists
|
||||
@@ -2063,9 +2063,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 9: IPv4 Configuration
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
9)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "IPv4 CONFIGURATION" \
|
||||
@@ -2160,9 +2160,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 10: IPv6 Configuration
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
10)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "IPv6 CONFIGURATION" \
|
||||
@@ -2235,9 +2235,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 11: MTU Size
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
11)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "MTU SIZE" \
|
||||
@@ -2255,9 +2255,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 12: DNS Search Domain
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
12)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "DNS SEARCH DOMAIN" \
|
||||
@@ -2271,9 +2271,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 13: DNS Server
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
13)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "DNS SERVER" \
|
||||
@@ -2287,9 +2287,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 14: MAC Address
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
14)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "MAC ADDRESS" \
|
||||
@@ -2307,9 +2307,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 15: VLAN Tag
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
15)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "VLAN TAG" \
|
||||
@@ -2327,9 +2327,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 16: Tags
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
16)
|
||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||
--title "CONTAINER TAGS" \
|
||||
@@ -2349,18 +2349,18 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 17: SSH Settings
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
17)
|
||||
configure_ssh_settings "Step $STEP/$MAX_STEP"
|
||||
# configure_ssh_settings handles its own flow, always advance
|
||||
((STEP++))
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 18: FUSE Support
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
18)
|
||||
local fuse_default_flag="--defaultno"
|
||||
[[ "$_enable_fuse" == "yes" || "$_enable_fuse" == "1" ]] && fuse_default_flag=""
|
||||
@@ -2382,9 +2382,9 @@ advanced_settings() {
|
||||
((STEP++))
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 19: TUN/TAP Support
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
19)
|
||||
local tun_default_flag="--defaultno"
|
||||
[[ "$_enable_tun" == "yes" || "$_enable_tun" == "1" ]] && tun_default_flag=""
|
||||
@@ -2406,9 +2406,9 @@ advanced_settings() {
|
||||
((STEP++))
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 20: Nesting Support
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
20)
|
||||
local nesting_default_flag=""
|
||||
[[ "$_enable_nesting" == "0" || "$_enable_nesting" == "no" ]] && nesting_default_flag="--defaultno"
|
||||
@@ -2436,9 +2436,9 @@ advanced_settings() {
|
||||
((STEP++))
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 21: GPU Passthrough
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
21)
|
||||
local gpu_default_flag="--defaultno"
|
||||
[[ "$_enable_gpu" == "yes" ]] && gpu_default_flag=""
|
||||
@@ -2460,9 +2460,9 @@ advanced_settings() {
|
||||
((STEP++))
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 22: Keyctl Support (Docker/systemd)
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
22)
|
||||
local keyctl_default_flag="--defaultno"
|
||||
[[ "$_enable_keyctl" == "1" ]] && keyctl_default_flag=""
|
||||
@@ -2484,9 +2484,9 @@ advanced_settings() {
|
||||
((STEP++))
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 23: APT Cacher Proxy
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
23)
|
||||
local apt_cacher_default_flag="--defaultno"
|
||||
[[ "$_apt_cacher" == "yes" ]] && apt_cacher_default_flag=""
|
||||
@@ -2516,9 +2516,9 @@ advanced_settings() {
|
||||
((STEP++))
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 24: Container Timezone
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
24)
|
||||
local tz_hint="$_ct_timezone"
|
||||
[[ -z "$tz_hint" ]] && tz_hint="(empty - will use host timezone)"
|
||||
@@ -2541,9 +2541,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 25: Container Protection
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
25)
|
||||
local protect_default_flag="--defaultno"
|
||||
[[ "$_protect_ct" == "yes" || "$_protect_ct" == "1" ]] && protect_default_flag=""
|
||||
@@ -2565,9 +2565,9 @@ advanced_settings() {
|
||||
((STEP++))
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 26: Device Node Creation (mknod)
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
26)
|
||||
local mknod_default_flag="--defaultno"
|
||||
[[ "$_enable_mknod" == "1" ]] && mknod_default_flag=""
|
||||
@@ -2589,9 +2589,9 @@ advanced_settings() {
|
||||
((STEP++))
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 27: Mount Filesystems
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
27)
|
||||
local mount_hint=""
|
||||
[[ -n "$_mount_fs" ]] && mount_hint="$_mount_fs" || mount_hint="(none)"
|
||||
@@ -2608,9 +2608,9 @@ advanced_settings() {
|
||||
fi
|
||||
;;
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# STEP 28: Verbose Mode & Confirmation
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
28)
|
||||
local verbose_default_flag="--defaultno"
|
||||
[[ "$_verbose" == "yes" ]] && verbose_default_flag=""
|
||||
@@ -2676,9 +2676,9 @@ Advanced:
|
||||
esac
|
||||
done
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
# Apply all collected values to global variables
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# ------------------------------------------------------------------------------
|
||||
CT_TYPE="$_ct_type"
|
||||
PW="$_pw"
|
||||
CT_ID="$_ct_id"
|
||||
@@ -2895,6 +2895,9 @@ echo_default() {
|
||||
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 "${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
|
||||
echo -e "${GPU}${BOLD}${DGN}GPU Passthrough: ${BGN}Enabled${CL}"
|
||||
fi
|
||||
@@ -3425,9 +3428,6 @@ start() {
|
||||
set_std_mode
|
||||
ensure_profile_loaded
|
||||
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_motd_ip
|
||||
cleanup_lxc
|
||||
@@ -3456,9 +3456,6 @@ start() {
|
||||
esac
|
||||
ensure_profile_loaded
|
||||
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_motd_ip
|
||||
cleanup_lxc
|
||||
@@ -4071,7 +4068,11 @@ EOF'
|
||||
msg_warn "Skipping timezone setup – zone '$tz' not found in container"
|
||||
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"
|
||||
install_exit_code=1
|
||||
}
|
||||
@@ -5026,13 +5027,15 @@ create_lxc_container() {
|
||||
case "$2" in
|
||||
12 | 12.*) echo "bookworm" ;; 13 | 13.*) echo "trixie" ;;
|
||||
*) echo "trixie" ;;
|
||||
esac ;;
|
||||
esac
|
||||
;;
|
||||
alpine) echo "3.22" ;;
|
||||
ubuntu)
|
||||
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" ;;
|
||||
esac ;;
|
||||
esac
|
||||
;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
@@ -5043,12 +5046,18 @@ create_lxc_container() {
|
||||
download_arm64_template() {
|
||||
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
|
||||
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)
|
||||
[[ -n "$url" ]] || { msg_error "Could not find Debian ${CUSTOM_TEMPLATE_VARIANT} ARM64 template URL."; exit 207; }
|
||||
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)
|
||||
[[ -n "$url" ]] || {
|
||||
msg_error "Could not find Debian ${CUSTOM_TEMPLATE_VARIANT} ARM64 template URL."
|
||||
exit 207
|
||||
}
|
||||
else
|
||||
url="https://jenkins.linuxcontainers.org/job/image-${PCT_OSTYPE}/architecture=arm64,release=${CUSTOM_TEMPLATE_VARIANT},variant=default/lastStableBuild/artifact/rootfs.tar.xz"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user