# Check if the desired rules are among the currently present rules
forbootloader,rulesindesired_rules.items():
# For caterina, check if ModemManager is running
ifbootloader=="caterina":
ifcheck_modem_manager():
ok=False
cli.log.warn("{bg_yellow}Detected ModemManager without the necessary udev rules. Please either disable it or set the appropriate udev rules if you are using a Pro Micro.")
ifnotrules.issubset(current_rules):
# If the rules for catalina are not present, check if ModemManager is running
ifbootloader=="caterina":
ifcheck_modem_manager():
ok=False
cli.log.warn("{bg_yellow}Detected ModemManager without udev rules. Please either disable it or set the appropriate udev rules if you are using a Pro Micro.")
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)
else:
cli.log.warn("{bg_yellow}Missing udev rules for '%s' boards. You'll need to use `sudo` in order to flash them.",bootloader)