Coder Social home page Coder Social logo

Comments (6)

denilsonsa avatar denilsonsa commented on June 9, 2024

Regarding the file name, I chose 51-*.rules on purpose, because there are other later rules that check if ID_INPUT_JOYSTICK is set. Look:

$ grep JOYSTICK /lib/udev/rules.d/*
/lib/udev/rules.d/60-persistent-input.rules:ENV{ID_INPUT_JOYSTICK}=="?*", ENV{.INPUT_CLASS}="joystick"
/lib/udev/rules.d/70-uaccess.rules:SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="uaccess"
/lib/udev/rules.d/70-udev-acl.rules:SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl"

Undoing those rules later on is more difficult, specially the udev-acl and uaccess ones. I'm using a Lubuntu 15.04 system.

I don't have access to any Raspberry Pi system, I can't check it.


Regarding removing the device, I always feel over-cautious regarding running rm, specially in automated script that run as root.

Still, I see why some users may want to do that. I think I'll generate a second file that deletes the device instead of removing the permissions. Then, the user can choose which file will be installed.

Also, as a bonus, removing the device will most likely "fix" the issue of filename order (51-* or 9999-*).

from udev-joystick-blacklist.

denilsonsa avatar denilsonsa commented on June 9, 2024

@hhromic I've just pushed the alternate version. Any comments?

from udev-joystick-blacklist.

hhromic avatar hhromic commented on June 9, 2024

Hi Denilson,

Ah you are right! When the rules remove devices, the order doesn't matter anymore so 51-* works for me now. I didn't think of that, good catch.

Regarding the two versions, I agree. It makes sense for the end-user to decide if he/she wants to remove the device files or to remove permissions instead.

Good work with this repo, and hope the Kernel is fixed soon. I hate patches. By the way, I will try to make the OSMC guys to bring this patch into the official distribution. Thanks again!

Hugo.

from udev-joystick-blacklist.

denilsonsa avatar denilsonsa commented on June 9, 2024

@hhromic Do you know how different are udev rules in your Raspberry Pi, when compared to Ubuntu? Have you tried grepping those rules, looking for JOYSTICK? I'm curious to know why you had to put these rules at the very end.

from udev-joystick-blacklist.

hhromic avatar hhromic commented on June 9, 2024

@denilsonsa I'm using a very particular OS for my Raspberry Pi: OSMC. This is a media-center oriented distribution (very very good by the way). It's fully based on Debian 8 (Jessie). When grepping for JOYSTICK this is what I get:

$ grep JOYSTICK /lib/udev/rules.d/*
/lib/udev/rules.d/60-persistent-input.rules:ENV{ID_INPUT_JOYSTICK}=="?*", ENV{.INPUT_CLASS}="joystick"
/lib/udev/rules.d/70-uaccess.rules:SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="uaccess"

However, OSMC in particular brings the following rules in the /etc/udev/rules.d/998-fix-input.rules file:

# input
KERNEL=="mouse*|mice|event*",   MODE="0660", GROUP="osmc"
KERNEL=="ts[0-9]*|uinput",      MODE="0660", GROUP="osmc"
KERNEL=="js[0-9]*",             MODE="0660", GROUP="osmc"

# tty
SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0666"

What they do is to give ownership of the devices to the user osmc (the main user of the media-center) and give 0660 permissions. This is why I had to move down the rules because these rules rendered the 0000 permissions back to 0660. Now that I'm completely removing the device files, those rules doesn't matter for the purpose of disabling the joystick devices. This is why I consider deletion of the files a more clean/elegant solution/patch.

Let me know if you are curious about any other thing about the Raspberry Pi!

Cheers,
Hugo.

from udev-joystick-blacklist.

denilsonsa avatar denilsonsa commented on June 9, 2024

I've added a short description of this issue to the README (9cdf6d8). Together with 7460da7, we can close this.

Thanks for bringing it up and for the detailed comments!

from udev-joystick-blacklist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.