diff options
| author | Joel Challis <git@zvecr.com> | 2023-01-19 10:25:47 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-19 10:25:47 +0000 |
| commit | 4973950ddcef28d94a1fc589951e024a91a240d7 (patch) | |
| tree | a52fba64d5198fc219fc201ac286dd97aa7458b9 /lib/python/qmk/cli/doctor/linux.py | |
| parent | 3723c0e3d57f0afdff0e1b7421d26d6c7f6c980d (diff) | |
Print distro in doctor output (#19633)
Diffstat (limited to 'lib/python/qmk/cli/doctor/linux.py')
| -rw-r--r-- | lib/python/qmk/cli/doctor/linux.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/python/qmk/cli/doctor/linux.py b/lib/python/qmk/cli/doctor/linux.py index 95bafe8c64..f0850d4e64 100644 --- a/lib/python/qmk/cli/doctor/linux.py +++ b/lib/python/qmk/cli/doctor/linux.py | |||
| @@ -7,7 +7,11 @@ from pathlib import Path | |||
| 7 | from milc import cli | 7 | from milc import cli |
| 8 | 8 | ||
| 9 | from qmk.constants import QMK_FIRMWARE, BOOTLOADER_VIDS_PIDS | 9 | from qmk.constants import QMK_FIRMWARE, BOOTLOADER_VIDS_PIDS |
| 10 | from .check import CheckStatus | 10 | from .check import CheckStatus, release_info |
| 11 | |||
| 12 | |||
| 13 | def _is_wsl(): | ||
| 14 | return 'microsoft' in platform.uname().release.lower() | ||
| 11 | 15 | ||
| 12 | 16 | ||
| 13 | def _udev_rule(vid, pid=None, *args): | 17 | def _udev_rule(vid, pid=None, *args): |
| @@ -130,17 +134,22 @@ def check_modem_manager(): | |||
| 130 | def os_test_linux(): | 134 | def os_test_linux(): |
| 131 | """Run the Linux specific tests. | 135 | """Run the Linux specific tests. |
| 132 | """ | 136 | """ |
| 133 | # Don't bother with udev on WSL, for now | 137 | info = release_info() |
| 134 | if 'microsoft' in platform.uname().release.lower(): | 138 | release_id = info.get('PRETTY_NAME', info.get('ID', 'Unknown')) |
| 135 | cli.log.info("Detected {fg_cyan}Linux (WSL){fg_reset}.") | 139 | plat = 'WSL, ' if _is_wsl() else '' |
| 136 | 140 | ||
| 141 | cli.log.info(f"Detected {{fg_cyan}}Linux ({plat}{release_id}){{fg_reset}}.") | ||
| 142 | |||
| 143 | # Don't bother with udev on WSL, for now | ||
| 144 | if _is_wsl(): | ||
| 137 | # https://github.com/microsoft/WSL/issues/4197 | 145 | # https://github.com/microsoft/WSL/issues/4197 |
| 138 | if QMK_FIRMWARE.as_posix().startswith("/mnt"): | 146 | if QMK_FIRMWARE.as_posix().startswith("/mnt"): |
| 139 | cli.log.warning("I/O performance on /mnt may be extremely slow.") | 147 | cli.log.warning("I/O performance on /mnt may be extremely slow.") |
| 140 | return CheckStatus.WARNING | 148 | return CheckStatus.WARNING |
| 141 | 149 | ||
| 142 | return CheckStatus.OK | ||
| 143 | else: | 150 | else: |
| 144 | cli.log.info("Detected {fg_cyan}Linux{fg_reset}.") | 151 | rc = check_udev_rules() |
| 152 | if rc != CheckStatus.OK: | ||
| 153 | return rc | ||
| 145 | 154 | ||
| 146 | return check_udev_rules() | 155 | return CheckStatus.OK |
