summaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/cli/doctor/linux.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/cli/doctor/linux.py')
-rw-r--r--lib/python/qmk/cli/doctor/linux.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/python/qmk/cli/doctor/linux.py b/lib/python/qmk/cli/doctor/linux.py
index c0b77216a1..8ea04cd698 100644
--- a/lib/python/qmk/cli/doctor/linux.py
+++ b/lib/python/qmk/cli/doctor/linux.py
@@ -41,7 +41,12 @@ def check_udev_rules():
"""Make sure the udev rules look good.
"""
rc = CheckStatus.OK
- udev_dir = Path("/etc/udev/rules.d/")
+ udev_dirs = [
+ Path("/usr/lib/udev/rules.d/"),
+ Path("/usr/local/lib/udev/rules.d/"),
+ Path("/run/udev/rules.d/"),
+ Path("/etc/udev/rules.d/"),
+ ]
desired_rules = {
'atmel-dfu': {
_udev_rule("03eb", "2fef"), # ATmega16U2
@@ -90,8 +95,8 @@ def check_udev_rules():
'tmk': {_deprecated_udev_rule("feed")}
}
- if udev_dir.exists():
- udev_rules = [rule_file for rule_file in udev_dir.glob('*.rules')]
+ if any(udev_dir.exists() for udev_dir in udev_dirs):
+ udev_rules = [rule_file for udev_dir in udev_dirs for rule_file in udev_dir.glob('*.rules')]
current_rules = set()
# Collect all rules from the config files
@@ -117,7 +122,8 @@ def check_udev_rules():
cli.log.warning("{fg_yellow}Missing or outdated udev rules for '%s' boards. Run 'sudo cp %s/util/udev/50-qmk.rules /etc/udev/rules.d/'.", bootloader, QMK_FIRMWARE)
else:
- cli.log.warning("{fg_yellow}'%s' does not exist. Skipping udev rule checking...", udev_dir)
+ cli.log.warning("{fg_yellow}Can't find udev rules, skipping udev rule checking...")
+ cli.log.debug("Checked directories: %s", ', '.join(str(udev_dir) for udev_dir in udev_dirs))
return rc