diff options
author | ruro <ruro.ruro@ya.ru> | 2021-07-31 07:43:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 21:43:42 -0700 |
commit | 52dad230d68ffecc3dc5b317cc5f1194b9c6802b (patch) | |
tree | 45fc7788fb6ddd5cfb95a6f6185396d6c5019ac9 /lib/python/qmk | |
parent | 6d82c92476240255eecbab850db26b8706184c83 (diff) | |
download | qmk_firmware-52dad230d68ffecc3dc5b317cc5f1194b9c6802b.tar.gz qmk_firmware-52dad230d68ffecc3dc5b317cc5f1194b9c6802b.zip |
[CLI] Make `qmk doctor` more lenient about system config (#13804)
Diffstat (limited to 'lib/python/qmk')
-rw-r--r-- | lib/python/qmk/cli/doctor/check.py | 4 | ||||
-rw-r--r-- | lib/python/qmk/cli/doctor/linux.py | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/lib/python/qmk/cli/doctor/check.py b/lib/python/qmk/cli/doctor/check.py index a0bbb2816..0807f4151 100644 --- a/lib/python/qmk/cli/doctor/check.py +++ b/lib/python/qmk/cli/doctor/check.py | |||
@@ -159,6 +159,6 @@ def check_git_repo(): | |||
159 | This is a decent enough indicator that the qmk_firmware directory is a | 159 | This is a decent enough indicator that the qmk_firmware directory is a |
160 | proper Git repository, rather than a .zip download from GitHub. | 160 | proper Git repository, rather than a .zip download from GitHub. |
161 | """ | 161 | """ |
162 | dot_git_dir = QMK_FIRMWARE / '.git' | 162 | dot_git = QMK_FIRMWARE / '.git' |
163 | 163 | ||
164 | return CheckStatus.OK if dot_git_dir.is_dir() else CheckStatus.WARNING | 164 | return CheckStatus.OK if dot_git.exists() else CheckStatus.WARNING |
diff --git a/lib/python/qmk/cli/doctor/linux.py b/lib/python/qmk/cli/doctor/linux.py index c0b77216a..8ea04cd69 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(): | |||
41 | """Make sure the udev rules look good. | 41 | """Make sure the udev rules look good. |
42 | """ | 42 | """ |
43 | rc = CheckStatus.OK | 43 | rc = CheckStatus.OK |
44 | udev_dir = Path("/etc/udev/rules.d/") | 44 | udev_dirs = [ |
45 | Path("/usr/lib/udev/rules.d/"), | ||
46 | Path("/usr/local/lib/udev/rules.d/"), | ||
47 | Path("/run/udev/rules.d/"), | ||
48 | Path("/etc/udev/rules.d/"), | ||
49 | ] | ||
45 | desired_rules = { | 50 | desired_rules = { |
46 | 'atmel-dfu': { | 51 | 'atmel-dfu': { |
47 | _udev_rule("03eb", "2fef"), # ATmega16U2 | 52 | _udev_rule("03eb", "2fef"), # ATmega16U2 |
@@ -90,8 +95,8 @@ def check_udev_rules(): | |||
90 | 'tmk': {_deprecated_udev_rule("feed")} | 95 | 'tmk': {_deprecated_udev_rule("feed")} |
91 | } | 96 | } |
92 | 97 | ||
93 | if udev_dir.exists(): | 98 | if any(udev_dir.exists() for udev_dir in udev_dirs): |
94 | udev_rules = [rule_file for rule_file in udev_dir.glob('*.rules')] | 99 | udev_rules = [rule_file for udev_dir in udev_dirs for rule_file in udev_dir.glob('*.rules')] |
95 | current_rules = set() | 100 | current_rules = set() |
96 | 101 | ||
97 | # Collect all rules from the config files | 102 | # Collect all rules from the config files |
@@ -117,7 +122,8 @@ def check_udev_rules(): | |||
117 | 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) | 122 | 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) |
118 | 123 | ||
119 | else: | 124 | else: |
120 | cli.log.warning("{fg_yellow}'%s' does not exist. Skipping udev rule checking...", udev_dir) | 125 | cli.log.warning("{fg_yellow}Can't find udev rules, skipping udev rule checking...") |
126 | cli.log.debug("Checked directories: %s", ', '.join(str(udev_dir) for udev_dir in udev_dirs)) | ||
121 | 127 | ||
122 | return rc | 128 | return rc |
123 | 129 | ||