flash-mac.sh: run as root + wait for partition nodes after sgdisk
Two robustness fixes pulled in alongside the new ac-flash-mac sudoers
whitelist (which scopes NOPASSWD at the script path, not individual
sub-commands):
1. Re-exec under sudo when invoked as a regular user. Drops every
inner `sudo ...` call — the script now always runs as root, so each
privileged step (sgdisk, dd, newfs_msdos, mount_msdos, etc.) just
works without per-command sudoers entries.
2. After `sgdisk --new` writes the new partition table, macOS doesn't
reload it automatically — the s1/s2 device nodes are stale or
missing for ~1-3 seconds. Without this wait, newfs_msdos errors
with "No such file or directory" on a fresh wipe-and-flash. Poll
for the nodes (up to 10s) and prod the kernel via `diskutil list`
between checks.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>