forked from tfgrid/zosbuilder
zinit(init): remote flist fallback from zos.grid.tf when local manifests are missing
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:
@@ -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,8 +29,24 @@ else
|
||||
fi
|
||||
|
||||
if [ -z "${FL:-}" ]; then
|
||||
log "firmware-latest.fl not found in known paths; skipping mount"
|
||||
exit 0
|
||||
# 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
|
||||
|
||||
@@ -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,8 +30,24 @@ else
|
||||
fi
|
||||
|
||||
if [ -z "${FL:-}" ]; then
|
||||
log "modules-${KVER}.fl not found in known paths; skipping mount"
|
||||
exit 0
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user