Comments (6)
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.
@hhromic I've just pushed the alternate version. Any comments?
from udev-joystick-blacklist.
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.
@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.
@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.
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)
- Add Roccat Tyon Mouse HOT 4
- Bloody mouse not removed
- Thank you HOT 2
- Please add [T3] 2.4GHz and IR Air Mouse Remote Control
- Upstream the rules? HOT 2
- /lib/udev/rules.d/51-these-are-not-joysticks-rm.rules vs /etc/udev/rules.d/51-these-are-not-joysticks.rules
- Here is what solved for me
- Wacom Intuos Pen (S) CTL-480 isn't in the blacklist HOT 2
- Switch Pro Controller over USB HOT 3
- Logitech iTouch Composite
- Corsair Harpoon Gaming Mouse HOT 1
- Extra keyboard plus question about removal HOT 2
- Add Support for STRAFE RGB HOT 1
- Teensy LC (Keyboard Only)
- Corsair Harpoon RGB Wireless
- Add Roccat Kone Pure SEL Mouse HOT 1
- Add IPMI Virtual keyboard and mice (American Megatrends Inc) HOT 1
- Add ASUS ROG PUGIO II HOT 1
- Idea: use a hardware database to preemptively add many devices to this list
- Cideko air keyboard HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from udev-joystick-blacklist.