Repository navigation
feat(linux): install udev rules with an explained cross-distro root prompt - #1622
Merged
Merged
Conversation
…rompt (#1621) fbuild port udev --install (and a deploy/monitor/debug preflight) installs USB rules covering tty, raw usb and hidraw with TAG+=uaccess as 70-fbuild.rules, after an fbuild dialog that explains why and gives the manual command. Elevates via pkexec (polkit dialog), sudo, or sudo -A; NixOS installs to /run/udev/rules.d and prints the extraRules snippet. GROUP is only emitted when the group exists: udev drops the whole rule line for an unknown group, so the plugdev rules never applied on NixOS/Arch/Fedora. Closes #1621
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 50 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configurationConfiguration used: Repository: FastLED/fbuild/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…emp dir (#1621) Dylint and the platform-boundary inventory rejected the new installer: cfg!(target_os) and std::os::unix PermissionsExt outside fbuild_core::platform (also a Windows compile break), raw PathBuf, and an unrooted tempfile tempdir. Use platform::host::is_linux, platform::fs::set_executable, NormalizedPath, and tempdir_in under fbuild_paths::temp_subdir. Behavior is otherwise unchanged.
This was referenced Oct 2, 2026
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.
Closes #1621.
What changes
fbuild port udev --installinstalls the USB rules through whatever root prompt the host has:sudoon a terminal;sudo -Awith an askpass helper.If none is available, it prints the exact manual command.
fbuild-install-usb-rules <destination> …from a private temp dir. The helper's arguments are only paths fbuild generated, so no user text reaches a root shell.deploy,monitoranddebugrun a Linux preflight. If an attached board from a registry vendor can't be opened and the rules are missing or stale, they offer the install. The prompt is never raised in CI, withFBUILD_NO_ELEVATE=1, or in a non-interactive session; those get the command instead.usbandhidrawalongsidetty, so probe-rs, picotool, DFU and HID loaders can open their devices. They addTAG+="uaccess"and are installed as70-fbuild.rulesso they sort before logind's73-seat-late.rules, which is what grants the ACL; a stale99-fbuild.rulesis removed.GROUP=is only emitted when the group exists. udev discards the entire line when a group doesn't resolve (Failed to resolve group 'plugdev', ignoring).plugdevdoesn't exist on NixOS, Arch or Fedora, so the feat(linux): own udev rules setup — deploy fails with 'Permission denied' but advises cables and BOOTSEL #1424 rules matched nothing there./etc/udev/rules.dis a read-only store symlink, so the rules go to/run/udev/rules.d, which udevd also reads. fbuild then prints theservices.udev.extraRulessnippet for a permanent install.Evidence (NixOS 26.05, KDE, LPC845-BRK on LPC-Link2
1fc9:0132)Before:
After
fbuild port udev --install:bash autoresearch lpc845(FastLED, this build viaFBUILD_EXECUTABLE) now deploys through probe-rs, with no lpc21isp fallback:The first attempt also showed the
plugdevproblem: the rules were read but every line was dropped (/run/udev/rules.d/70-fbuild.rules:16 Failed to resolve group 'plugdev', ignoring: Unknown group), and the device keptTAGS=:seat:with nouaccess.Tests
uaccess, sorting before 73, noGROUPwithout the group, group-database lookup;/runtarget;sh -c);soldr cargo test -p fbuild-cli: 352 passed. Clippy-D warningsand fmt are clean, andfind_direct_subprocess.py --failpasses.