aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rwxr-xr-xlib/python/qmk/cli/doctor.py60
-rw-r--r--lib/python/qmk/constants.py2
2 files changed, 49 insertions, 13 deletions
diff --git a/lib/python/qmk/cli/doctor.py b/lib/python/qmk/cli/doctor.py
index 4d7ba5218..bad864f72 100755
--- a/lib/python/qmk/cli/doctor.py
+++ b/lib/python/qmk/cli/doctor.py
@@ -10,6 +10,7 @@ from pathlib import Path
10 10
11from milc import cli 11from milc import cli
12from qmk import submodules 12from qmk import submodules
13from qmk.constants import QMK_FIRMWARE
13from qmk.questions import yesno 14from qmk.questions import yesno
14from qmk.commands import run 15from qmk.commands import run
15 16
@@ -149,25 +150,58 @@ def check_udev_rules():
149 ok = True 150 ok = True
150 udev_dir = Path("/etc/udev/rules.d/") 151 udev_dir = Path("/etc/udev/rules.d/")
151 desired_rules = { 152 desired_rules = {
152 'dfu': {_udev_rule("03eb", "2ff4"), _udev_rule("03eb", "2ffb"), _udev_rule("03eb", "2ff0")}, 153 'atmel-dfu': {
153 'input_club': {_udev_rule("1c11", "b007")}, 154 _udev_rule("03EB", "2FEF"), # ATmega16U2
154 'stm32': {_udev_rule("1eaf", "0003"), _udev_rule("0483", "df11")}, 155 _udev_rule("03EB", "2FF0"), # ATmega32U2
155 'bootloadhid': {_udev_rule("16c0", "05df")}, 156 _udev_rule("03EB", "2FF3"), # ATmega16U4
157 _udev_rule("03EB", "2FF4"), # ATmega32U4
158 _udev_rule("03EB", "2FF9"), # AT90USB64
159 _udev_rule("03EB", "2FFB") # AT90USB128
160 },
161 'kiibohd': {
162 _udev_rule("1C11", "B007")
163 },
164 'stm32': {
165 _udev_rule("1EAF", "0003"), # STM32duino
166 _udev_rule("0483", "DF11") # STM32 DFU
167 },
168 'bootloadhid': {
169 _udev_rule("16C0", "05DF")
170 },
171 'usbasploader': {
172 _udev_rule("16C0", "05DC")
173 },
174 'massdrop': {
175 _udev_rule("03EB", "6124")
176 },
156 'caterina': { 177 'caterina': {
157 _udev_rule("2341", "0036", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), 178 # Spark Fun Electronics
158 _udev_rule("1b4f", "9205", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), 179 _udev_rule("1B4F", "9203", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Pro Micro 3V3/8MHz
159 _udev_rule("1b4f", "9203", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), 180 _udev_rule("1B4F", "9205", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Pro Micro 5V/16MHz
160 _udev_rule("2a03", "0036", 'ENV{ID_MM_DEVICE_IGNORE}="1"') 181 _udev_rule("1B4F", "9207", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # LilyPad 3V3/8MHz (and some Pro Micro clones)
182 # Pololu Electronics
183 _udev_rule("1FFB", "0101", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # A-Star 32U4
184 # Arduino SA
185 _udev_rule("2341", "0036", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Leonardo
186 _udev_rule("2341", "0037", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Micro
187 # Adafruit Industries LLC
188 _udev_rule("239A", "000C", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Feather 32U4
189 _udev_rule("239A", "000D", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # ItsyBitsy 32U4 3V3/8MHz
190 _udev_rule("239A", "000E", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # ItsyBitsy 32U4 5V/16MHz
191 # dog hunter AG
192 _udev_rule("2A03", "0036", 'ENV{ID_MM_DEVICE_IGNORE}="1"'), # Leonardo
193 _udev_rule("2A03", "0037", 'ENV{ID_MM_DEVICE_IGNORE}="1"') # Micro
161 } 194 }
162 } 195 }
163 196
164 # These rules are no longer recommended, only use them to check for their presence. 197 # These rules are no longer recommended, only use them to check for their presence.
165 deprecated_rules = { 198 deprecated_rules = {
166 'dfu': {_deprecated_udev_rule("03eb", "2ff4"), _deprecated_udev_rule("03eb", "2ffb"), _deprecated_udev_rule("03eb", "2ff0")}, 199 'atmel-dfu': {_deprecated_udev_rule("03eb", "2ff4"), _deprecated_udev_rule("03eb", "2ffb"), _deprecated_udev_rule("03eb", "2ff0")},
167 'input_club': {_deprecated_udev_rule("1c11")}, 200 'kiibohd': {_deprecated_udev_rule("1c11")},
168 'stm32': {_deprecated_udev_rule("1eaf", "0003"), _deprecated_udev_rule("0483", "df11")}, 201 'stm32': {_deprecated_udev_rule("1eaf", "0003"), _deprecated_udev_rule("0483", "df11")},
169 'bootloadhid': {_deprecated_udev_rule("16c0", "05df")}, 202 'bootloadhid': {_deprecated_udev_rule("16c0", "05df")},
170 'caterina': {'ATTRS{idVendor}=="2a03", ENV{ID_MM_DEVICE_IGNORE}="1"', 'ATTRS{idVendor}=="2341", ENV{ID_MM_DEVICE_IGNORE}="1"'} 203 'caterina': {'ATTRS{idVendor}=="2a03", ENV{ID_MM_DEVICE_IGNORE}="1"', 'ATTRS{idVendor}=="2341", ENV{ID_MM_DEVICE_IGNORE}="1"'},
204 'tmk': {_deprecated_udev_rule("feed")}
171 } 205 }
172 206
173 if udev_dir.exists(): 207 if udev_dir.exists():
@@ -193,7 +227,7 @@ def check_udev_rules():
193 if deprecated_rule and deprecated_rule.issubset(current_rules): 227 if deprecated_rule and deprecated_rule.issubset(current_rules):
194 cli.log.warn("{bg_yellow}Found old, deprecated udev rules for '%s' boards. The new rules on https://docs.qmk.fm/#/faq_build?id=linux-udev-rules offer better security with the same functionality.", bootloader) 228 cli.log.warn("{bg_yellow}Found old, deprecated udev rules for '%s' boards. The new rules on https://docs.qmk.fm/#/faq_build?id=linux-udev-rules offer better security with the same functionality.", bootloader)
195 else: 229 else:
196 cli.log.warn("{bg_yellow}Missing udev rules for '%s' boards. You'll need to use `sudo` in order to flash them.", bootloader) 230 cli.log.warn("{bg_yellow}Missing udev rules for '%s' boards. See https://docs.qmk.fm/#/faq_build?id=linux-udev-rules for more details.", bootloader)
197 231
198 return ok 232 return ok
199 233
@@ -291,6 +325,8 @@ def doctor(cli):
291 cli.log.error('Unsupported OS detected: %s', platform_id) 325 cli.log.error('Unsupported OS detected: %s', platform_id)
292 ok = False 326 ok = False
293 327
328 cli.log.info('QMK home: {fg_cyan}%s', QMK_FIRMWARE)
329
294 # Make sure the basic CLI tools we need are available and can be executed. 330 # Make sure the basic CLI tools we need are available and can be executed.
295 bin_ok = check_binaries() 331 bin_ok = check_binaries()
296 332
diff --git a/lib/python/qmk/constants.py b/lib/python/qmk/constants.py
index 0a4708e4c..0450724df 100644
--- a/lib/python/qmk/constants.py
+++ b/lib/python/qmk/constants.py
@@ -10,6 +10,6 @@ MAX_KEYBOARD_SUBFOLDERS = 5
10 10
11# Supported processor types 11# Supported processor types
12ARM_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F411' 12ARM_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F411'
13AVR_PROCESSORS = 'at90usb1286', 'at90usb646', 'atmega16u2', 'atmega328p', 'atmega32a', 'atmega32u2', 'atmega32u4', None 13AVR_PROCESSORS = 'atmega16u2', 'atmega32u2', 'atmega16u4', 'atmega32u4', 'at90usb646', 'at90usb647', 'at90usb1286', 'at90usb1287', 'atmega328p', 'atmega32a', None
14ALL_PROCESSORS = ARM_PROCESSORS + AVR_PROCESSORS 14ALL_PROCESSORS = ARM_PROCESSORS + AVR_PROCESSORS
15VUSB_PROCESSORS = 'atmega328p', 'atmega32a', 'atmega328', 'attiny85' 15VUSB_PROCESSORS = 'atmega328p', 'atmega32a', 'atmega328', 'attiny85'