chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
param(
|
||||
[ValidateSet("arm64", "x64")]
|
||||
[string]$Arch
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
||||
$ProjectDir = Split-Path -Parent $ScriptDir
|
||||
$BaseImageDir = Join-Path (Join-Path $ProjectDir 'master') 'base_image'
|
||||
|
||||
# ── Detect arch ───────────────────────────────────────────────────────────────
|
||||
|
||||
if (-not $Arch) {
|
||||
$ArchRaw = $null
|
||||
try {
|
||||
$ArchRaw = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString()
|
||||
} catch {}
|
||||
if (-not $ArchRaw) { $ArchRaw = $env:PROCESSOR_ARCHITECTURE }
|
||||
|
||||
$Arch = switch ($ArchRaw.ToUpper()) {
|
||||
"ARM64" { "arm64" }
|
||||
"X64" { "x64" }
|
||||
"AMD64" { "x64" }
|
||||
default { Write-Error "Unsupported architecture: $ArchRaw. Pass -Arch arm64 or -Arch x64."; exit 1 }
|
||||
}
|
||||
}
|
||||
|
||||
$TarName = "${Arch}-base-image.tar"
|
||||
$ShaName = "$TarName.sha256"
|
||||
$TarPath = Join-Path $BaseImageDir $TarName
|
||||
$ShaPath = Join-Path $BaseImageDir $ShaName
|
||||
|
||||
# ── Validate source files ─────────────────────────────────────────────────────
|
||||
|
||||
$Missing = @()
|
||||
foreach ($f in @("base.qcow2", "efi-vars.fd")) {
|
||||
if (-not (Test-Path (Join-Path $BaseImageDir $f))) { $Missing += $f }
|
||||
}
|
||||
|
||||
if ($Missing.Count -gt 0) {
|
||||
Write-Error "Missing required files in master/base_image/: $($Missing -join ', ')"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# ── Bundle ────────────────────────────────────────────────────────────────────
|
||||
|
||||
$qcow2Size = [math]::Round((Get-Item (Join-Path $BaseImageDir 'base.qcow2')).Length / 1GB, 2)
|
||||
$efiSize = [math]::Round((Get-Item (Join-Path $BaseImageDir 'efi-vars.fd')).Length / 1MB, 0)
|
||||
|
||||
Write-Host "Bundling $TarName ..."
|
||||
Write-Host " + base.qcow2 ($qcow2Size GB)"
|
||||
Write-Host " + efi-vars.fd ($efiSize MB)"
|
||||
Write-Host ""
|
||||
|
||||
tar -cf $TarPath -C $BaseImageDir base.qcow2 efi-vars.fd
|
||||
|
||||
Write-Host "Computing SHA256 ..."
|
||||
$hash = (Get-FileHash -Algorithm SHA256 -Path $TarPath).Hash.ToLower()
|
||||
"$hash $TarName" | Set-Content -Path $ShaPath -NoNewline
|
||||
|
||||
$tarSizeMB = [math]::Round((Get-Item $TarPath).Length / 1GB, 2)
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Done!"
|
||||
Write-Host ""
|
||||
Write-Host " Archive : $TarPath ($tarSizeMB GB)"
|
||||
Write-Host " SHA256 : $ShaPath"
|
||||
Write-Host " Hash : $hash"
|
||||
Write-Host ""
|
||||
Write-Host "Upload both files to:"
|
||||
Write-Host " https://cdn.anythingllm.com/support/open-computer/base-images/<DATE>/$TarName"
|
||||
Write-Host " https://cdn.anythingllm.com/support/open-computer/base-images/<DATE>/$ShaName"
|
||||
Executable
+59
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
BASE_IMAGE_DIR="$PROJECT_DIR/master/base_image"
|
||||
|
||||
# ── Detect platform / arch ────────────────────────────────────────────────────
|
||||
|
||||
ARCH_RAW="${1:-$(uname -m)}"
|
||||
|
||||
case "$ARCH_RAW" in
|
||||
arm64|aarch64) ARCH="arm64" ;;
|
||||
x86_64|amd64) ARCH="x64" ;;
|
||||
*) echo "Error: unsupported architecture '$ARCH_RAW' (pass arm64 or x64 as argument)" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
TAR_NAME="${ARCH}-base-image.tar"
|
||||
SHA_NAME="${TAR_NAME}.sha256"
|
||||
TAR_PATH="$BASE_IMAGE_DIR/$TAR_NAME"
|
||||
SHA_PATH="$BASE_IMAGE_DIR/$SHA_NAME"
|
||||
|
||||
# ── Validate source files ─────────────────────────────────────────────────────
|
||||
|
||||
MISSING=()
|
||||
for f in base.qcow2 efi-vars.fd; do
|
||||
[ -f "$BASE_IMAGE_DIR/$f" ] || MISSING+=("$f")
|
||||
done
|
||||
|
||||
if [ ${#MISSING[@]} -gt 0 ]; then
|
||||
echo "Error: missing required files in master/base_image/: ${MISSING[*]}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ── Bundle ────────────────────────────────────────────────────────────────────
|
||||
|
||||
echo "Bundling ${TAR_NAME} ..."
|
||||
echo " + base.qcow2 ($(du -sh "$BASE_IMAGE_DIR/base.qcow2" | cut -f1))"
|
||||
echo " + efi-vars.fd ($(du -sh "$BASE_IMAGE_DIR/efi-vars.fd" | cut -f1))"
|
||||
echo ""
|
||||
|
||||
tar -cf "$TAR_PATH" -C "$BASE_IMAGE_DIR" base.qcow2 efi-vars.fd
|
||||
|
||||
echo "Computing SHA256 ..."
|
||||
shasum -a 256 "$TAR_PATH" | awk '{print $1 " '"$TAR_NAME"'"}' > "$SHA_PATH"
|
||||
|
||||
TAR_SIZE="$(du -sh "$TAR_PATH" | cut -f1)"
|
||||
SHA_HASH="$(cut -d' ' -f1 "$SHA_PATH")"
|
||||
|
||||
echo ""
|
||||
echo "Done!"
|
||||
echo ""
|
||||
echo " Archive : $TAR_PATH ($TAR_SIZE)"
|
||||
echo " SHA256 : $SHA_PATH"
|
||||
echo " Hash : $SHA_HASH"
|
||||
echo ""
|
||||
echo "Upload both files to:"
|
||||
echo " https://cdn.anythingllm.com/support/open-computer/base-images/<DATE>/$TAR_NAME"
|
||||
echo " https://cdn.anythingllm.com/support/open-computer/base-images/<DATE>/$SHA_NAME"
|
||||
@@ -0,0 +1,105 @@
|
||||
param()
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
||||
$ProjectDir = Split-Path -Parent $ScriptDir
|
||||
$BaseImageDir = Join-Path (Join-Path $ProjectDir 'master') 'base_image'
|
||||
|
||||
$BaseImageDate = "06_08_2026"
|
||||
$BaseUrl = if ($env:OPEN_COMPUTER_BASE_IMAGE_URL) { $env:OPEN_COMPUTER_BASE_IMAGE_URL } else { "https://cdn.anythingllm.com/support/open-computer/base-images/$BaseImageDate" }
|
||||
|
||||
# ── Detect arch ───────────────────────────────────────────────────────────────
|
||||
|
||||
$ArchRaw = $null
|
||||
try {
|
||||
$ArchRaw = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString()
|
||||
} catch {}
|
||||
if (-not $ArchRaw) { $ArchRaw = $env:PROCESSOR_ARCHITECTURE }
|
||||
|
||||
$Arch = switch ($ArchRaw.ToUpper()) {
|
||||
"ARM64" { "arm64" }
|
||||
"X64" { "x64" }
|
||||
"AMD64" { "x64" }
|
||||
default { Write-Error "Unsupported architecture: $ArchRaw"; exit 1 }
|
||||
}
|
||||
|
||||
$TarName = "${Arch}-base-image.tar"
|
||||
$TarUrl = "$BaseUrl/$TarName"
|
||||
$ShaName = "$TarName.sha256"
|
||||
$ShaUrl = "$BaseUrl/$ShaName"
|
||||
|
||||
if (-not (Test-Path $BaseImageDir)) {
|
||||
New-Item -ItemType Directory -Path $BaseImageDir -Force | Out-Null
|
||||
}
|
||||
|
||||
# ── Check for existing files ──────────────────────────────────────────────────
|
||||
|
||||
$ExistingFiles = @()
|
||||
foreach ($f in @("base.qcow2", "efi-vars.fd")) {
|
||||
if (Test-Path (Join-Path $BaseImageDir $f)) {
|
||||
$ExistingFiles += $f
|
||||
}
|
||||
}
|
||||
|
||||
if ($ExistingFiles.Count -gt 0) {
|
||||
Write-Host "Existing base image files found: $($ExistingFiles -join ', ')"
|
||||
Write-Host ""
|
||||
$reply = Read-Host "Delete existing files and re-download the base image for ${Arch}? [y/N]"
|
||||
Write-Host ""
|
||||
if ($reply -notmatch '^[yY]([eE][sS])?$') {
|
||||
Write-Host "Skipping download. Existing base image kept."
|
||||
exit 0
|
||||
}
|
||||
Write-Host "Removing existing base image files..."
|
||||
foreach ($f in @("base.qcow2", "efi-vars.fd")) {
|
||||
$fp = Join-Path $BaseImageDir $f
|
||||
if (Test-Path $fp) { Remove-Item -Force $fp }
|
||||
}
|
||||
} else {
|
||||
Write-Host "No base image found for ${Arch}."
|
||||
Write-Host ""
|
||||
$reply = Read-Host "Download ${TarName} (~2.3 GB)? [Y/n]"
|
||||
Write-Host ""
|
||||
if ($reply -match '^[nN]([oO])?$') {
|
||||
Write-Host "Skipping download."
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
|
||||
# ── Download ──────────────────────────────────────────────────────────────────
|
||||
|
||||
$TarPath = Join-Path $BaseImageDir $TarName
|
||||
$ShaPath = Join-Path $BaseImageDir $ShaName
|
||||
|
||||
Write-Host "Fetching checksum from $ShaUrl ..."
|
||||
Invoke-WebRequest -Uri $ShaUrl -OutFile $ShaPath -UseBasicParsing
|
||||
|
||||
Write-Host "Downloading $TarUrl ..."
|
||||
Invoke-WebRequest -Uri $TarUrl -OutFile $TarPath -UseBasicParsing
|
||||
|
||||
# ── Verify ────────────────────────────────────────────────────────────────────
|
||||
|
||||
Write-Host "Verifying checksum..."
|
||||
$expectedHash = ((Get-Content -Path $ShaPath -First 1).Trim() -split '\s+')[0].ToLower()
|
||||
$actualHash = (Get-FileHash -Algorithm SHA256 -Path $TarPath).Hash.ToLower()
|
||||
|
||||
if ($actualHash -ne $expectedHash) {
|
||||
Write-Error "Checksum verification failed!`n Expected: $expectedHash`n Got: $actualHash"
|
||||
Remove-Item -Force $TarPath, $ShaPath
|
||||
exit 1
|
||||
}
|
||||
Write-Host "Checksum verified."
|
||||
|
||||
# ── Extract ───────────────────────────────────────────────────────────────────
|
||||
|
||||
Write-Host "Extracting..."
|
||||
tar -xf $TarPath -C $BaseImageDir
|
||||
|
||||
Remove-Item -Force $TarPath, $ShaPath
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Base image ready:"
|
||||
Write-Host " $(Join-Path $BaseImageDir 'base.qcow2')"
|
||||
Write-Host " $(Join-Path $BaseImageDir 'efi-vars.fd')"
|
||||
Executable
+91
@@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
BASE_IMAGE_DIR="$PROJECT_DIR/master/base_image"
|
||||
|
||||
BASE_IMAGE_DATE="06_08_2026"
|
||||
BASE_URL="${OPEN_COMPUTER_BASE_IMAGE_URL:-https://cdn.anythingllm.com/support/open-computer/base-images/${BASE_IMAGE_DATE}}"
|
||||
|
||||
# ── Detect platform / arch ────────────────────────────────────────────────────
|
||||
|
||||
OS="$(uname -s)"
|
||||
ARCH_RAW="$(uname -m)"
|
||||
|
||||
case "$ARCH_RAW" in
|
||||
arm64|aarch64) ARCH="arm64" ;;
|
||||
x86_64|amd64) ARCH="x64" ;;
|
||||
*) echo "Error: unsupported architecture '$ARCH_RAW'" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
TAR_NAME="${ARCH}-base-image.tar"
|
||||
TAR_URL="${BASE_URL}/${TAR_NAME}"
|
||||
SHA_NAME="${TAR_NAME}.sha256"
|
||||
SHA_URL="${BASE_URL}/${SHA_NAME}"
|
||||
|
||||
mkdir -p "$BASE_IMAGE_DIR"
|
||||
|
||||
# ── Check for existing files ──────────────────────────────────────────────────
|
||||
|
||||
EXISTING_FILES=()
|
||||
for f in "$BASE_IMAGE_DIR/base.qcow2" "$BASE_IMAGE_DIR/efi-vars.fd"; do
|
||||
[ -f "$f" ] && EXISTING_FILES+=("$(basename "$f")")
|
||||
done
|
||||
|
||||
if [ ${#EXISTING_FILES[@]} -gt 0 ]; then
|
||||
echo "Existing base image files found: ${EXISTING_FILES[*]}"
|
||||
echo ""
|
||||
read -r -p "Delete existing files and re-download the base image for ${ARCH}? [y/N] " REPLY
|
||||
echo ""
|
||||
case "$REPLY" in
|
||||
[yY][eE][sS]|[yY])
|
||||
echo "Removing existing base image files..."
|
||||
rm -f "$BASE_IMAGE_DIR/base.qcow2" "$BASE_IMAGE_DIR/efi-vars.fd"
|
||||
;;
|
||||
*)
|
||||
echo "Skipping download. Existing base image kept."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "No base image found for ${ARCH}."
|
||||
echo ""
|
||||
read -r -p "Download ${TAR_NAME} (~2.3 GB)? [Y/n] " REPLY
|
||||
echo ""
|
||||
case "$REPLY" in
|
||||
[nN][oO]|[nN])
|
||||
echo "Skipping download."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# ── Download ──────────────────────────────────────────────────────────────────
|
||||
|
||||
TAR_PATH="$BASE_IMAGE_DIR/$TAR_NAME"
|
||||
SHA_PATH="$BASE_IMAGE_DIR/$SHA_NAME"
|
||||
|
||||
echo "Fetching checksum from ${SHA_URL} ..."
|
||||
curl -fL --progress-bar -o "$SHA_PATH" "$SHA_URL"
|
||||
|
||||
echo "Downloading ${TAR_URL} ..."
|
||||
curl -fL --progress-bar -o "$TAR_PATH" "$TAR_URL"
|
||||
|
||||
# ── Verify ────────────────────────────────────────────────────────────────────
|
||||
|
||||
echo "Verifying checksum..."
|
||||
(cd "$BASE_IMAGE_DIR" && shasum -a 256 -c "$SHA_NAME")
|
||||
echo "Checksum verified."
|
||||
|
||||
# ── Extract ───────────────────────────────────────────────────────────────────
|
||||
|
||||
echo "Extracting..."
|
||||
tar -xf "$TAR_PATH" -C "$BASE_IMAGE_DIR"
|
||||
|
||||
rm -f "$TAR_PATH" "$SHA_PATH"
|
||||
|
||||
echo ""
|
||||
echo "Base image ready:"
|
||||
echo " $BASE_IMAGE_DIR/base.qcow2"
|
||||
echo " $BASE_IMAGE_DIR/efi-vars.fd"
|
||||
@@ -0,0 +1,93 @@
|
||||
param(
|
||||
[ValidateSet("arm64", "amd64")]
|
||||
[string]$Arch
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
||||
$ProjectDir = Split-Path -Parent $ScriptDir
|
||||
$VmDir = Join-Path (Join-Path $ProjectDir 'master') 'iso'
|
||||
|
||||
$DebianVersion = "13.5.0"
|
||||
$BaseUrl = "https://debian.osuosl.org/debian-cdimage/$DebianVersion"
|
||||
|
||||
if (-not $Arch) {
|
||||
$HostArch = $null
|
||||
try {
|
||||
$HostArch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString()
|
||||
} catch {}
|
||||
|
||||
if (-not $HostArch) {
|
||||
$HostArch = $env:PROCESSOR_ARCHITECTURE
|
||||
}
|
||||
|
||||
switch ($HostArch.ToUpper()) {
|
||||
"X64" { $Arch = "amd64" }
|
||||
"AMD64" { $Arch = "amd64" }
|
||||
"ARM64" { $Arch = "arm64" }
|
||||
default { Write-Error "Cannot auto-detect arch from '$HostArch'; pass -Arch arm64 or -Arch amd64"; exit 1 }
|
||||
}
|
||||
Write-Host "Auto-detected architecture: $Arch"
|
||||
}
|
||||
|
||||
$IsoName = "debian-$DebianVersion-$Arch-netinst.iso"
|
||||
$IsoUrl = "$BaseUrl/$Arch/iso-cd/$IsoName"
|
||||
$IsoPath = Join-Path $VmDir $IsoName
|
||||
$ShaPath = Join-Path $VmDir "$IsoName.sha256"
|
||||
|
||||
if (-not (Test-Path $VmDir)) {
|
||||
New-Item -ItemType Directory -Path $VmDir -Force | Out-Null
|
||||
}
|
||||
|
||||
function Get-FileSha256($FilePath) {
|
||||
$hash = Get-FileHash -Algorithm SHA256 -Path $FilePath
|
||||
return $hash.Hash.ToLower()
|
||||
}
|
||||
|
||||
function Read-ShaFile($ShaFilePath) {
|
||||
$line = (Get-Content -Path $ShaFilePath -First 1).Trim()
|
||||
return ($line -split '\s+')[0].ToLower()
|
||||
}
|
||||
|
||||
if (Test-Path $ShaPath) {
|
||||
Write-Host "SHA256 file exists: $ShaPath"
|
||||
$expectedHash = Read-ShaFile $ShaPath
|
||||
|
||||
if (Test-Path $IsoPath) {
|
||||
Write-Host "ISO already exists, verifying checksum..."
|
||||
$actualHash = Get-FileSha256 $IsoPath
|
||||
|
||||
if ($actualHash -eq $expectedHash) {
|
||||
Write-Host "ISO is valid, nothing to do."
|
||||
exit 0
|
||||
}
|
||||
Write-Host "Checksum mismatch - re-downloading."
|
||||
Remove-Item -Force $IsoPath
|
||||
}
|
||||
|
||||
Write-Host "Downloading $IsoUrl ..."
|
||||
Invoke-WebRequest -Uri $IsoUrl -OutFile $IsoPath -UseBasicParsing
|
||||
|
||||
Write-Host "Verifying downloaded ISO against existing checksum..."
|
||||
$actualHash = Get-FileSha256 $IsoPath
|
||||
if ($actualHash -ne $expectedHash) {
|
||||
Write-Error "Checksum verification failed! Expected $expectedHash, got $actualHash"
|
||||
exit 1
|
||||
}
|
||||
Write-Host "Download verified."
|
||||
} else {
|
||||
if (-not (Test-Path $IsoPath)) {
|
||||
Write-Host "Downloading $IsoUrl ..."
|
||||
Invoke-WebRequest -Uri $IsoUrl -OutFile $IsoPath -UseBasicParsing
|
||||
} else {
|
||||
Write-Host "ISO exists but no SHA256 file - generating checksum..."
|
||||
}
|
||||
|
||||
Write-Host "Generating SHA256 checksum..."
|
||||
$hash = Get-FileSha256 $IsoPath
|
||||
"$hash $IsoName" | Set-Content -Path $ShaPath -NoNewline
|
||||
Write-Host "Wrote $ShaPath"
|
||||
Write-Host "Commit this file to version control: $ShaPath"
|
||||
}
|
||||
Executable
+67
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
VM_DIR="$PROJECT_DIR/master/iso"
|
||||
|
||||
DEBIAN_VERSION="13.5.0"
|
||||
BASE_URL="https://debian.osuosl.org/debian-cdimage/${DEBIAN_VERSION}"
|
||||
|
||||
# Determine architecture
|
||||
ARCH="${1:-}"
|
||||
if [ -z "$ARCH" ]; then
|
||||
HOST_ARCH="$(uname -m)"
|
||||
case "$HOST_ARCH" in
|
||||
x86_64|amd64) ARCH="amd64" ;;
|
||||
arm64|aarch64) ARCH="arm64" ;;
|
||||
*) echo "Error: cannot auto-detect arch from '$HOST_ARCH'; pass arm64 or amd64 as argument" >&2; exit 1 ;;
|
||||
esac
|
||||
echo "Auto-detected architecture: $ARCH"
|
||||
fi
|
||||
|
||||
case "$ARCH" in
|
||||
arm64|amd64) ;;
|
||||
*) echo "Error: unsupported architecture '$ARCH' (use arm64 or amd64)" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
ISO_NAME="debian-${DEBIAN_VERSION}-${ARCH}-netinst.iso"
|
||||
ISO_URL="${BASE_URL}/${ARCH}/iso-cd/${ISO_NAME}"
|
||||
ISO_PATH="$VM_DIR/$ISO_NAME"
|
||||
SHA_PATH="$VM_DIR/$ISO_NAME.sha256"
|
||||
|
||||
mkdir -p "$VM_DIR"
|
||||
|
||||
if [ -f "$SHA_PATH" ]; then
|
||||
echo "SHA256 file exists: $SHA_PATH"
|
||||
|
||||
if [ -f "$ISO_PATH" ]; then
|
||||
echo "ISO already exists, verifying checksum..."
|
||||
if (cd "$VM_DIR" && shasum -a 256 -c "$ISO_NAME.sha256"); then
|
||||
echo "ISO is valid, nothing to do."
|
||||
exit 0
|
||||
else
|
||||
echo "Checksum mismatch — re-downloading."
|
||||
rm -f "$ISO_PATH"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Downloading $ISO_URL ..."
|
||||
curl -L --progress-bar -o "$ISO_PATH" "$ISO_URL"
|
||||
|
||||
echo "Verifying downloaded ISO against existing checksum..."
|
||||
(cd "$VM_DIR" && shasum -a 256 -c "$ISO_NAME.sha256")
|
||||
echo "Download verified."
|
||||
else
|
||||
if [ -f "$ISO_PATH" ]; then
|
||||
echo "ISO exists but no SHA256 file — generating checksum..."
|
||||
else
|
||||
echo "Downloading $ISO_URL ..."
|
||||
curl -L --progress-bar -o "$ISO_PATH" "$ISO_URL"
|
||||
fi
|
||||
|
||||
echo "Generating SHA256 checksum..."
|
||||
(cd "$VM_DIR" && shasum -a 256 "$ISO_NAME" > "$ISO_NAME.sha256")
|
||||
echo "Wrote $SHA_PATH"
|
||||
echo "Commit this file to version control: $SHA_PATH"
|
||||
fi
|
||||
Reference in New Issue
Block a user