Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Udev related fixes and improvements #10736

Merged
merged 11 commits into from
Nov 16, 2020
Merged

Conversation

Erovia
Copy link
Member

@Erovia Erovia commented Oct 23, 2020

Description

  • Only check ModemManager if Caterina udev rule is not found.

  • Not all udev implementations support 'RUN{builtin}+="uaccess"', so we only check it on systemd systems where systemd-udevd is likely used.

@sigprof could you test it with eudev?

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added cli qmk cli command python labels Oct 23, 2020
@Erovia Erovia requested a review from a team October 23, 2020 16:38
@github-actions github-actions bot added the core label Oct 24, 2020
@sigprof
Copy link
Contributor

sigprof commented Oct 24, 2020

I'm not sure that using RUN{builtin}+="uaccess" directly was actually intended by systemd developers. A related bug report asking for some documentation for the uaccess mechanism (systemd/systemd#4288) is unanswered since 2016, but it seems that the intended usage is to use just TAG+="uaccess" in rules (which must come before 73-seat-late.rules), and rely on the appropriate utility (either the uaccess builtin, or elogind-uaccess-command as used in elogind/elogind#47) to be called from 73-seat-late.rules. Also in theory the support for the uaccess builtin is optional even in the real udev from systemd (the rule which calls it from 73-seat-late.rules is guarded by the HAVE_ACL compile time condition).

As for ModemManager, it could be running even without systemd (at least Void Linux has the corresponding package, but I don't have any hardware which actually needs it), therefore removing the warning completely for such systems might not be 100% correct.

@Erovia
Copy link
Member Author

Erovia commented Oct 24, 2020

Yes, RUN{builtin}+="uaccess" shouldn't be needed in theory, but for some reason it was in practice.
Anyway, I'm open to improving the rules, so I'll do some testing again.

ModemManager: This PR does not remove any functionality, as we currently only test MM if systemctl is present. I realize this is a shortcoming and MM can run with other inits, that's why I added the TODO to implement the checks for other service managers.

@Erovia
Copy link
Member Author

Erovia commented Oct 30, 2020

After doing some testing with the help of D3vastat0r and Dasky from Discord, the RUN{builtin}+="uaccess" seems to be unnecessary.
So I removed them from the udev file and from the checks as well.

Also, doctor's state handling is more complicated as it's now has 3 states:

  • everything a-ok
  • minor stuffs were found, e.g.: missing udev rules
  • major stuffs were found, e.g.: missing tools

The output should be more informative, especially for new-comers.
I hope it will be clearer if something is just a warning.

lib/python/qmk/cli/doctor.py Outdated Show resolved Hide resolved
Matching is case-sensitive and according
http://www.linux-usb.org/usb.ids and my personal experience, Linux only
uses lower-case letters.
@Erovia Erovia merged commit b337ba7 into qmk:master Nov 16, 2020
@Erovia Erovia deleted the cli/doctor_mm branch November 16, 2020 21:09
drashna pushed a commit to zsa/qmk_firmware that referenced this pull request Nov 24, 2020
xgnxs pushed a commit to xgnxs/qmk_firmware that referenced this pull request Jan 9, 2021
drashna pushed a commit to zsa/qmk_firmware that referenced this pull request Jan 13, 2021
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli qmk cli command core python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants