Support Bluetooth keyboards in the live installer - #133
Conversation
|
Audited the installer pairing flow and its handoff to omacom/omarchy#8816, then added a follow-up fix.
Validation: pairing success, mouse/multiple-candidate refusal, disconnected state, cancellation/child cleanup, retry-after-pair-failure, and connection retry without re-pairing passed. Both retry cases crossed the real cooldown. Capability transitions, fallback acknowledgement/abort, and greeter ordering fixtures passed. All 31 focused Bluetooth/provisioning Python tests passed, along with compilation, Bash syntax, and Remaining acceptance work: build and boot an ISO, exercise a physical keyboard/passkey UI, and test the encrypted first reboot. Raw |
Why
The live installer currently assumes that a keyboard can be connected through
USB or a 2.4 GHz receiver. That is not always possible: some keyboards are
Bluetooth-only, some USB connections provide charging but not wired input, and
some machines do not have a compatible free port or the required cable.
A mouse does not resolve this because the text installer still needs keyboard
input for account details and encryption credentials. The useful path is to
break the pairing catch-22 automatically: discover and pair the keyboard while
the welcome screen is waiting, then use that keyboard for the installer itself.
This complements omacom/omarchy#8816, which provides Bluetooth input at the
encrypted-disk prompt after installation. Both layers are needed for an
installation that does not depend on a temporary USB keyboard.
Pairing flow
mode.
screen is waiting.
automatically. If several are visible, it pairs none rather than guessing.
keyboard itself and presses Return. This is handled by the Bluetooth pairing
protocol before normal HID input is available, so no existing mouse or
keyboard is required.
on it to enter and complete the normal installer.
Scanning is limited to the welcome screen and is stopped when installation
begins.
Encrypted first reboot
Pairing only in the ephemeral live environment would leave a cable-free install
stranded at its first LUKS prompt. On encrypted, non-deferred installations,
when the bundled runtime supports it, the configurator therefore offers a separate opt-in to carry the selected bond
into the installed system and enable the early-boot support from
omacom/omarchy#8816.
That second decision is not implied by installer pairing. The prompt explains
that the bond material will be included in the unencrypted boot image and that
Bluetooth radio, firmware, or battery failures remain possible.
The orchestrator validates the controller and device addresses, rejects unsafe
symlinks, copies only the selected bond and controller metadata, and invokes the
runtime setup before the final Limine UKI build. It does not copy unrelated
phones, headsets, or other paired devices.
Limitations
automatic guess.
DisplayOnlykeyboard flow.cannot gain Bluetooth support from this change.
Failure handling
The pairing helper stops and reaps its pairing/scanning processes when the welcome screen ends. The welcome animation stops before passkeys are displayed. Failed attempts can retry, and connection retries preserve an existing successful bond. The helper writes its private selection marker atomically only after confirming paired, trusted, and connected state.
The build records whether its runtime includes Bluetooth-unlock support. The configurator gates the encrypted-boot option on that capability. If support is absent, it requires acknowledgement that another keyboard is available after reboot or aborts. The orchestrator checks the installed command before copying bond data. Handoff rejects unsafe source/cache and target ancestor/file symlinks and restricts copied state permissions.
Validation
bash test/unit/bluetooth-keyboard-pair-test.sh.python3 -m unittest test.unit.test_bluetooth_unlock test.unit.test_provisioning_state.git diff --check.The full Python baseline has 50 existing keyboard-layout errors because
localectlcannot access the system bus in the test sandbox. That suite is not reported as passing.Remaining verification
This PR is open for review. No ISO build, physical Bluetooth keyboard pairing/passkey UI check, encrypted first reboot, or firmware compatibility test has been performed. The fixtures verify software boundaries, not hardware acceptance. Encrypted-boot support requires a runtime package carrying omacom/omarchy#8816; installer pairing remains a separate operation.