udev rule for a USB device and ignoring othersRestrict peripherals to input/output devicesIs there a way to...
How to stop co-workers from teasing me because I know Russian?
Why is the origin of “threshold” uncertain?
How to back up a running remote server?
Why does nature favour the Laplacian?
Options leqno, reqno for documentclass or exist another option?
What's the polite way to say "I need to urinate"?
If Earth is tilted, why is Polaris always above the same spot?
How deep to place a deadman anchor for a slackline?
A question regarding using the definite article
How to determine the actual or "true" resolution of a digital photograph?
When did stoichiometry begin to be taught in U.S. high schools?
When and why did journal article titles become descriptive, rather than creatively allusive?
Does a creature that is immune to a condition still make a saving throw?
How to replace the "space symbol" (squat-u) in listings?
In Proverbs 14:34, is sin a disgrace to a people, or is mercy a sin-offering?
Binary Numbers Magic Trick
Lock in SQL Server and Oracle
Stark VS Thanos
How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?
What is the range of this combined function?
Transfer over $10k
What word means to make something obsolete?
Does the EU Common Fisheries Policy cover British Overseas Territories?
What is the difference between `a[bc]d` (brackets) and `a{b,c}d` (braces)?
udev rule for a USB device and ignoring others
Restrict peripherals to input/output devicesIs there a way to blacklist one HID Device or ignore a udev event?Removing device from USB hub triggers udev event for removing hubudev rule for usb attach/detach not triggeringudev rule for bluetooth device LogitechAdd udev rule alias for input deviceIs there a udev attribute/something that determines whether a device is a USB drive or not?Handle mouse and keyboard usb device in udevHow to detect if USB device is bootable in udev?Detect power_supply online status for different device in udev ruleKernel module inconsistencyUdev rule for disabling usb serial driver
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
Is it possible to create a udev rule for an USB device and ignore other USB devices?
I want my system to support HID USB touchscreen (hid.ko) and ignore HID devices such as keyboards, mice, etc.
linux usb udev
add a comment |
Is it possible to create a udev rule for an USB device and ignore other USB devices?
I want my system to support HID USB touchscreen (hid.ko) and ignore HID devices such as keyboards, mice, etc.
linux usb udev
add a comment |
Is it possible to create a udev rule for an USB device and ignore other USB devices?
I want my system to support HID USB touchscreen (hid.ko) and ignore HID devices such as keyboards, mice, etc.
linux usb udev
Is it possible to create a udev rule for an USB device and ignore other USB devices?
I want my system to support HID USB touchscreen (hid.ko) and ignore HID devices such as keyboards, mice, etc.
linux usb udev
linux usb udev
edited Jan 22 '14 at 14:32
terdon♦
135k33273452
135k33273452
asked Jan 22 '14 at 13:41
Alfredo Pons MenarguesAlfredo Pons Menargues
1947
1947
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
By the time udev is running to handle creating the device, it's too late—the kernel has already attached the HID driver to the mouse/keyboard/etc.
Instead, you should be able to use the USB authorization framework (I've personally never used this, so I can't vouch it works). Basically, you tell Linux not to authorize new USB devices. Then you individually authorize each one by doing echo 1 > /sys/bus/usb/devices/DEVICE/authorized as root.
You can set the default to not authorized via the usbcore authorized_default=0 module parameter or the usbcore.authorized_default=0 kernel parameter (if USB isn't compiled as a module). Alternatively, you can do it on a per-bus basis, after boot, with echo 0 > /sys/bus/usb/devices/usbX/authorized_default.
add a comment |
There was an option called ignore_device, but it no longer exists. From the changelog,
remove
ignore_deviceThere is no way to ignore an event these days. Libudev events can not be suppressed. It only prevents RUN keys from being executed,
which results in an inconsistent behavior in current setups.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f110418%2fudev-rule-for-a-usb-device-and-ignoring-others%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
By the time udev is running to handle creating the device, it's too late—the kernel has already attached the HID driver to the mouse/keyboard/etc.
Instead, you should be able to use the USB authorization framework (I've personally never used this, so I can't vouch it works). Basically, you tell Linux not to authorize new USB devices. Then you individually authorize each one by doing echo 1 > /sys/bus/usb/devices/DEVICE/authorized as root.
You can set the default to not authorized via the usbcore authorized_default=0 module parameter or the usbcore.authorized_default=0 kernel parameter (if USB isn't compiled as a module). Alternatively, you can do it on a per-bus basis, after boot, with echo 0 > /sys/bus/usb/devices/usbX/authorized_default.
add a comment |
By the time udev is running to handle creating the device, it's too late—the kernel has already attached the HID driver to the mouse/keyboard/etc.
Instead, you should be able to use the USB authorization framework (I've personally never used this, so I can't vouch it works). Basically, you tell Linux not to authorize new USB devices. Then you individually authorize each one by doing echo 1 > /sys/bus/usb/devices/DEVICE/authorized as root.
You can set the default to not authorized via the usbcore authorized_default=0 module parameter or the usbcore.authorized_default=0 kernel parameter (if USB isn't compiled as a module). Alternatively, you can do it on a per-bus basis, after boot, with echo 0 > /sys/bus/usb/devices/usbX/authorized_default.
add a comment |
By the time udev is running to handle creating the device, it's too late—the kernel has already attached the HID driver to the mouse/keyboard/etc.
Instead, you should be able to use the USB authorization framework (I've personally never used this, so I can't vouch it works). Basically, you tell Linux not to authorize new USB devices. Then you individually authorize each one by doing echo 1 > /sys/bus/usb/devices/DEVICE/authorized as root.
You can set the default to not authorized via the usbcore authorized_default=0 module parameter or the usbcore.authorized_default=0 kernel parameter (if USB isn't compiled as a module). Alternatively, you can do it on a per-bus basis, after boot, with echo 0 > /sys/bus/usb/devices/usbX/authorized_default.
By the time udev is running to handle creating the device, it's too late—the kernel has already attached the HID driver to the mouse/keyboard/etc.
Instead, you should be able to use the USB authorization framework (I've personally never used this, so I can't vouch it works). Basically, you tell Linux not to authorize new USB devices. Then you individually authorize each one by doing echo 1 > /sys/bus/usb/devices/DEVICE/authorized as root.
You can set the default to not authorized via the usbcore authorized_default=0 module parameter or the usbcore.authorized_default=0 kernel parameter (if USB isn't compiled as a module). Alternatively, you can do it on a per-bus basis, after boot, with echo 0 > /sys/bus/usb/devices/usbX/authorized_default.
answered Jan 22 '14 at 14:32
derobertderobert
75.7k8164223
75.7k8164223
add a comment |
add a comment |
There was an option called ignore_device, but it no longer exists. From the changelog,
remove
ignore_deviceThere is no way to ignore an event these days. Libudev events can not be suppressed. It only prevents RUN keys from being executed,
which results in an inconsistent behavior in current setups.
add a comment |
There was an option called ignore_device, but it no longer exists. From the changelog,
remove
ignore_deviceThere is no way to ignore an event these days. Libudev events can not be suppressed. It only prevents RUN keys from being executed,
which results in an inconsistent behavior in current setups.
add a comment |
There was an option called ignore_device, but it no longer exists. From the changelog,
remove
ignore_deviceThere is no way to ignore an event these days. Libudev events can not be suppressed. It only prevents RUN keys from being executed,
which results in an inconsistent behavior in current setups.
There was an option called ignore_device, but it no longer exists. From the changelog,
remove
ignore_deviceThere is no way to ignore an event these days. Libudev events can not be suppressed. It only prevents RUN keys from being executed,
which results in an inconsistent behavior in current setups.
answered 1 hour ago
Evan CarrollEvan Carroll
6,350124690
6,350124690
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f110418%2fudev-rule-for-a-usb-device-and-ignoring-others%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown