Skip to content

Commit cdd8b9c

Browse files
committed
arm64
1 parent 60b6a2c commit cdd8b9c

12 files changed

Lines changed: 79 additions & 29 deletions

AGENTS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,21 @@ var_version="${var_version:-13}"
664664
var_unprivileged="${var_unprivileged:-1}"
665665
```
666666
667+
**Optional declarations**
668+
669+
| Variable | Values | Meaning |
670+
| ----------- | ----------------------- | -------------------------------------------------------------- |
671+
| `var_gpu` | `yes` / `no` | Offer GPU passthrough. Set for transcoding and AI workloads. |
672+
| `var_arm64` | `yes` / `no` / *(unset)* | arm64 support — see below. |
673+
674+
`var_arm64` has three states. **Only claim `yes` when it has actually been run on
675+
arm64** — the mere existence of an arm64 artifact is not verification:
676+
677+
- `yes` — verified working, proceeds silently
678+
- `no` — known broken (x64-only artifact, x86 dependency, CUDA), aborts
679+
- *unset* — never tried. The user is told so and asked whether to attempt it
680+
anyway, with a pointer to report the result. Aborts non-interactively.
681+
667682
### Update-Script Pattern
668683
669684
```bash

ct/ntopng.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var_ram="${var_ram:-2048}"
1212
var_disk="${var_disk:-10}"
1313
var_os="${var_os:-debian}"
1414
var_version="${var_version:-13}"
15+
var_arm64="${var_arm64:-no}"
1516
var_unprivileged="${var_unprivileged:-1}"
1617

1718
header_info "$APP"

ct/unsloth.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ var_disk="${var_disk:-40}"
1313
var_os="${var_os:-debian}"
1414
var_version="${var_version:-13}"
1515
var_gpu="${var_gpu:-yes}"
16+
var_arm64="${var_arm64:-no}"
1617
var_unprivileged="${var_unprivileged:-1}"
1718

1819
header_info "$APP"

