mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-10-31 04:01:59 +01:00
fix: match LXC template to host architecture
This commit is contained in:
1 parent
403151247b
commit
4fadb3b767
3 files changed
+23
-3
No files matched your search
@@ -306,7 +306,7 @@ The installer will prompt for container settings (container ID, hostname, RAM,
|
||||
disk, bridge, etc.), whether to install the host-side CH341 udev rule, and
|
||||
whether to download the optional openHop Console WebUI. It will then:
|
||||
|
||||
1. Download a Debian 13 LXC template.
|
||||
1. Download a Debian 13 LXC template matching the Proxmox host architecture.
|
||||
2. Create a privileged container with USB passthrough.
|
||||
3. Install the host-side CH341 udev rule only when selected. This is not needed
|
||||
for openHop Modem TCP or USB connections and defaults to No.
|
||||
|
||||
@@ -84,6 +84,13 @@ fi
|
||||
|
||||
msg_ok "Running on Proxmox host as root"
|
||||
|
||||
CT_ARCH=$(dpkg --print-architecture)
|
||||
if [[ ! "$CT_ARCH" =~ ^(amd64|arm64)$ ]]; then
|
||||
msg_error "Unsupported Proxmox host architecture: ${CT_ARCH}"
|
||||
exit 1
|
||||
fi
|
||||
msg_ok "Detected Proxmox host architecture: ${CT_ARCH}"
|
||||
|
||||
# Default to the next available container ID, but allow the user to choose.
|
||||
DEFAULT_CTID=$(pvesh get /cluster/nextid)
|
||||
|
||||
@@ -154,10 +161,14 @@ read -p " Proceed? [Y/n]: " -r
|
||||
echo ""
|
||||
msg_info "Downloading Debian 13 template..."
|
||||
TEMPLATE_FILE=$(pveam available -section system 2>/dev/null \
|
||||
| awk -v template="$CT_TEMPLATE" '$2 ~ template {print $2}' \
|
||||
| awk -v template="$CT_TEMPLATE" -v arch="$CT_ARCH" \
|
||||
'$2 ~ ("^" template "_") && $2 ~ ("_" arch "\\.tar\\.") {print $2}' \
|
||||
| sort -V \
|
||||
| tail -1)
|
||||
[ -z "$TEMPLATE_FILE" ] && { msg_error "Template not found. Run: pveam update"; exit 1; }
|
||||
[ -z "$TEMPLATE_FILE" ] && {
|
||||
msg_error "Debian 13 template for ${CT_ARCH} not found. Run: pveam update"
|
||||
exit 1
|
||||
}
|
||||
|
||||
pveam list "$CT_TEMPLATE_STORAGE" 2>/dev/null | grep -q "$TEMPLATE_FILE" || \
|
||||
pveam download "$CT_TEMPLATE_STORAGE" "$TEMPLATE_FILE"
|
||||
|
||||
@@ -15,6 +15,15 @@ def test_proxmox_installer_uses_debian_13() -> None:
|
||||
assert "Debian 12" not in script
|
||||
|
||||
|
||||
def test_template_selection_matches_the_proxmox_host_architecture() -> None:
|
||||
script = INSTALLER.read_text()
|
||||
|
||||
assert "CT_ARCH=$(dpkg --print-architecture)" in script
|
||||
assert '[[ ! "$CT_ARCH" =~ ^(amd64|arm64)$ ]]' in script
|
||||
assert '-v arch="$CT_ARCH"' in script
|
||||
assert '$2 ~ ("_" arch "\\\\.tar\\\\.")' in script
|
||||
|
||||
|
||||
def test_installer_allows_explicit_repository_and_branch_for_fork_testing() -> None:
|
||||
script = INSTALLER.read_text()
|
||||
|
||||
|
||||
Reference in new issue
Block a user