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
3
votes
1 answer

How to enumerate USB devices *and* read/write to them?

There is a custom USB device I need to communicate with. There is no particular driver for it. The device doesn't show as /dev/tty*. I found out how I can use libudev to enumerate the USB devices and let's say I manage to get the corresponding…
Shahbaz
  • 46,337
  • 19
  • 116
  • 182
3
votes
1 answer

Setting Environment Variables from UDEV

I have a few different devices which all accomplish the same basic task. I would like to be able to swap them, and regardless of which one is plugged in, have the same symlink. For example, if I have device1, device2, and device3 and I plug one in…
RoboCop87
  • 825
  • 1
  • 8
  • 21
3
votes
1 answer

Linux libudev test application not receiving REMOVE events

I am creating a test application for a new platform that we are working on to test libudev and make sure our C application will be able to be properly notified when a particular usb device is inserted or removed. On our system every time this device…
Chimera
  • 5,884
  • 7
  • 49
  • 81
3
votes
1 answer

How do I use udev to find info about inserted video media (e.g. DVDs)

I'm trying to port an application from using HAL to using pure udev. It is written in python and will use the gudev library, though I would love to see examples in any language. I'm able to get all attached video devices (such as cameras)…
Daniel
  • 8,212
  • 2
  • 43
  • 36
3
votes
3 answers

PyGame Re-Initialize USB MIDI Device on Reconnect

I'm using PyGame to read a USB MIDI device, very similar to what is used here, except I run it as a background service on a Raspberry Pi. I would like to be able to disconnect and reconnect the MIDI device, and still be able to read it. I have tried…
cwshep
  • 31
  • 3
3
votes
1 answer

Parameter from udev rule not passing into perl script

I'm trying to create a udev rule that hides block devices (i.e usb drives) with a size less than 64 GB The rule looks like this: BUS=="usb", SUBSYSTEM=="block", ACTION=="add", PROGRAM="/data/diskSizeCheck.pl %k", RESULT!="ok",…
bomberblue
  • 91
  • 1
  • 6
3
votes
3 answers

Which udev rules get executed for USB device?

I am new to udev. I need to see which rules are executed for USB device plugged in to linux machine. Is there any logging provided by udev?
user3345390
  • 421
  • 2
  • 6
  • 14
3
votes
1 answer

Is udev thread-safe?

I'd like to know if there are dangers with spawning multiple threads that each create their own udev context and start monitoring hardware changes. It would think that if each thread has its own udev context everything is fine. However, if calls…
StackedCrooked
  • 34,653
  • 44
  • 154
  • 278
3
votes
3 answers

How unique is /dev/serial/by-id

So, the question is, is the content of /dev/serial/by-id unique? Essentially the issue is I want to connect several (two or more) arduinos (potentially of different types, but they may all end up being leonardos) to the Raspberry Pi for the purposes…
jvc26
  • 6,363
  • 6
  • 46
  • 75
3
votes
0 answers

Change default permission of device files

I have written my gpio driver and register it with the system using udev. This created all my device files but the permission they are created is 600. how can I change this default permission to 666 or any other. Since I have to run my program…
RootPhoenix
  • 1,626
  • 1
  • 22
  • 40
3
votes
5 answers

Udev rules are not working for libusb on Ubuntu 12.04

I'm on Ubuntu 12.04.5 LTS, x86_64. I've a usb device that uses libusb to communicate with the computer. Once I plug it into the computer and run the communication program I get the following error: libusb couldn't open USB device…
linello
  • 8,451
  • 18
  • 63
  • 109
3
votes
1 answer

How to stop automatic Linux device initialization

Whenever I plug an USB mass storage device into the system, I get uevents like these from the kernel. (as shown by udevadm monitor) KERNEL[104397.739313] add /devices/pci0000:00/0000:00:14.0/usb3/3-6 (usb) KERNEL[104397.740141] add …
hotmultimedia
  • 86
  • 1
  • 6
3
votes
0 answers

libudev monitor, filtering on KERNEL

in real-time I want to print out hot-plugging events on Harddisks only. My code does print out all events for the correct "devtype"("disk") and "subsystem"("block"). However this includes devices I don`t care about such as loop devices, cdrom…
user2882307
3
votes
1 answer

how uevents get triggered in kernel

uevents has been sent from kernel space to user space through netlink socket. In kernel, there must be something trigger uevent. I guess there are two possibilities: Hardware interrupt - this means, once hardware interruption happened, kernel…
Sam
  • 4,521
  • 13
  • 46
  • 81
3
votes
1 answer

Enumerate USB flash drives programatically using libudev in Linux

How can I programmatically enumerate all the USB flash drives using libudev under Linux? I want to get the strings such as '/dev/sdb4' so that I can then use 'mount()' to mount them. I was following the libudev example at…
Wang Tuma
  • 893
  • 5
  • 14
  • 24