fix(iso): zstd-compress bundled core container images (-160MB on the ISO)

Bundling fmcd for offline installs (6dcdada3) shipped the raw
uncompressed podman save tar and grew the ISO ~220MB (2.3G -> 2.5G in
RC6-RC9). Save the core bundle as .tar.zst instead — podman load
auto-detects compression, verified locally against the RC9 fmcd.tar
(228M -> 65M, loads cleanly into rootless storage). The first-boot
loader and installer copy globs now pick up .tar.zst too.

Also trims the installer's USB->disk image copy and first-boot load
time on fresh installs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
archipelago 2026-07-17 11:31:43 -04:00
parent a177ef3b38
commit a76a92cff8

View File

@ -1353,9 +1353,11 @@ if [ "$UNBUNDLED" = "1" ]; then
# unbundled mode — their images must ride on the ISO so a fresh install
# works with no internet: FileBrowser (Cloud file manager) and fmcd
# (fedimint-clientd, ecash/sats out of the box).
# Shipped zstd-compressed: podman load auto-detects compression, and an
# uncompressed fmcd.tar alone added ~220MB to the ISO (RC9 size regression).
CORE_BUNDLE="
${FILEBROWSER_IMAGE} filebrowser.tar
${FMCD_IMAGE} fmcd.tar
${FILEBROWSER_IMAGE} filebrowser.tar.zst
${FMCD_IMAGE} fmcd.tar.zst
"
echo "$CORE_BUNDLE" | while read -r CORE_IMAGE CORE_FILE; do
[ -n "$CORE_IMAGE" ] || continue
@ -1364,9 +1366,14 @@ ${FMCD_IMAGE} fmcd.tar
else
echo " Pulling $CORE_IMAGE ($CONTAINER_PLATFORM)..."
if container_pull "$CORE_IMAGE"; then
$CONTAINER_CMD save "$CORE_IMAGE" -o "$IMAGES_DIR/$CORE_FILE" 2>/dev/null && \
echo " ✅ Saved core: $CORE_FILE ($(du -h "$IMAGES_DIR/$CORE_FILE" | cut -f1))" || \
RAW_TAR="$IMAGES_DIR/${CORE_FILE%.zst}"
if $CONTAINER_CMD save "$CORE_IMAGE" -o "$RAW_TAR" 2>/dev/null && \
zstd -q -T0 -15 --rm "$RAW_TAR" -o "$IMAGES_DIR/$CORE_FILE"; then
echo " ✅ Saved core: $CORE_FILE ($(du -h "$IMAGES_DIR/$CORE_FILE" | cut -f1))"
else
rm -f "$RAW_TAR" "$IMAGES_DIR/$CORE_FILE"
echo " ⚠️ Failed to save $CORE_IMAGE"
fi
else
echo " ⚠️ Failed to pull $CORE_IMAGE — baseline app won't work offline"
fi
@ -1509,7 +1516,7 @@ done
PODMAN="runuser -u archipelago -- env XDG_RUNTIME_DIR=/run/user/$ARCH_UID podman"
$PODMAN system migrate >> "$LOG_FILE" 2>&1 || true
for tarfile in "$IMAGES_DIR"/*.tar; do
for tarfile in "$IMAGES_DIR"/*.tar "$IMAGES_DIR"/*.tar.zst; do
if [ -f "$tarfile" ]; then
echo "$(date): Loading $(basename "$tarfile")..." >> "$LOG_FILE"
$PODMAN load -i "$tarfile" >> "$LOG_FILE" 2>&1 && \
@ -2520,7 +2527,7 @@ fi
if [ -d "$BOOT_MEDIA/archipelago/container-images" ]; then
echo " Copying container images (this may take a moment)..."
mkdir -p /mnt/target/opt/archipelago/container-images
cp -r "$BOOT_MEDIA/archipelago/container-images/"*.tar /mnt/target/opt/archipelago/container-images/ 2>/dev/null || true
cp -r "$BOOT_MEDIA/archipelago/container-images/"*.tar* /mnt/target/opt/archipelago/container-images/ 2>/dev/null || true
# Copy first-boot loader script and service
mkdir -p /mnt/target/opt/archipelago/scripts