fix(migration): generate NM wifi keyfiles in Python pre-reboot with correct SSID encoding#520
Closed
mrosseel wants to merge 1 commit into
Closed
fix(migration): generate NM wifi keyfiles in Python pre-reboot with correct SSID encoding#520mrosseel wants to merge 1 commit into
mrosseel wants to merge 1 commit into
Conversation
…orrect SSID encoding
Collaborator
Author
|
Superseded by #521 — same fix, minimal form (one file, ~30 lines, keeps the existing shell converter and corrects only the encoding). The Python pre-reboot generator in this PR remains on the fork's |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the bug that left every migrated device unable to join its wifi network: the busybox-shell converter in
nixos_migration_init.shwrote SSIDs into NetworkManager keyfiles as hex byte lists (ssid=61;70;6f;…), but NM's keyfile format only parses decimal byte lists — the garbage was stored as a literal-string SSID, so the device scanned for a network literally named61;70;6f;6c;6c;6f;("apollo"). Diagnosed on real hardware (profiles repaired in place withnmcli); a fun corollary: an SSID whose hex pairs are all decimal digits parsed "successfully" into different garbage ("0x20"→ phantomNnetwork).What changed
PiFinder/nixos_migration_wifi.py), instead of in busybox shell after the rootfs is staged — unit-testable, and the initramfs just copies the pre-staged files.ssid=emits decimal byte lists (97;112;…), the documented format.46 unit tests (
test_nixos_migration_wifi.py): parsing (quoted/unquoted/hex PSK/comments/multiple networks), encoding, filename sanitisation, keyfile structure, end-to-end hex-SSID conversion.This is pre-migration (Raspbian-side) code:
sys_utils.start_nixos_migrationrunspython/scripts/nixos_migration.shfrom the device's checkout, which now pre-stages the keyfiles and builds them into the migration initramfs.🤖 Generated with Claude Code