# Check if the desired rules are among the currently present rules
forbootloader,rulesindesired_rules.items():
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.")
else:
cli.log.warn("{bg_yellow}Missing udev rules for '%s' boards. You'll need to use `sudo` in order to flash them.",bootloader)
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.")
else:
cli.log.warn("Can't find systemctl to check for ModemManager.")
else:
cli.log.warn("{bg_yellow}Missing udev rules for '%s' boards. You'll need to use `sudo` in order to flash them.",bootloader)
ifOS=='Darwin':
ifnotos_test_macos():
ok=False
elifOS=='Linux':
ifnotos_test_linux():
ok=False
elifOS=='Windows':
ifnotos_test_windows():
ok=False
else:
cli.log.error('Unsupported OS detected: %s',OS)
ok=False
# Make sure the basic CLI tools we need are available and can be executed.
bin_ok=check_binaries()
ifnotbin_ok:
ifyesno('Would you like to install dependencies?',default=True):
subprocess.run(['util/qmk_install.sh'])
bin_ok=check_binaries()
ifbin_ok:
cli.log.info('All dependencies are installed.')
else:
cli.log.info("Assuming {fg_cyan}Windows.")
ok=False
# Check out the QMK submodules
sub_ok=check_submodules()
ifsub_ok:
cli.log.info('Submodules are up to date.')
else:
ifyesno('Would you like to clone the submodules?',default=True):
submodules.update()
sub_ok=check_submodules()
ifnotsub_ok:
ok=False
# Report a summary of our findings to the user
ifok:
cli.log.info('{fg_green}QMK is ready to go')
else:
cli.log.info('{fg_yellow}Problems detected, please fix these problems before proceeding.')
# FIXME(skullydazed): Link to a document about troubleshooting, or discord or something
# FIXME(skullydazed/unclaimed): Link to a document about troubleshooting, or discord or something