Questions tagged [udev]

Udev manages the Linux /dev directory, and hooks userspace into kernel device events.

udev (userspace /dev) is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the /dev directory. At the same time, udev also handles all user space events raised when hardware devices are added into the system or removed from it, including firmware loading as required by certain devices.

https://en.wikipedia.org/wiki/Udev

https://wiki.debian.org/udev

http://reactivated.net/writing_udev_rules.html

518 questions
6
votes
1 answer

udev rule with bInterfaceNumber doesn't work

I'm trying to use udev to give relevant names a USB-serial device but I'm having now luck. # lsusb -d 04e2:1412 -v Bus 004 Device 028: ID 04e2:1412 Exar Corp. Device Descriptor: bLength 18 bDescriptorType …
TheIronChef
  • 81
  • 1
  • 4
6
votes
1 answer

Restoring keyboard settings in Xorg environment after suspending

I'm not using huge DE like Gnome or KDE and changing keyboard rate with xset command: xset r rate 250 70 But after system suspending (by pm-suspend) this settings are lost because udev removes and again adds all devices. I tried to use udev…
user1051870
  • 913
  • 1
  • 10
  • 21
6
votes
3 answers

How to identify a disconnecting USB device using udev rules?

I have two LCD's using Xorg's xinerama feature. Each LCD screen has a touchscreen which are connected to their respective USB lines. Looking into the '/var/log/messages' file, I see the following: kernel: input: Analog Resistive as…
Jeach
  • 8,656
  • 7
  • 45
  • 58
6
votes
1 answer

How to get notifications for SD card events?

I want to check the presence of an SD card, and receive notifications for SD card add/remove. So far I have used libudev, and I've made a small application which listens for SD card events. The code is listed below: #include #include…
Alexandru C.
  • 3,337
  • 1
  • 25
  • 27
5
votes
1 answer

How to identify devices with udev

I'd like to use libudev to watch for certain devices. Specifically, I want to monitor for removable storage: USB Hard Drives, USB Keys, SD cards, etc. The libudev API lets you find a device if you know that device's parent's 'subsystem' and…
Prismatic
  • 3,338
  • 5
  • 36
  • 59
5
votes
0 answers

Which device nodes are managed by udev, and which by evdev?

From the wiki for evdev: evdev (short for 'event device') is a generic input event interface in the Linux kernel and FreeBSD.[1] It generalizes raw input events from device drivers and makes them available through character devices in the…
rcheng
  • 63
  • 3
5
votes
3 answers

Detect if an open file/device has been replaced/deleted

Assume the following situation under Linux: A process is continuously reading from an USB-serial converter device (/dev/ttyUSB0). That device is suddenly unplugged and plugged in again (or is resetting itself for some reason). The process continues…
Udo G
  • 12,572
  • 13
  • 56
  • 89
5
votes
1 answer

udev monitor is slow without polling

I tried udev as recommended (udevadm monitor). The VGA-Plug is reported after approx. two seconds. If I poll it, the change is reported almost instantly. What happens here?
Reactormonk
  • 21,472
  • 14
  • 74
  • 123
5
votes
3 answers

Create UNIX "special character" file

Suppose I want to create, in the spirit of /dev/zero, a file /dev/seven that produces the character '7' whenever it is read from. How should I go about doing something like this? Would I need to modify the kernel?
koschei
  • 819
  • 6
  • 13
5
votes
2 answers

udev rule generating symlink for USB-device using ATTRS{serial} in link name

I have a udev rule that generates symlinks for my USB devices in /dev according to their serial number (I have multiple otherwise identical devices but need reproducible device endpoints). Currently I need to add a rule for every new serial number,…
kratenko
  • 7,354
  • 4
  • 36
  • 61
5
votes
1 answer

udev - difference between += and :=

I'm trying to understand the udev operators so I can create rules for my device, but there seems to be a discrepancy between a couple online sources about the operator that prevents later changes to keys. Which udev operator, if any, will prevent…
Arya
  • 566
  • 2
  • 9
  • 22
5
votes
4 answers

docker --device works with absolute device path, fails with symlink

I have a USB GPIO device with some 3rd party drivers that I want to interface with in a container. Compiles, works fine on host. Also compiles, works fine in the container if I pass --device=/dev/bus/usb/001/$NUM where $NUM is the autogenerated path…
DeusXMachina
  • 1,239
  • 1
  • 18
  • 26
5
votes
1 answer

udev rules attrs regular expression acceptation

I am trying to include an udev rule to create a customized /dev/ entry depending on usb device attribute. I have two different bar code scanner which have the word Bar code Scanner and Barcode Scanner into manufacturer attrs. So I am wondering if…
meetnick
  • 1,196
  • 2
  • 12
  • 28
5
votes
2 answers

What's the udev-like thing on OSX and how does it work?

If I plug a USB-serial adapter into my Mac, a new device shows up in /dev, such as /dev/tty.usbmodem1421 or /dev/tty.usbserial-A7048O1O. If this were Linux, I'd be looking for an udev rule that explains where the device name came from, and why it…
Johannes Ernst
  • 3,072
  • 3
  • 42
  • 56
5
votes
0 answers

udev .rules file run as local per user?

I have my code that will run every time udev detects new usb. My code works fine when I run it as a local user. But It fails when I use udev.rules file because it runs my script as root. How can I run ".rules" as a local user?
Bonn
  • 183
  • 14