Skip to content

Recover M3 WIP boot image when boot.bin is missing - #5

Open
pkyanam wants to merge 1 commit into
staccDOTsol:m3from
pkyanam:m3-kernel-recovery
Open

pkyanam wants to merge 1 commit into
staccDOTsol:m3from
pkyanam:m3-kernel-recovery

Conversation

@pkyanam

@pkyanam pkyanam commented Sep 12, 2026

Copy link
Copy Markdown

When an experimental Asahi kernel leaves boot.bin missing while boot.bin.old or boot.bin.omarchy-pre-wip remains, omarchy-mac-kernel-wip --rollback-boot cannot discover the ESP path and refuses to restore the saved image. The installer also continued after failing to create its recovery snapshot.

This follow-up makes the recovery path functional for that state:

  • discover an ESP boot.bin path from either saved image;
  • copy the saved image to a fresh same-directory temporary file and rename it into place, so a failed copy or rename does not truncate the active image;
  • refuse the WIP package transaction when the pre-install snapshot cannot be created.

The regression test uses the real helper functions and a disposable ESP-shaped directory. Against PR343 baseline ea3267b, the saved-image-only rollback case fails. At c22ff171a7be257fbda7d2176d322a52bbb4af7b, it restores successfully; the test also covers stale restore directories, failed copy/rename cleanup, package-install refusal on snapshot failure, and the existing rollback/remove cases.

Validation: bash test/shell.d/apple-kernel-wip-test.sh, bash -n on the command and test, and git diff --check pass. This was validated with scratch files on macOS/APFS. No native Linux ESP, package-manager transaction, reboot, firmware update, or physical M3 boot was performed, so those runtime paths remain for maintainer validation.

This change was AI-assisted and independently QA-tested and reviewed. Related M3 integration context: omacom#343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant