Skip to content

Import iwd WiFi networks into NetworkManager on upgrade#6321

Open
RushiChaganti wants to merge 1 commit into
basecamp:quattrofrom
RushiChaganti:fix/import-iwd-wifi-networks
Open

Import iwd WiFi networks into NetworkManager on upgrade#6321
RushiChaganti wants to merge 1 commit into
basecamp:quattrofrom
RushiChaganti:fix/import-iwd-wifi-networks

Conversation

@RushiChaganti

Copy link
Copy Markdown
Contributor

The quattro migration retired iwd/systemd-networkd in favor of NetworkManager but never carried over previously-saved WiFi networks, so they appear "forgotten" after upgrading.

Add a migration that re-creates them as NetworkManager profiles from iwd's on-disk store (/var/lib/iwd). It is idempotent (skips SSIDs NetworkManager already knows), best-effort (never aborts the migration run), handles open/WPA-PSK and hidden networks, and leaves 802.1x enterprise networks for manual re-add.

Copilot AI review requested due to automatic review settings July 20, 2026 04:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an Omarchy migration to restore WiFi connectivity after upgrading to quattro by importing previously saved iwd networks from /var/lib/iwd into NetworkManager connection profiles, aiming to make upgrades feel seamless for users whose networks otherwise appear “forgotten”.

Changes:

  • Add a new migration that scans iwd’s saved network store and recreates open/WPA-PSK networks as NetworkManager connections.
  • Implement SSID decoding for iwd’s filename formats and skip SSIDs already known to NetworkManager (idempotent import).
  • Respect hidden-network configuration when generating NetworkManager profiles; leave 802.1x/enterprise networks for manual re-add.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread migrations/1784523021.sh
Comment on lines +9 to +15
as_root() {
if (( EUID == 0 )); then
"$@"
else
sudo "$@"
fi
}
Comment thread migrations/1784523021.sh Outdated
Comment on lines +71 to +74
as_root nmcli connection add type wifi con-name "$ssid" ssid "$ssid" \
802-11-wireless.hidden "$hidden" \
wifi-sec.key-mgmt wpa-psk wifi-sec.psk "$secret" \
connection.autoconnect yes \
Comment thread migrations/1784523021.sh
Comment on lines +1 to +7
echo "Import WiFi networks from iwd into NetworkManager"

# The quattro upgrade retired iwd/systemd-networkd in favor of NetworkManager
# but did not carry over previously-saved WiFi networks, so they appear
# "forgotten". Their credentials still live in iwd's store; re-create them as
# NetworkManager profiles. Idempotent and best-effort: it never aborts the
# migration run and skips networks NetworkManager already knows.
The quattro migration retired iwd/systemd-networkd in favor of
NetworkManager but never carried over previously-saved WiFi networks,
so they appear "forgotten" after upgrading.

Add a migration that re-creates them as NetworkManager profiles from
iwd's on-disk store (/var/lib/iwd). It is idempotent (skips SSIDs
NetworkManager already knows), best-effort (never aborts the migration
run), handles open/WPA-PSK and hidden networks, and leaves 802.1x
enterprise networks for manual re-add.

Profiles are written as keyfiles directly into NetworkManager's store
rather than through `nmcli connection add`. A PSK passed to nmcli would
sit in argv and be readable from /proc by any local user for the life of
the call; here the profile travels over stdin into a root-owned 0600
file, and only `nmcli connection reload` is invoked.

Covered by test/shell.d/iwd-wifi-import-test.sh, which stubs
nmcli/systemctl/sudo against a temp iwd store and asserts the parsing,
hex-SSID decoding, 802.1x skip, file mode, idempotency, and that no
secret ever reaches nmcli's argv.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K9uCtJinm6xw8QEe9WHzvo
Copilot AI review requested due to automatic review settings July 20, 2026 05:06
@RushiChaganti
RushiChaganti force-pushed the fix/import-iwd-wifi-networks branch from 2b9a7aa to 3279677 Compare July 20, 2026 05:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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.

2 participants