zinit(init): remote flist fallback from zos.grid.tf when local manifests are missing
Some checks failed
Build Zero OS Initramfs / build (push) Has been cancelled
Build Zero OS Initramfs / test-matrix (qemu, basic) (push) Has been cancelled
Build Zero OS Initramfs / test-matrix (qemu, serial) (push) Has been cancelled

firmware.sh: if no local firmware-latest.fl, fetch https://zos.grid.tf/store/flists/firmware-latest.fl using wget or busybox wget; then mount via rfs. modules.sh: if no local modules-6.16.5-arch1-1.fl, fetch https://zos.grid.tf/store/flists/modules-6.16.5-arch1-1-Zero-OS.fl using wget or busybox wget; then mount via rfs. Keep env overrides MODULES_FLIST/FIRMWARE_FLIST and RFS_BIN semantics.
This commit is contained in:
2025-09-09 16:23:09 +02:00
parent 0db55fdc6e
commit 998e40c2e5
2 changed files with 38 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ log() { echo "[rfs-firmware] $*"; }
RFS_BIN="${RFS_BIN:-rfs}"
TARGET="/usr/lib/firmware"
BASE_URL="${FLISTS_BASE_URL:-https://zos.grid.tf/store/flists}"
# Allow override via env
if [ -n "${FIRMWARE_FLIST:-}" ] && [ -f "${FIRMWARE_FLIST}" ]; then
@@ -28,9 +29,25 @@ else
fi
if [ -z "${FL:-}" ]; then
log "firmware-latest.fl not found in known paths; skipping mount"
# Try remote fetch as a fallback
mkdir -p /etc/rfs
FL="/etc/rfs/firmware-latest.fl"
URL="${BASE_URL}/firmware-latest.fl"
log "firmware-latest.fl not found locally; fetching ${URL}"
if command -v wget >/dev/null 2>&1; then
wget -q -O "${FL}" "${URL}" || true
elif command -v busybox >/dev/null 2>&1; then
busybox wget -q -O "${FL}" "${URL}" || true
else
log "no wget available to fetch ${URL}"
fi
if [ ! -s "${FL}" ]; then
log "failed to fetch ${URL}; skipping mount"
exit 0
fi
fi
# Ensure target directory exists
mkdir -p "$TARGET"

View File

@@ -9,6 +9,7 @@ log() { echo "[rfs-modules] $*"; }
RFS_BIN="${RFS_BIN:-rfs}"
KVER="$(uname -r)"
TARGET="/lib/modules/${KVER}"
BASE_URL="${FLISTS_BASE_URL:-https://zos.grid.tf/store/flists}"
# Allow override via env
if [ -n "${MODULES_FLIST:-}" ] && [ -f "${MODULES_FLIST}" ]; then
@@ -29,9 +30,25 @@ else
fi
if [ -z "${FL:-}" ]; then
log "modules-${KVER}.fl not found in known paths; skipping mount"
# Try remote fetch as a fallback (modules-<uname -r>-Zero-OS.fl)
mkdir -p /etc/rfs
FL="/etc/rfs/modules-${KVER}.fl"
URL="${BASE_URL}/modules-${KVER}-Zero-OS.fl"
log "modules-${KVER}.fl not found locally; fetching ${URL}"
if command -v wget >/dev/null 2>&1; then
wget -q -O "${FL}" "${URL}" || true
elif command -v busybox >/dev/null 2>&1; then
busybox wget -q -O "${FL}" "${URL}" || true
else
log "no wget available to fetch ${URL}"
fi
if [ ! -s "${FL}" ]; then
log "failed to fetch ${URL}; skipping mount"
exit 0
fi
fi
# Ensure target directory exists
mkdir -p "$TARGET"