Skip to content

Prove the rebuilt Mac boot image types with the layout setup picked - #669

Merged
maralcbr merged 2 commits into
quattro-upstreamfrom
mac/111-keyboard-layout-unlock
Sep 28, 2026
Merged

maralcbr merged 2 commits into
quattro-upstreamfrom
mac/111-keyboard-layout-unlock

Conversation

@maralcbr

Copy link
Copy Markdown
Collaborator

Ticket 111 (keyboard layout at disk unlock), omarchy-mac part.

provision-commit now checks the image that will boot after its rebuild: the UKI's initramfs on a Limine Mac, /boot/initramfs-<kernel>.img otherwise. It won't finish unless the image carries /etc/vconsole.conf's keyboard settings, the KEYMAP file and the XKB symbols. The keymap must also load (loadkeys chrooted into the image) and the XKB layout must compile from the image's own files (xkbcli --test). A US or non-Latin layout must leave no other layout behind. If any check fails, the staged key stays and rd.luks.key= is restored, so the retry still boots unattended. As a result, a setup retry that picked another layout can't keep the old one at the password prompt. The layout checks moved out of omarchy-apple-silicon-boot-check into lib/boot-image-layout.sh so both use the same code. The boot check behaves as before.

The runtime side is not in this PR. That covers fail-closed apply_keyboard and forcing the rebuild on a retry whose layout changed (a journal fingerprint in luks-rekey.sh), and it belongs to omacom#13362. The Mac keyboard model/variant is deferred: no XKB variant fixes the Danish $ § key without breaking Super or other layouts, and a change the console map doesn't mirror would lock owners out (details in ticket 111).

Tests: boot suite (all 27 files) and the related root shell tests pass as non-root in an Arch ARM container. The opt-in real-image test (OMARCHY_DISPOSABLE_BOOT_TESTS) builds a Danish image with plymouth and proves the check against it; it now uses -Syu, since -Sy no longer resolves. New Danish seam test: test/shell.d/mac-keyboard-layout-seam-test.sh. It covers vconsole.conf, the initramfs keymap list and the Hyprland input. Hardware: not run, since the test Macs are busy with a reinstall.

Second review: safe to merge, no correctness defects. Its notes: tool behaviour is proven only in the container test, and the check relies on plymouth pulling in libxkbcommon.

…cked

provision-commit now extracts the image that boots (the UKI's initramfs on a
Limine Mac) after its rebuild and refuses to finish unless it carries
/etc/vconsole.conf's keyboard settings, the KEYMAP file and XKB symbols, and
both load from the image's own files; a US or non-Latin layout must leave no
other layout behind. A setup retry that picked another layout can no longer
keep the old one at the disk password prompt. The layout checks move from the
boot check into a shared library both use.
provision-commit now extracts the rebuilt image to check its keyboard layout;
the stub image carries no vconsole.conf, as a Mac left on the US map builds.
@maralcbr
maralcbr merged commit 4973c13 into quattro-upstream Sep 28, 2026
5 checks passed
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