feat(klipper): check for brltty-udev too

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0
2023-11-12 01:26:43 +01:00
parent be805c169b
commit 6ed5395f17

View File

@@ -142,32 +142,36 @@ def check_user_groups():
def handle_disruptive_system_packages() -> None: def handle_disruptive_system_packages() -> None:
services = [] services = []
brltty_status = subprocess.run(
["systemctl", "is-enabled", "brltty"], capture_output=True, text=True command = ["systemctl", "is-enabled", "brltty"]
) brltty_status = subprocess.run(command, capture_output=True, text=True)
modem_manager_status = subprocess.run(
["systemctl", "is-enabled", "ModemManager"], capture_output=True, text=True command = ["systemctl", "is-enabled", "brltty-udev"]
) brltty_udev_status = subprocess.run(command, capture_output=True, text=True)
command = ["systemctl", "is-enabled", "ModemManager"]
modem_manager_status = subprocess.run(command, capture_output=True, text=True)
if "enabled" in brltty_status.stdout: if "enabled" in brltty_status.stdout:
services.append("brltty") services.append("brltty")
if "enabled" in brltty_udev_status.stdout:
services.append("brltty-udev")
if "enabled" in modem_manager_status.stdout: if "enabled" in modem_manager_status.stdout:
services.append("ModemManager") services.append("ModemManager")
for service in services if services else []: for service in services if services else []:
try: try:
Logger.print_info( log = f"{service} service detected! Masking {service} service ..."
f"{service} service detected! Masking {service} service ..." Logger.print_info(log)
)
mask_system_service(service) mask_system_service(service)
Logger.print_ok(f"{service} service masked!") Logger.print_ok(f"{service} service masked!")
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
warn_msg = textwrap.dedent( warn_msg = textwrap.dedent(
f""" f"""
KIAUH was unable to mask the {service} system service. KIAUH was unable to mask the {service} system service.
Please fix the problem manually. Otherwise, this may have Please fix the problem manually. Otherwise, this may have
undesirable effects on the operation of Klipper. undesirable effects on the operation of Klipper.
""" """
)[1:] )[1:]
Logger.print_warn(warn_msg) Logger.print_warn(warn_msg)