misc/alpine-install.func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ network_check() {
109109
ipv4_status="${GN}✔${CL} IPv4"
110110
else
111111
ipv4_status="${RD}✖${CL} IPv4"
112-
read -r -p "Internet NOT connected. Continue anyway? <y/N> " prompt
112+
read -r -p "Internet NOT connected. Continue anyway? <y/N> " prompt </dev/tty
113113
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
114114
echo -e "${INFO}${RD}Expect Issues Without Internet${CL}"
115115
else

misc/build-ui.func

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3240,7 +3240,7 @@ check_container_resources() {
32403240
echo -e "\n${INFO}${HOLD} ${GN}Required: ${var_cpu} CPU, ${var_ram}MB RAM ${CL}| ${RD}Current: ${current_cpu} CPU, ${current_ram}MB RAM${CL}"
32413241
echo -e "${YWB}Please ensure that the ${APP} LXC is configured with at least ${var_cpu} vCPU and ${var_ram} MB RAM for the build process.${CL}\n"
32423242
echo -ne "${INFO}${HOLD} May cause data loss! ${INFO} Continue update with under-provisioned LXC? <yes/No> "
3243-
read -r prompt
3243+
read -r prompt </dev/tty
32443244
if [[ ! ${prompt,,} =~ ^(yes)$ ]]; then
32453245
echo -e "${CROSS}${HOLD} ${YWB}Exiting based on user input.${CL}"
32463246
exit 1
@@ -3267,7 +3267,7 @@ check_container_storage() {
32673267
if [ "$usage" -gt 80 ]; then
32683268
echo -e "${INFO}${HOLD}${YWB}Warning: Storage is dangerously low (${usage}%).${CL}"
32693269
printf "Continue anyway? <y/N> "
3270-
read -r prompt
3270+
read -r prompt </dev/tty
32713271

32723272
case "$prompt" in
32733273
[yY][eE][sS] | [yY]) ;;

misc/cloud-init.func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ fi
811811
812812
# Example 7: Cleanup credentials file after user has noted password
813813
display_cloud_init_info "$VMID" "$HN"
814-
read -p "Have you saved the credentials? (y/N): " -r
814+
read -p "Have you saved the credentials? (y/N): " -r </dev/tty
815815
[[ $REPLY =~ ^[Yy]$ ]] && cleanup_cloud_init_credentials
816816
817817
# Example 8: Validate IP before using

misc/core.func

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,13 @@ pve_check() {
341341
#
342342
# - Validates system architecture is amd64/x86_64
343343
# - Exits with error message for unsupported architectures (e.g., ARM/PiMox)
344-
# - Provides link to ARM64-compatible scripts
344+
#
345+
# var_arm64 has three states:
346+
# yes - known to work, proceed silently
347+
# no - known to be broken (no arm64 artifact, x86-only dependency), abort
348+
# unknown - never verified on arm64 (default). Explain the situation and let
349+
# the user decide, since "no artifact exists" and "nobody tried"
350+
# are very different things and only the latter is worth attempting.
345351
# ------------------------------------------------------------------------------
346352
arch_check() {
347353
local arch
@@ -351,11 +357,38 @@ arch_check() {
351357
sleep 2
352358
exit 106
353359
fi
354-
if [[ "$arch" == "arm64" && "${var_arm64:-}" != "yes" ]]; then
355-
msg_error "This script does not yet support arm64."
360+
[[ "$arch" != "arm64" ]] && return 0
361+
362+
case "${var_arm64:-unknown}" in
363+
yes)
364+
return 0
365+
;;
366+
no)
367+
msg_error "This script does not support arm64."
356368
sleep 2
357369
exit 106
358-
fi
370+
;;
371+
*)
372+
msg_warn "This script has not been verified on arm64."
373+
echo -e "${TAB}It may work, or it may fail on an architecture-specific dependency."
374+
echo -e "${TAB}If you try it, please report the outcome - success or failure:"
375+
echo -e "${TAB}${BGN}https://github.com/community-scripts/ProxmoxVED/issues${CL}"
376+
echo ""
377+
if [[ ! -t 0 ]]; then
378+
msg_error "Not running interactively - refusing to guess on arm64. Set var_arm64=yes to override."
379+
sleep 2
380+
exit 106
381+
fi
382+
read -r -p "${TAB}Continue anyway? (y/N): " arm64_prompt </dev/tty
383+
if [[ "${arm64_prompt,,}" =~ ^(y|yes)$ ]]; then
384+
msg_ok "Continuing on arm64 - thanks for testing"
385+
return 0
386+
fi
387+
msg_error "Aborted on arm64."
388+
sleep 2
389+
exit 106
390+
;;
391+
esac
359392
}
360393

361394
# ------------------------------------------------------------------------------
@@ -691,7 +724,7 @@ msg_info() {
691724
# Pause mode: Wait for Enter after each step
692725
if [[ "${DEV_MODE_PAUSE:-false}" == "true" ]]; then
693726
echo -en "\n${YWB}[PAUSE]${CL} Press Enter to continue..." >&2
694-
read -r
727+
read -r </dev/tty
695728
fi
696729
return
697730
fi
@@ -706,7 +739,7 @@ msg_info() {
706739
if [[ "${DEV_MODE_PAUSE:-false}" == "true" ]]; then
707740
stop_spinner
708741
echo -en "\n${YWB}[PAUSE]${CL} Press Enter to continue..." >&2
709-
read -r
742+
read -r </dev/tty
710743
fi
711744
}
712745

@@ -1116,7 +1149,7 @@ prompt_confirm() {
11161149
# Interactive prompt with timeout
11171150
echo -en "${YW}${message} ${hint} (auto-${default} in ${timeout}s): ${CL}"
11181151

1119-
if read -t "$timeout" -r response; then
1152+
if read -t "$timeout" -r response </dev/tty; then
11201153
# User provided input
11211154
response="${response,,}" # lowercase
11221155
case "$response" in
@@ -1209,7 +1242,7 @@ prompt_input() {
12091242
# Interactive prompt with timeout
12101243
echo -en "${YW}${message}${hint} (auto-default in ${timeout}s): ${CL}" >&2
12111244

1212-
if read -t "$timeout" -r response; then
1245+
if read -t "$timeout" -r response </dev/tty; then
12131246
# User provided input (or pressed Enter for empty)
12141247
if [[ -n "$response" ]]; then
12151248
echo "$response"
@@ -1311,7 +1344,7 @@ prompt_input_required() {
13111344

13121345
echo -en "${YW}${message} (required, timeout ${timeout}s): ${CL}" >&2
13131346

1314-
if read -t "$timeout" -r response; then
1347+
if read -t "$timeout" -r response </dev/tty; then
13151348
if [[ -z "$response" ]]; then
13161349
echo -e "${YW}This field is required. Please enter a value. (attempt ${attempts}/3)${CL}" >&2
13171350
fi
@@ -1405,7 +1438,7 @@ prompt_select() {
14051438
echo -en "${YW}Select [1-${num_options}] (auto-select ${default} in ${timeout}s): ${CL}" >&2
14061439

14071440
local response
1408-
if read -t "$timeout" -r response; then
1441+
if read -t "$timeout" -r response </dev/tty; then
14091442
if [[ -z "$response" ]]; then
14101443
# Empty response, use default
14111444
echo "${options[$((default - 1))]}"
@@ -1488,7 +1521,7 @@ prompt_password() {
14881521
# Interactive prompt with timeout (silent input)
14891522
echo -en "${YW}${message}${hint} (timeout ${timeout}s): ${CL}" >&2
14901523

1491-
if read -t "$timeout" -rs response; then
1524+
if read -t "$timeout" -rs response </dev/tty; then
14921525
echo "" >&2 # Newline after hidden input
14931526
if [[ -n "$response" ]]; then
14941527
# Validate minimum length

misc/incus-core.func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ incus_msg_info() {
439439

440440
if [[ "${DEV_MODE_PAUSE:-false}" == "true" ]]; then
441441
echo -en "\n${YWB}[PAUSE]${CL} Press Enter to continue..." >&2
442-
read -r
442+
read -r </dev/tty
443443
fi
444444
return
445445
fi

misc/install.func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ network_check() {
10471047

10481048
# Prompt if both fail
10491049
if [[ $ipv4_connected == false && $ipv6_connected == false ]]; then
1050-
read -r -p "No Internet detected, would you like to continue anyway? <y/N> " prompt
1050+
read -r -p "No Internet detected, would you like to continue anyway? <y/N> " prompt </dev/tty
10511051
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
10521052
echo -e "${INFO}${RD}Expect Issues Without Internet${CL}"
10531053
else

misc/passthrough.func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ nvidia_passthrough_to_lxc() {
276276
install_vaapi_userland_interactive() {
277277
. /etc/os-release
278278
if [[ "$VERSION_CODENAME" == "trixie" ]]; then
279-
read -r -p "${TAB3}Do you need the intel-media-va-driver-non-free driver for HW encoding (Debian 13 only)? <y/N> " prompt
279+
read -r -p "${TAB3}Do you need the intel-media-va-driver-non-free driver for HW encoding (Debian 13 only)? <y/N> " prompt </dev/tty
280280
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
281281
msg_info "Installing Intel Hardware Acceleration (non-free)"
282282
cat <<'EOF' >/etc/apt/sources.list.d/non-free.sources

0 commit comments

Comments
 (0)