add kde; add update scripts

This commit is contained in:
2026-01-28 17:15:52 +00:00
parent 43a98d1bf0
commit cf9b982176
5 changed files with 116 additions and 3 deletions

44
scripts/update-alpine.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -euo pipefail
# Script to get latest Alpine version and hash
# Usage: ./update-alpine.sh
# Get the latest Alpine version by checking the releases page
# Alpine versions are in format like "3.23.2" under v3.23 directory
LATEST_MINOR=$(curl -s https://dl-cdn.alpinelinux.org/alpine/ | \
grep -oP 'v\d+\.\d+' | \
sort -V | \
tail -n1)
if [[ -z "$LATEST_MINOR" ]]; then
echo "Error: Could not determine latest Alpine minor version" >&2
exit 1
fi
# Get the latest patch version from that minor version
VERSION=$(curl -s "https://dl-cdn.alpinelinux.org/alpine/${LATEST_MINOR}/releases/x86_64/" | \
grep -oP 'alpine-netboot-\K[\d.]+(?=-x86_64\.tar\.gz)' | \
sort -V | \
tail -n1)
if [[ -z "$VERSION" ]]; then
echo "Error: Could not determine latest Alpine version" >&2
exit 1
fi
# Download the .sha256 checksum file
CHECKSUM_URL="https://dl-cdn.alpinelinux.org/alpine/${LATEST_MINOR}/releases/x86_64/alpine-netboot-${VERSION}-x86_64.tar.gz.sha256"
HASH_HEX=$(curl -s "$CHECKSUM_URL" | awk '{print $1}')
if [[ -z "$HASH_HEX" ]]; then
echo "Error: Could not download checksum from $CHECKSUM_URL" >&2
exit 1
fi
# Convert hex hash to SRI format
HASH_SRI=$(nix-hash --type sha256 --to-sri "$HASH_HEX")
# Output version and hash
echo "version: $VERSION"
echo "hash: $HASH_SRI"

60
scripts/update-debian.sh Executable file
View File

@@ -0,0 +1,60 @@
#!/usr/bin/env bash
set -euo pipefail
# Script to generate updated Debian Live package definition
# Usage: ./update-debian.sh <flavor>
# flavor: standard, xfce, kde, gnome, etc.
SHA256SUMS_URL="https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/SHA256SUMS"
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <flavor>" >&2
echo " flavor: standard, xfce, kde, gnome, etc." >&2
exit 1
fi
FLAVOR="$1"
# Download SHA256SUMS file
SHA256SUMS_CONTENT=$(curl -s "$SHA256SUMS_URL")
if [[ -z "$SHA256SUMS_CONTENT" ]]; then
echo "Error: Could not download SHA256SUMS file" >&2
exit 1
fi
# Extract version from any filename in SHA256SUMS
VERSION=$(echo "$SHA256SUMS_CONTENT" | \
grep -oP 'debian-live-\K[\d.]+(?=-amd64-\w+\.iso)' | \
head -n1)
if [[ -z "$VERSION" ]]; then
echo "Error: Could not determine Debian version from SHA256SUMS" >&2
exit 1
fi
# Extract hash from SHA256SUMS for this flavor
ISO_FILENAME="debian-live-${VERSION}-amd64-${FLAVOR}.iso"
HASH_HEX=$(echo "$SHA256SUMS_CONTENT" | \
grep " ${ISO_FILENAME}$" | \
awk '{print $1}')
if [[ -z "$HASH_HEX" ]]; then
echo "Error: Could not find hash for $ISO_FILENAME in SHA256SUMS" >&2
echo "" >&2
echo "Available ISOs:" >&2
echo "$SHA256SUMS_CONTENT" | grep '\.iso$' | sed 's/^/ /' >&2
exit 1
fi
# Convert hex hash to SRI format
HASH_SRI=$(nix-hash --type sha256 --to-sri "$HASH_HEX")
# Output the Nix code block
cat <<EOF
mrescue-debian-${FLAVOR} = mkDebianLive {
flavor = "${FLAVOR}";
version = "${VERSION}";
hash = "${HASH_SRI}";
};
EOF