From 4973950ddcef28d94a1fc589951e024a91a240d7 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 19 Jan 2023 10:25:47 +0000 Subject: Print distro in doctor output (#19633) --- lib/python/qmk/cli/doctor/linux.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'lib/python/qmk/cli/doctor/linux.py') 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 from milc import cli from qmk.constants import QMK_FIRMWARE, BOOTLOADER_VIDS_PIDS -from .check import CheckStatus +from .check import CheckStatus, release_info + + +def _is_wsl(): + return 'microsoft' in platform.uname().release.lower() def _udev_rule(vid, pid=None, *args): @@ -130,17 +134,22 @@ def check_modem_manager(): def os_test_linux(): """Run the Linux specific tests. """ - # Don't bother with udev on WSL, for now - if 'microsoft' in platform.uname().release.lower(): - cli.log.info("Detected {fg_cyan}Linux (WSL){fg_reset}.") + info = release_info() + release_id = info.get('PRETTY_NAME', info.get('ID', 'Unknown')) + plat = 'WSL, ' if _is_wsl() else '' + cli.log.info(f"Detected {{fg_cyan}}Linux ({plat}{release_id}){{fg_reset}}.") + + # Don't bother with udev on WSL, for now + if _is_wsl(): # https://github.com/microsoft/WSL/issues/4197 if QMK_FIRMWARE.as_posix().startswith("/mnt"): cli.log.warning("I/O performance on /mnt may be extremely slow.") return CheckStatus.WARNING - return CheckStatus.OK else: - cli.log.info("Detected {fg_cyan}Linux{fg_reset}.") + rc = check_udev_rules() + if rc != CheckStatus.OK: + return rc - return check_udev_rules() + return CheckStatus.OK -- cgit v1.2.3