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

udev/Bash script to get usb info

I have written a udev rule that call a script to send email when a usb drive is attached/removed. so far its working fine. following is my udev rule and send email script: SUBSYSTEM=="usb", ACTION=="add", RUN+="/u/usb_added %b" SUBSYSTEM=="usb",…
user115079
  • 711
  • 1
  • 11
  • 23
-1
votes
1 answer

Creating a new directory in /dev using udev rule

This is the code snippet responsible for creating the device: master_dev = device_create(dev_cl, NULL, MKDEV(major, minor), NULL, "synchmess"); My udev rule is the following: KERNEL=="synchmess", NAME="/synch/synchmess", MODE="0444" From my…
GiuDaquan
  • 13
  • 3
-1
votes
1 answer

Blocking USB HID in Linux

I'm programming a kioks device and i want to block all usb devices expect 2 kind of usb.One is my touch screen hid usb and the other one is usb storage devices.Actually i tried write rules under udev.I tried this code : ACTION=="add",…
-1
votes
1 answer

systemd-udev rule applied multiple times (twice in my case)

I have udev rule with the following content: DRIVERS=="adt7310", RUN+="/bin/ln -s /sys//devices/platform/soc/fff00000.spi/spi_master/spi0/spi0.0/temp1_input /dev/temperature_adt" The problem is that this rule is applied twice and in the log…
Georgi
  • 53
  • 2
  • 7
-1
votes
1 answer

Getting symlink name of ttyUSB device in Qt

I'm stuck with a problem concerning udev symlink property. I just set udev rules so that my TTL-232R USB device has a symlink name. However, I don't know how to extract this symlink name on my Qt project (which is actually not originally mine but…
Robin
  • 1
-1
votes
1 answer

udev cdrom rules failing to run scripts

The following is my rules file in /etc/udev/rules.d/10-autodvd.rules SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM_MEDIA_DVD}=="1", ACTION=="change", RUN+="/usr/local/bin/makemkv.sh sr0" SUBSYSTEM=="block", KERNEL=="sr1",…
whoopn
  • 91
  • 1
  • 2
  • 7
-1
votes
1 answer

Udev rules do not work on fedora 24

I am trying to execute a script when a usb is plug in on fedora 24 automatically. I've found a lot of information about how to do this one on old versions. However, in Fedora 25 it does not work. This is what i do: I have created a file in…
-1
votes
2 answers

Trying to mount a usb partition in Linux using a cpp program

I want to detect a usb connection and mount its corresponding partition. I tried using udev.I was able to find device in /dev/bus/usb/001 or/002.But from this I cannot find which partition it uses. So using udev I searched for block partitions and…
rjmrohit
  • 11
  • 4
-1
votes
1 answer

Execute script in new terminal window on hard drive plugging

I would like to execute a backup script with rsync everytime a specific hard drive is plugged to my computer on ubuntu 16.04. However I would like the user to be prompted if the backup should run or not and then he should be able to see the rsync…
Louis M
  • 4,036
  • 4
  • 21
  • 25
-1
votes
1 answer

Virtual file for AES/SHA1 kernel side computing

Is there a file (in /dev perhaps) that allows me to compute AES or SHA1 on data? There are analogs like /dev/urandom /dev/zero etc. It would work like this: open said file, write data to it and read results out of it. Using sendfile syscall would be…
ArekBulski
  • 4,520
  • 4
  • 39
  • 61
-1
votes
2 answers

Run linux program when two specific USB devices are connected

There are perhaps 1000 or more web resources that explain how one can run an application when a USB device is connected. What I'm looking for is a technique that qualifies an action on two specific devices being present (they can be connected in…
5nh
  • 27
  • 3
-1
votes
2 answers

Force unmount of usb drive by closing open applications programatically

When I unplug the AC adapter from my laptop I want all USB drives to automatically unmount. If applications are open that block the device, they should be killed. Once everything is killed and unmount a signal tone could be plaid to indicate that…
overflower
  • 17
  • 5
-1
votes
1 answer

udevadm/persistent USB names not working (permission error)

I have 2 identical Bluetooth receivers attached to a Raspberry Pi that I need to monitor Bluetooth signals at different parts of a room. Unfortunately, the 2 devices have the same idVendor and idProduct so I have resorted to using the ATTR{serial}…
sensei247
  • 25
  • 5
-1
votes
1 answer

bash script to stop certain idVendor from mounting

I wanted to write a bash script to stop certain idVendors from mounting, my thought was to use tail -f /var/log/messages and greping it to idVendor and blocking that certain vendor upon detection, can someone help me on this please?
mike
  • 11
-1
votes
1 answer

Running fsck with other program and UDEV in bash

After much trouble I got the UDEV rule to run after inserting an USB. It runs a program to convert the names of pictures and movies. I use {} & to run the program in the background: The only thing is that by unplugging the usb it is easy corrupted.…
Helfenstein
  • 315
  • 1
  • 4
  • 13
1 2 3
34
35