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

477 questions
6
votes
1 answer

How does polling a file for changes work?

The problem I expected the script below to print at most one event and then stop (it's written only to illustrate the problem). #!/usr/bin/env python from select import poll, POLLIN filename = "test.tmp" # make sure file exists open(filename,…
Lauritz V. Thaulow
  • 41,893
  • 11
  • 64
  • 87
6
votes
0 answers

udev not capturing information (lot of missing attributes) for usb device

I have two systems, one running Ubutu 14.04, one running raspbian. When I connect a usb printer to my Ubuntu machine I can can get lots of information about from udevadm: :~$ udevadm info -q property --export -n /dev/usb/lp2 …
preston.m.price
  • 606
  • 1
  • 8
  • 17
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
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
  • 7,653
  • 7
  • 43
  • 56
6
votes
2 answers

Need more than 32 USB sound cards on my system

I'm working on an educative multiseat project where we need to connect 36 keyboards and 36 USB sound cards to a single computer. We're running Ubuntu Linux 12.04 with the 3.6.3-030603-generic kernel. So far we've managed to get the input from the 36…
picheto
  • 319
  • 2
  • 10
6
votes
1 answer

add udev rule for external display

I wrote a small shell script configuring attached external displays with xrandr. # cat /home/didi/bin/monitor_autoswitcher.sh #!/bin/bash xrandr | grep "HDMI1 connected" if [[ $? == 0 ]]; then # is connected xrandr --output HDMI1 --right-of…
didi_X8
  • 4,778
  • 9
  • 39
  • 45
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.
  • 2,987
  • 1
  • 24
  • 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,190
  • 3
  • 33
  • 55
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
  • 11,022
  • 11
  • 47
  • 77
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
  • 20,410
  • 12
  • 66
  • 110
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
  • 799
  • 5
  • 13
5
votes
0 answers

Udev rule with ACTION=="add" not being triggered when device is already connected at boot

Here is my simple udev rule: ACTION=="add",SUBSYSTEM=="usb",DEVPATH=="/devices/pci0000:00/0000:00:14.0/usb3/3-13",RUN+="/opt/usb-libvirt-hotplug/usb-libvirt-hotplug.sh…
Vain
  • 120
  • 1
  • 9
5
votes
3 answers

udevadm does not show all attributes inside a docker container

When I run docker container and list properties of some device with udevadm inside the container, there are only the basic information about the device. When I do the same thing on host, I can see much more. What can I do to get all the information…
pallly
  • 557
  • 4
  • 13
5
votes
2 answers

Why don't my udev rules work inside of a running docker container?

I have udev rules written to create SYMLINKS when a device is connected. The rules are working fine on the host machine, but when I start a container with these same rules installed in /etc/udev/rules.d, they don't work inside my container. I am…
Ryan
  • 3,595
  • 3
  • 26
  • 31
5
votes
2 answers

udev rule with few parent device attributes

I need complex and universal udev rule to determine USB-device plugged in certain port of the any USB hub. so, i have to combine parent attributes of different layers of the device tree... I have this: $udevadm info --query=all --name=/dev/ttyUSB0…
EDkan
  • 492
  • 3
  • 10
1 2
3
31 32