mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-13 21:42:59 +01:00
Compare commits
14 Commits
cleanup_wo
...
arm64-buil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24f1347990 | ||
|
|
866b6950c0 | ||
|
|
44ec223d20 | ||
|
|
4ab3a24d03 | ||
|
|
231945dfa7 | ||
|
|
7c051fb648 | ||
|
|
6f8aa6eadc | ||
|
|
35b3b93ca6 | ||
|
|
78979189c1 | ||
|
|
a6a83b9541 | ||
|
|
e4db6be257 | ||
|
|
b9d401b178 | ||
|
|
6f62656c96 | ||
|
|
087f817bf6 |
@@ -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 → \\
|
||||||
|
|||||||
676
misc/build.func
676
misc/build.func
File diff suppressed because it is too large
Load Diff
@@ -344,9 +344,15 @@ pve_check() {
|
|||||||
# - Provides link to ARM64-compatible scripts
|
# - Provides link to ARM64-compatible scripts
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
arch_check() {
|
arch_check() {
|
||||||
if [ "$(dpkg --print-architecture)" != "amd64" ]; then
|
local arch
|
||||||
msg_error "This script will not work with PiMox (ARM architecture detected)."
|
arch="$(dpkg --print-architecture)"
|
||||||
msg_warn "Visit https://github.com/asylumexp/Proxmox for ARM64 support."
|
if [[ "$arch" != "amd64" && "$arch" != "arm64" ]]; then
|
||||||
|
msg_error "This script requires amd64 or arm64 (detected: $arch)."
|
||||||
|
sleep 2
|
||||||
|
exit 106
|
||||||
|
fi
|
||||||
|
if [[ "$arch" == "arm64" && "${var_arm64:-}" != "yes" ]]; then
|
||||||
|
msg_error "This script does not yet support arm64."
|
||||||
sleep 2
|
sleep 2
|
||||||
exit 106
|
exit 106
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -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" ;;
|
||||||
|
|||||||
@@ -2822,10 +2822,13 @@ function fetch_and_deploy_codeberg_release() {
|
|||||||
# Fall back to architecture heuristic
|
# Fall back to architecture heuristic
|
||||||
if [[ -z "$url_match" ]]; then
|
if [[ -z "$url_match" ]]; then
|
||||||
for u in $assets; do
|
for u in $assets; do
|
||||||
if [[ "$u" =~ ($arch|amd64|x86_64|aarch64|arm64).*\.deb$ ]]; then
|
if [[ "${arch,,}" =~ ^(amd64|x86_64)$ ]]; then
|
||||||
url_match="$u"
|
[[ "$u" =~ (amd64|x86_64).*\.deb$ ]] || continue
|
||||||
break
|
elif [[ "${arch,,}" =~ ^(arm64|aarch64)$ ]]; then
|
||||||
|
[[ "$u" =~ (arm64|aarch64).*\.deb$ ]] || continue
|
||||||
fi
|
fi
|
||||||
|
url_match="$u"
|
||||||
|
break
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -3122,7 +3125,11 @@ _gh_scan_older_releases() {
|
|||||||
done)
|
done)
|
||||||
fi
|
fi
|
||||||
if [[ "$has_match" != "true" ]]; then
|
if [[ "$has_match" != "true" ]]; then
|
||||||
has_match=$(echo "$releases_list" | jq -r ".[$i].assets[].browser_download_url" | grep -qE "($arch|amd64|x86_64|aarch64|arm64).*\.deb$" && echo true)
|
if [[ "${arch,,}" =~ ^(amd64|x86_64)$ ]]; then
|
||||||
|
has_match=$(echo "$releases_list" | jq -r ".[$i].assets[].browser_download_url" | grep -qE '(amd64|x86_64).*\.deb$' && echo true)
|
||||||
|
elif [[ "${arch,,}" =~ ^(arm64|aarch64)$ ]]; then
|
||||||
|
has_match=$(echo "$releases_list" | jq -r ".[$i].assets[].browser_download_url" | grep -qE '(arm64|aarch64).*\.deb$' && echo true)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "$has_match" != "true" ]]; then
|
if [[ "$has_match" != "true" ]]; then
|
||||||
has_match=$(echo "$releases_list" | jq -r ".[$i].assets[].browser_download_url" | grep -qE '\.deb$' && echo true)
|
has_match=$(echo "$releases_list" | jq -r ".[$i].assets[].browser_download_url" | grep -qE '\.deb$' && echo true)
|
||||||
@@ -3328,10 +3335,13 @@ function fetch_and_deploy_gh_release() {
|
|||||||
# If no match via explicit pattern, fall back to architecture heuristic
|
# If no match via explicit pattern, fall back to architecture heuristic
|
||||||
if [[ -z "$url_match" ]]; then
|
if [[ -z "$url_match" ]]; then
|
||||||
for u in $assets; do
|
for u in $assets; do
|
||||||
if [[ "$u" =~ ($arch|amd64|x86_64|aarch64|arm64).*\.deb$ ]]; then
|
if [[ "${arch,,}" =~ ^(amd64|x86_64)$ ]]; then
|
||||||
url_match="$u"
|
[[ "$u" =~ (amd64|x86_64).*\.deb$ ]] || continue
|
||||||
break
|
elif [[ "${arch,,}" =~ ^(arm64|aarch64)$ ]]; then
|
||||||
|
[[ "$u" =~ (arm64|aarch64).*\.deb$ ]] || continue
|
||||||
fi
|
fi
|
||||||
|
url_match="$u"
|
||||||
|
break
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -3362,10 +3372,13 @@ function fetch_and_deploy_gh_release() {
|
|||||||
fi
|
fi
|
||||||
if [[ -z "$url_match" ]]; then
|
if [[ -z "$url_match" ]]; then
|
||||||
for u in $assets; do
|
for u in $assets; do
|
||||||
if [[ "$u" =~ ($arch|amd64|x86_64|aarch64|arm64).*\.deb$ ]]; then
|
if [[ "${arch,,}" =~ ^(amd64|x86_64)$ ]]; then
|
||||||
url_match="$u"
|
[[ "$u" =~ (amd64|x86_64).*\.deb$ ]] || continue
|
||||||
break
|
elif [[ "${arch,,}" =~ ^(arm64|aarch64)$ ]]; then
|
||||||
|
[[ "$u" =~ (arm64|aarch64).*\.deb$ ]] || continue
|
||||||
fi
|
fi
|
||||||
|
url_match="$u"
|
||||||
|
break
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if [[ -z "$url_match" ]]; then
|
if [[ -z "$url_match" ]]; then
|
||||||
@@ -3733,7 +3746,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
|
||||||
@@ -3815,7 +3833,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
|
||||||
@@ -7881,7 +7904,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
|
||||||
|
|||||||
Reference in New Issue
Block a user