Skip to content

Commit 6ef9a11

Browse files
committed
feat(image): SA-independent slim stage (reclaim stale qcow2 clusters, re-push same tag)
The 34G :26 is mostly stale install clusters (macOS uses ~12G, ~8G after sleepimage). Slimming only needs SSH (sudo+dd work even with the GUI stuck at Setup Assistant) + the MacHDD discard=unmap,detect-zeroes=unmap: drop sleepimage/caches, zero-fill free space (unmapped in place), then capture with convert -c (drops the zeroed clusters). New 'slim' stage boots the tag, slims over SSH, re-pushes the same tag. Decoupled from the SA-blocked desktop stage.
1 parent 49749fa commit 6ef9a11

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/build-macos-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
stage:
7-
description: "boot | install | setup (provision SSH) | desktop (auto-login + skip SA + slim, repush :26) | verify"
7+
description: "boot | install | setup | desktop (WIP, blocked on SA) | verify | slim (reclaim stale clusters, repush same tag)"
88
required: true
99
default: "boot"
1010
version_tag:

scripts/build-qemu-macos.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,19 @@ stage_desktop() { # turn the SSH-ready :26 into a boot-straight-to-desktop + sl
420420
capture_and_push "$GHCR_TAG" # tahoe:26 = boots straight to cocoon's desktop, slimmed
421421
}
422422

423+
stage_slim() { # SA-INDEPENDENT slim: boot, reclaim stale clusters over SSH, re-push the same tag.
424+
# Works on SSH-ready images (:26) regardless of the GUI being stuck at Setup Assistant — slimming
425+
# only needs SSH (sudo+dd work at the SA stage) + the MacHDD discard=unmap,detect-zeroes=unmap.
426+
boot_macintosh
427+
log "waiting for SSH (slim is SA-independent; SSH comes up even with the GUI at Setup Assistant)"
428+
wait_ssh 36 || { log "FATAL: SSH never came up"; return 1; }
429+
slim_disk
430+
log "clean shutdown"
431+
gssh 'echo cocoon | sudo -S shutdown -h now' >/dev/null 2>&1 || true
432+
sleep 20
433+
capture_and_push "$GHCR_TAG" # convert -c drops the now-zeroed/unmapped stale clusters
434+
}
435+
423436
main() {
424437
require_kvm
425438
setup_osx_kvm
@@ -434,6 +447,8 @@ main() {
434447
pull_image "$GHCR_TAG"; configure_opencore hide; launch_qemu; stage_desktop ;;
435448
verify)
436449
pull_image "$GHCR_TAG"; configure_opencore hide; launch_qemu; stage_verify ;;
450+
slim)
451+
pull_image "$GHCR_TAG"; configure_opencore hide; launch_qemu; stage_slim ;;
437452
*)
438453
log "unknown STAGE=$STAGE"; exit 2 ;;
439454
esac

0 commit comments

Comments
 (0)