Skip to content

feat(installer): prepare storage media on macOS - #301

Merged
Developer-Simon merged 16 commits into
prereleasefrom
feat/installer-media-macos
Nov 29, 2026
Merged

Developer-Simon merged 16 commits into
prereleasefrom
feat/installer-media-macos

Conversation

@Developer-Simon

Copy link
Copy Markdown
Owner

Squash-merge commit message

The installer mode "Media" now works on macOS: it finds the Raspberry Pi Imager 2.0.12 or newer, lists drives, writes with the administrator password dialog of macOS, shows progress, cancels, and takes time zone, keyboard layout and Wi-Fi country from the Mac. Wi-Fi names, networks in range and the password check are not available on macOS.

- The imager runs as the normal user and asks for the device right itself, so the installer needs no elevated helper on macOS
- The administrator rights step stays open while the macOS dialog is open, and a refused dialog ends as missing rights
- The drive list never shows the disk the Mac runs from, also behind an APFS container, and hides a disk when diskutil gives no usable information
- A new workflow checks writing and cancelling on a macOS runner with a RAM disk

Known limits: macOS is only checked by automated tests and a look at the user interface with a fake backend. The password dialog on a real Mac (confirm and refuse), real USB sticks and SD cards, and Intel Macs are unverified. The refusal line of the imager comes from its source code and was never observed.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

Highlight translations

Highlights (de):
- Der Installer bereitet Speichermedien jetzt auch unter macOS vor

Tour

none

Summary

macOS support for the installer mode "Media", built on the platform seam of #298.

installer (user)
  diskutil list + info -> drive list without the system disk
  list drives again, same path, model and size
  rpi-imager --cli (user, same runner as Linux)
    "using macOS authorization"  -> rights step stays active, macOS asks
    "Successfully opened device" -> rights step done
    "Authorization cancelled"    -> MEDIA_RIGHTS_DENIED

Evidence

  • Before: the Media tab showed "not available on this system" on macOS
  • After: installer-macos-media.yml green on macos-latest (run 46315769904). Imager 2.0.12 wrote a 64 MiB image to a RAM disk, the bytes matched, and a cancelled 1 GiB write ended with no imager process left
  • Local: installer and web UI Go tests, go vet for darwin and windows, 598 UI tests, 32 e2e tests, 401 script tests
  • The user interface was checked by hand with the fake backend

Merge danger

  • Two-way door, a revert is enough
  • Blast radius: installer only. Shared code touched: rights step handling in the job, three new parser phases, the rights note on the write screen
  • The new workflow runs only for changes to the media and host packages and is not part of ci-ok

Checks

  • The title is a Conventional Commits subject.
  • scripts/dev/check_tracked_secrets.sh is clean.
  • AI assistance disclosed per AI-DISCLAIMER.md: Claude Sonnet 5.5
  • Suites run locally: go test (installer, webui), npm test, e2e, pytest scripts, macOS workflow
  • Linked issue: none

Developer-Simon and others added 16 commits November 29, 2026 23:02
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Look for the imager app in /Applications and the user's Applications
folder, read its version from Info.plist, and treat macOS imagers
below 2.0.12 as too old. macOS imagers are started directly with --cli,
like the Windows one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tion

The imager asks for the device right itself when the user cannot open the
drive. The job now keeps the rights step active while that dialog is open,
closes it once the device is opened, and reports a refused dialog as
MEDIA_RIGHTS_DENIED. macOS gets its own host file with the Homebrew link.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Parse diskutil output and hide the system disk: the parent disk of /,
the whole disks of its APFS physical stores and its container.
Disk images count as internal, fail closed without a root parent.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The media screens show the Homebrew command on macOS, the rights hint
for the write step and no network scan on step 2 when macOS reports no
networks. The fake host gets a darwin platform for the e2e test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds the workflow that runs the media mode end to end on macos-latest:
the imager writes a 64 MiB test image to a RAM disk, the written bytes
are compared, and a 1 GiB write is cancelled at its first write.
The test is build-tagged darwin and mediae2e and skips without
EN_MAC_RAMDISK.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The media mode is supported on macOS, so TestMediaUnsupportedWithoutLinux
no longer gets the unsupported answer there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Developer-Simon
Developer-Simon merged commit d68584e into prerelease Nov 29, 2026
25 checks passed
@Developer-Simon
Developer-Simon deleted the feat/installer-media-macos branch November 29, 2026 22:15
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