Possible to force udev to create specific device event number, or change device event numbers
Clash Royale CLAN TAG#URR8PPP
I have a kernel module that reads usb keyboard input specifically from /dev/input/event2 and /dev/input/event3.
On some devices the keyboard doesn't get assigned event2 and event3, it gets assigned /dev/input/event3 and /dev/input/event4 which of course causes the module to miss input.
I have pored over the udev rules and examples, but I cannot seem to find a way to force udev to assign a specific event# character device. I can get it to assign additional whatever else such as, /dev/input/mydevice, etc, but that doesn't help in this case. Is this possible?
As a further complication, the plugged in device isn't really a keyboard, it's a wireless presenter and it assigns a mouse to event2, the volume up/down button to event3, and the forward back buttons to event4. Like the following:
drwxr-xr-x 160 Apr 1 00:05 .
drwxr-xr-x 240 Apr 1 00:05 ..
*lrwxrwxrwxroot 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-event-mouse -> ../event2
lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-mouse -> ../mouse0
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.1-event-kbd -> ../event3
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.2-event-kbd -> ../event4
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.0-platform-max77696-onkey.0-event -> ../event0
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.1-event -> ../event1
And I need it to look like this:
drwxr-xr-x 160 Apr 1 00:05 .
drwxr-xr-x 240 Apr 1 00:05 ..
*lrwxrwxrwxroot 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-event-mouse -> ../event4
lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-mouse -> ../mouse0
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.1-event-kbd -> ../event3
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.2-event-kbd -> ../event2
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.0-platform-max77696-onkey.0-event -> ../event0
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.1-event -> ../event1
The value I think to need to change is the "KERNEL" value. Using udevadm info on the mouse device I get the following results.
[root@kin input]# udevadm info -a -p $(udevadm info -q path -n /dev/input/by-
path/platform-fsl-ehci.0-usb-0:1:1.0-event-mouse
looking at device '/devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.0/input/input26/event2':
KERNEL=="event2"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device '/devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.0/input/input26':
KERNELS=="input26"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRSname=="Genius Wireless Mouse"
ATTRSphys=="usb-fsl-ehci.0-1/input0"
ATTRSuniq==""
ATTRSmodalias=="input:b0003v0458p0189e0101-e0,1,2,4,k110,111,112,113,114,r0,1,6,8,am4,lsfw"
ATTRSproperties=="0"
linux usb udev devices
add a comment |
I have a kernel module that reads usb keyboard input specifically from /dev/input/event2 and /dev/input/event3.
On some devices the keyboard doesn't get assigned event2 and event3, it gets assigned /dev/input/event3 and /dev/input/event4 which of course causes the module to miss input.
I have pored over the udev rules and examples, but I cannot seem to find a way to force udev to assign a specific event# character device. I can get it to assign additional whatever else such as, /dev/input/mydevice, etc, but that doesn't help in this case. Is this possible?
As a further complication, the plugged in device isn't really a keyboard, it's a wireless presenter and it assigns a mouse to event2, the volume up/down button to event3, and the forward back buttons to event4. Like the following:
drwxr-xr-x 160 Apr 1 00:05 .
drwxr-xr-x 240 Apr 1 00:05 ..
*lrwxrwxrwxroot 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-event-mouse -> ../event2
lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-mouse -> ../mouse0
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.1-event-kbd -> ../event3
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.2-event-kbd -> ../event4
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.0-platform-max77696-onkey.0-event -> ../event0
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.1-event -> ../event1
And I need it to look like this:
drwxr-xr-x 160 Apr 1 00:05 .
drwxr-xr-x 240 Apr 1 00:05 ..
*lrwxrwxrwxroot 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-event-mouse -> ../event4
lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-mouse -> ../mouse0
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.1-event-kbd -> ../event3
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.2-event-kbd -> ../event2
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.0-platform-max77696-onkey.0-event -> ../event0
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.1-event -> ../event1
The value I think to need to change is the "KERNEL" value. Using udevadm info on the mouse device I get the following results.
[root@kin input]# udevadm info -a -p $(udevadm info -q path -n /dev/input/by-
path/platform-fsl-ehci.0-usb-0:1:1.0-event-mouse
looking at device '/devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.0/input/input26/event2':
KERNEL=="event2"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device '/devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.0/input/input26':
KERNELS=="input26"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRSname=="Genius Wireless Mouse"
ATTRSphys=="usb-fsl-ehci.0-1/input0"
ATTRSuniq==""
ATTRSmodalias=="input:b0003v0458p0189e0101-e0,1,2,4,k110,111,112,113,114,r0,1,6,8,am4,lsfw"
ATTRSproperties=="0"
linux usb udev devices
1
That's a FAQ. You don't assign numbers for anything created in/dev
. Instead, you create symlinks with known names to specific devices (like your kernel module), and then use the symlinks instead of/dev/input/event2
etc. And no, it doesn't work the other way round (forcing specific numbers), even if you think it should.
– dirkt
Feb 22 at 14:21
As I said in my post, I can create symlinks just fine and that is useless to me because the kernel module is hard coded to use event2/3. I have no opinion on how it should work. It sounds like you don't know any way to solve this issue, hopefully someone else does.
– Eru007
Feb 22 at 15:12
A kernel module that reads events by opening specific files instead of using the kernel API to get events is quite unusual, to put it mildly. The way I would solve this is to usedd
or a hexeditor to patch the kernel module to use some other paths instead, them create those paths as symlinks withudev
.
– dirkt
Feb 23 at 16:37
1
Ok now we're talking! I hadn't thought of patching the module like that. I tried erasing event2 and recreating it with mknod with the major,minor numbers I needed, and it worked. I got the keyboard output previously on event4 on event2, but the module was not aware of the change. I'll look into how to patch the module directly. Thank you for your assistance!
– Eru007
Feb 25 at 6:36
dirkt for the win! I edited the file with a hex editor and voila, it's working. Thank you so much. Shoulda just asked here first...woulda saved me about 20 some hours.
– Eru007
Feb 25 at 10:05
add a comment |
I have a kernel module that reads usb keyboard input specifically from /dev/input/event2 and /dev/input/event3.
On some devices the keyboard doesn't get assigned event2 and event3, it gets assigned /dev/input/event3 and /dev/input/event4 which of course causes the module to miss input.
I have pored over the udev rules and examples, but I cannot seem to find a way to force udev to assign a specific event# character device. I can get it to assign additional whatever else such as, /dev/input/mydevice, etc, but that doesn't help in this case. Is this possible?
As a further complication, the plugged in device isn't really a keyboard, it's a wireless presenter and it assigns a mouse to event2, the volume up/down button to event3, and the forward back buttons to event4. Like the following:
drwxr-xr-x 160 Apr 1 00:05 .
drwxr-xr-x 240 Apr 1 00:05 ..
*lrwxrwxrwxroot 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-event-mouse -> ../event2
lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-mouse -> ../mouse0
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.1-event-kbd -> ../event3
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.2-event-kbd -> ../event4
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.0-platform-max77696-onkey.0-event -> ../event0
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.1-event -> ../event1
And I need it to look like this:
drwxr-xr-x 160 Apr 1 00:05 .
drwxr-xr-x 240 Apr 1 00:05 ..
*lrwxrwxrwxroot 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-event-mouse -> ../event4
lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-mouse -> ../mouse0
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.1-event-kbd -> ../event3
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.2-event-kbd -> ../event2
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.0-platform-max77696-onkey.0-event -> ../event0
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.1-event -> ../event1
The value I think to need to change is the "KERNEL" value. Using udevadm info on the mouse device I get the following results.
[root@kin input]# udevadm info -a -p $(udevadm info -q path -n /dev/input/by-
path/platform-fsl-ehci.0-usb-0:1:1.0-event-mouse
looking at device '/devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.0/input/input26/event2':
KERNEL=="event2"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device '/devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.0/input/input26':
KERNELS=="input26"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRSname=="Genius Wireless Mouse"
ATTRSphys=="usb-fsl-ehci.0-1/input0"
ATTRSuniq==""
ATTRSmodalias=="input:b0003v0458p0189e0101-e0,1,2,4,k110,111,112,113,114,r0,1,6,8,am4,lsfw"
ATTRSproperties=="0"
linux usb udev devices
I have a kernel module that reads usb keyboard input specifically from /dev/input/event2 and /dev/input/event3.
On some devices the keyboard doesn't get assigned event2 and event3, it gets assigned /dev/input/event3 and /dev/input/event4 which of course causes the module to miss input.
I have pored over the udev rules and examples, but I cannot seem to find a way to force udev to assign a specific event# character device. I can get it to assign additional whatever else such as, /dev/input/mydevice, etc, but that doesn't help in this case. Is this possible?
As a further complication, the plugged in device isn't really a keyboard, it's a wireless presenter and it assigns a mouse to event2, the volume up/down button to event3, and the forward back buttons to event4. Like the following:
drwxr-xr-x 160 Apr 1 00:05 .
drwxr-xr-x 240 Apr 1 00:05 ..
*lrwxrwxrwxroot 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-event-mouse -> ../event2
lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-mouse -> ../mouse0
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.1-event-kbd -> ../event3
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.2-event-kbd -> ../event4
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.0-platform-max77696-onkey.0-event -> ../event0
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.1-event -> ../event1
And I need it to look like this:
drwxr-xr-x 160 Apr 1 00:05 .
drwxr-xr-x 240 Apr 1 00:05 ..
*lrwxrwxrwxroot 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-event-mouse -> ../event4
lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.0-mouse -> ../mouse0
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.1-event-kbd -> ../event3
*lrwxrwxrwx 9 Apr 1 00:05 platform-fsl-ehci.0-usb-0:1:1.2-event-kbd -> ../event2
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.0-platform-max77696-onkey.0-event -> ../event0
lrwxrwxrwx 9 Apr 1 00:00 platform-imx-i2c.1-event -> ../event1
The value I think to need to change is the "KERNEL" value. Using udevadm info on the mouse device I get the following results.
[root@kin input]# udevadm info -a -p $(udevadm info -q path -n /dev/input/by-
path/platform-fsl-ehci.0-usb-0:1:1.0-event-mouse
looking at device '/devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.0/input/input26/event2':
KERNEL=="event2"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device '/devices/platform/fsl-ehci.0/usb1/1-1/1-1:1.0/input/input26':
KERNELS=="input26"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRSname=="Genius Wireless Mouse"
ATTRSphys=="usb-fsl-ehci.0-1/input0"
ATTRSuniq==""
ATTRSmodalias=="input:b0003v0458p0189e0101-e0,1,2,4,k110,111,112,113,114,r0,1,6,8,am4,lsfw"
ATTRSproperties=="0"
linux usb udev devices
linux usb udev devices
edited Feb 22 at 15:57
Rui F Ribeiro
41.5k1483141
41.5k1483141
asked Feb 22 at 13:59
Eru007Eru007
31
31
1
That's a FAQ. You don't assign numbers for anything created in/dev
. Instead, you create symlinks with known names to specific devices (like your kernel module), and then use the symlinks instead of/dev/input/event2
etc. And no, it doesn't work the other way round (forcing specific numbers), even if you think it should.
– dirkt
Feb 22 at 14:21
As I said in my post, I can create symlinks just fine and that is useless to me because the kernel module is hard coded to use event2/3. I have no opinion on how it should work. It sounds like you don't know any way to solve this issue, hopefully someone else does.
– Eru007
Feb 22 at 15:12
A kernel module that reads events by opening specific files instead of using the kernel API to get events is quite unusual, to put it mildly. The way I would solve this is to usedd
or a hexeditor to patch the kernel module to use some other paths instead, them create those paths as symlinks withudev
.
– dirkt
Feb 23 at 16:37
1
Ok now we're talking! I hadn't thought of patching the module like that. I tried erasing event2 and recreating it with mknod with the major,minor numbers I needed, and it worked. I got the keyboard output previously on event4 on event2, but the module was not aware of the change. I'll look into how to patch the module directly. Thank you for your assistance!
– Eru007
Feb 25 at 6:36
dirkt for the win! I edited the file with a hex editor and voila, it's working. Thank you so much. Shoulda just asked here first...woulda saved me about 20 some hours.
– Eru007
Feb 25 at 10:05
add a comment |
1
That's a FAQ. You don't assign numbers for anything created in/dev
. Instead, you create symlinks with known names to specific devices (like your kernel module), and then use the symlinks instead of/dev/input/event2
etc. And no, it doesn't work the other way round (forcing specific numbers), even if you think it should.
– dirkt
Feb 22 at 14:21
As I said in my post, I can create symlinks just fine and that is useless to me because the kernel module is hard coded to use event2/3. I have no opinion on how it should work. It sounds like you don't know any way to solve this issue, hopefully someone else does.
– Eru007
Feb 22 at 15:12
A kernel module that reads events by opening specific files instead of using the kernel API to get events is quite unusual, to put it mildly. The way I would solve this is to usedd
or a hexeditor to patch the kernel module to use some other paths instead, them create those paths as symlinks withudev
.
– dirkt
Feb 23 at 16:37
1
Ok now we're talking! I hadn't thought of patching the module like that. I tried erasing event2 and recreating it with mknod with the major,minor numbers I needed, and it worked. I got the keyboard output previously on event4 on event2, but the module was not aware of the change. I'll look into how to patch the module directly. Thank you for your assistance!
– Eru007
Feb 25 at 6:36
dirkt for the win! I edited the file with a hex editor and voila, it's working. Thank you so much. Shoulda just asked here first...woulda saved me about 20 some hours.
– Eru007
Feb 25 at 10:05
1
1
That's a FAQ. You don't assign numbers for anything created in
/dev
. Instead, you create symlinks with known names to specific devices (like your kernel module), and then use the symlinks instead of /dev/input/event2
etc. And no, it doesn't work the other way round (forcing specific numbers), even if you think it should.– dirkt
Feb 22 at 14:21
That's a FAQ. You don't assign numbers for anything created in
/dev
. Instead, you create symlinks with known names to specific devices (like your kernel module), and then use the symlinks instead of /dev/input/event2
etc. And no, it doesn't work the other way round (forcing specific numbers), even if you think it should.– dirkt
Feb 22 at 14:21
As I said in my post, I can create symlinks just fine and that is useless to me because the kernel module is hard coded to use event2/3. I have no opinion on how it should work. It sounds like you don't know any way to solve this issue, hopefully someone else does.
– Eru007
Feb 22 at 15:12
As I said in my post, I can create symlinks just fine and that is useless to me because the kernel module is hard coded to use event2/3. I have no opinion on how it should work. It sounds like you don't know any way to solve this issue, hopefully someone else does.
– Eru007
Feb 22 at 15:12
A kernel module that reads events by opening specific files instead of using the kernel API to get events is quite unusual, to put it mildly. The way I would solve this is to use
dd
or a hexeditor to patch the kernel module to use some other paths instead, them create those paths as symlinks with udev
.– dirkt
Feb 23 at 16:37
A kernel module that reads events by opening specific files instead of using the kernel API to get events is quite unusual, to put it mildly. The way I would solve this is to use
dd
or a hexeditor to patch the kernel module to use some other paths instead, them create those paths as symlinks with udev
.– dirkt
Feb 23 at 16:37
1
1
Ok now we're talking! I hadn't thought of patching the module like that. I tried erasing event2 and recreating it with mknod with the major,minor numbers I needed, and it worked. I got the keyboard output previously on event4 on event2, but the module was not aware of the change. I'll look into how to patch the module directly. Thank you for your assistance!
– Eru007
Feb 25 at 6:36
Ok now we're talking! I hadn't thought of patching the module like that. I tried erasing event2 and recreating it with mknod with the major,minor numbers I needed, and it worked. I got the keyboard output previously on event4 on event2, but the module was not aware of the change. I'll look into how to patch the module directly. Thank you for your assistance!
– Eru007
Feb 25 at 6:36
dirkt for the win! I edited the file with a hex editor and voila, it's working. Thank you so much. Shoulda just asked here first...woulda saved me about 20 some hours.
– Eru007
Feb 25 at 10:05
dirkt for the win! I edited the file with a hex editor and voila, it's working. Thank you so much. Shoulda just asked here first...woulda saved me about 20 some hours.
– Eru007
Feb 25 at 10:05
add a comment |
1 Answer
1
active
oldest
votes
A kernel module that reads events by opening specific files instead of using the kernel API to get events is quite unusual, to put it mildly.
The way I would solve this is to use dd
or a hexeditor to patch the kernel module to use some other paths instead, them create those paths as symlinks with udev
.
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%2f502310%2fpossible-to-force-udev-to-create-specific-device-event-number-or-change-device%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
A kernel module that reads events by opening specific files instead of using the kernel API to get events is quite unusual, to put it mildly.
The way I would solve this is to use dd
or a hexeditor to patch the kernel module to use some other paths instead, them create those paths as symlinks with udev
.
add a comment |
A kernel module that reads events by opening specific files instead of using the kernel API to get events is quite unusual, to put it mildly.
The way I would solve this is to use dd
or a hexeditor to patch the kernel module to use some other paths instead, them create those paths as symlinks with udev
.
add a comment |
A kernel module that reads events by opening specific files instead of using the kernel API to get events is quite unusual, to put it mildly.
The way I would solve this is to use dd
or a hexeditor to patch the kernel module to use some other paths instead, them create those paths as symlinks with udev
.
A kernel module that reads events by opening specific files instead of using the kernel API to get events is quite unusual, to put it mildly.
The way I would solve this is to use dd
or a hexeditor to patch the kernel module to use some other paths instead, them create those paths as symlinks with udev
.
answered Feb 25 at 11:29
dirktdirkt
17.3k31338
17.3k31338
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%2f502310%2fpossible-to-force-udev-to-create-specific-device-event-number-or-change-device%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
1
That's a FAQ. You don't assign numbers for anything created in
/dev
. Instead, you create symlinks with known names to specific devices (like your kernel module), and then use the symlinks instead of/dev/input/event2
etc. And no, it doesn't work the other way round (forcing specific numbers), even if you think it should.– dirkt
Feb 22 at 14:21
As I said in my post, I can create symlinks just fine and that is useless to me because the kernel module is hard coded to use event2/3. I have no opinion on how it should work. It sounds like you don't know any way to solve this issue, hopefully someone else does.
– Eru007
Feb 22 at 15:12
A kernel module that reads events by opening specific files instead of using the kernel API to get events is quite unusual, to put it mildly. The way I would solve this is to use
dd
or a hexeditor to patch the kernel module to use some other paths instead, them create those paths as symlinks withudev
.– dirkt
Feb 23 at 16:37
1
Ok now we're talking! I hadn't thought of patching the module like that. I tried erasing event2 and recreating it with mknod with the major,minor numbers I needed, and it worked. I got the keyboard output previously on event4 on event2, but the module was not aware of the change. I'll look into how to patch the module directly. Thank you for your assistance!
– Eru007
Feb 25 at 6:36
dirkt for the win! I edited the file with a hex editor and voila, it's working. Thank you so much. Shoulda just asked here first...woulda saved me about 20 some hours.
– Eru007
Feb 25 at 10:05