Repository navigation
fix(linux-host): read Wi-Fi devices from sysfs without find - #176
Merged
Merged
Conversation
The kernel probe ran `find -L` over /sys/class/net. Each entry there is a symlink to a device directory whose `subsystem` link points back at the class directory, so GNU find follows it, reports a file system loop and exits 1 after printing its matches, which failed the play on a real host. A shell glob over `<dir>/*/phy80211` has no traversal to loop and exits 0 with no output when no interface has a phy. The test sysfs is now a real directory tree with the same symlinks (class entry -> device directory holding phy80211 and a subsystem link back), read by the real shell, so a find that follows links fails it.
Mearman
marked this pull request as ready for review
November 3, 2026 00:41
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
|
🎉 This PR is included in version 2.20.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
The networkd path from #174 read Wi-Fi interfaces with
find -L /sys/class/net -mindepth 2 -maxdepth 2 -name phy80211. On a real sysfs each/sys/class/net/<name>links to a device directory with asubsystemlink back to the class directory, so GNU find follows it, prints the match, reports "File system loop detected" and exits 1. The task has nofailed_when, so the play failed on the i5.The probe is now a shell glob (
for phy in "$1"/*/phy80211), skipping the unmatched literal with[ -e ], so there is nothing to loop and a host without Wi-Fi gives empty output and exit 0. It is the only place in the roles, plugins or tests that walks sysfs with find; the others (stat/caton fixed paths) do not traverse.The test sysfs was flat directories, which is why the stand-in hid it. It is now a real tree with the real symlinks, read by the real shell. Before: with GNU find first on PATH,
test_wifi_power_save_under_networkd_is_a_udev_rule_a_unit_iw_and_the_radio_nowfails on the old task withfind: File system loop detectedand rc 1 (macOS's BSD find does not fail, so it only fails here with GNU find on PATH; CI's Ubuntu runner has it). After: all 90test_linux_hosttests pass with GNU find first on PATH.