udev

Can udev rules create new device properties?

Can udev rules create new device properties? I wrote a udev rule to create a property in /etc/udev/rules.d/99-backlight-scale.rules: ACTION=="add", KERNEL=="amdgpu_bl1", SUBSYSTEM=="backlight", DEVPATH=="/devices/pci0000:00/0000:00:08.1/0000:03:00.0/drm/card1/card1-eDP-1/amdgpu_bl1", ENV{GSD_BACKLIGHT_SCALE}="non-linear" udevadm test /sys/class/backlight/amdgpu_bl1 says that the property should be created. DEVPATH=/devices/pci0000:00/0000:00:08.1/0000:03:00.0/drm/card1/card1-eDP-1/amdgpu_bl1 ACTION=add SUBSYSTEM=backlight TAGS=:seat:systemd: CURRENT_TAGS=:seat:systemd: ID_PATH=pci-0000:03:00.0 ID_PATH_TAG=pci-0000_03_00_0 ID_FOR_SEAT=backlight-pci-0000_03_00_0 GSD_BACKLIGHT_SCALE=non-linear SYSTEMD_WANTS=systemd-backlight@backlight:amdgpu_bl1.service USEC_INITIALIZED=23289223 Unload kernel module index. Unloaded link configuration context. But the property …

Total answers: 2

Hidraw udev rule group sometimes failes

Hidraw udev rule group sometimes failes I have troubles with a sensor that acts as a hidraw device to send periodic data through USB. I have a Udev rule that creates a symlink to be used by docker container with Azure IoT Edge. SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="e025", SYMLINK+="temper" MODE="0660" Thing is, usually, after some time (may …

Total answers: 1

Why am I not allowed to access files in /usr/bin/?

Why am I not allowed to access files in /usr/bin/? I have this machine. I am the sole user of the machine. I cannot access files in /usr/bin/ because of a location issue with /usr/lib/python3/dist-packages/printrun/ and am currently receiving errors. What would be a couple of reasons why I have no permissions for /usr/bin/ on …

Total answers: 1

Run kpartx on system start

Run kpartx on system start I’m trying to detect and run partitions on top of jMicron fakeRAID, which is discovered by dmraid. How far I’m stuck with making this automatically during boot. hopungo@hopungo-pc:~$ sudo kpartx -l /dev/mapper/jmicron_GRAID jmicron_GRAID1 : 0 7813722112 /dev/mapper/jmicron_GRAID 2048 Here is a good known solution from year 2010, but it is …

Total answers: 2

Run display dependent command in a system setting event

Run display dependent command in a system setting event I am working on a systemd/udev setting that I would like to share upstream, however I can’t get it to work in a non-hacky way. Essentially, I have this script as the exec of a systemd service: ICON="somepath/dslr-camera-white.png" function on-display() { local sdisplay=$(echo $XDG_SESSION_TYPE) if [ …

Total answers: 1

Map usb devices to static addresses on boot

Map usb devices to static addresses on boot I have a couple of USB devices connected to my computer: An FT232 based USB-UART converter : Used to send and receive data between a microcontroller and the computer using the Serial protocol. A YDLidar TG15 : Used for mapping the environment. Product Page I am running …

Total answers: 1

Problems adding rules.d rule for unit with multiple tty devices

Problems adding rules.d rule for unit with multiple tty devices I want to add a rule under /etc/udev/rules.d for a Texas Instruments CC1352P-2 development board. On my Ubuntu server it creates two ttyACM devices: crw-rw-rw- 1 root dialout 166, 1 Sep 28 10:37 /dev/ttyACM1 crw-rw-rw- 1 root dialout 166, 2 Sep 28 07:28 /dev/ttyACM2 And …

Total answers: 1

UDev rule for removing device not triggered

UDev rule for removing device not triggered I am having a monitor with an integrated USB hub (and a physical power-switch) attached to my pi and want to execute two different scripts, when the monitor is turned on and off. The first part for turning the monitor on is working fine, but when turning it …

Total answers: 1

What's the reason to add a symlink to /dev directory with udev rules?

What's the reason to add a symlink to /dev directory with udev rules? I understand that you can write custom udev rules to create a symlink in /dev directory. But what is the use of having a symlink in /dev? What is the symlink linking to? I know you can interact with regular links in …

Total answers: 1

Is it safe to use /dev/disk/by-id/ instead of /dev/sda?

Is it safe to use /dev/disk/by-id/ instead of /dev/sda? I am currently using a simple way to back up the drive dd if=/dev/sda of=/dev/sdb. However, before each operation, I have to check fdisk -l to see if sda and sdb have been swapped during boot. This is quite inconvenient and error prone. Is using symbolic …

Total answers: 1

nut usbhid-ups loosing connection after some time

nut usbhid-ups loosing connection after some time I have a CyperPower OR500LCDRM1U connected via USB to nut on Debian (proxmox). After some time (hours?), the connection to UPS is lost. Extremely frustrating because UPS is a critical component. It might be that USB reinitializes, temporarily device becomes unavailable for a few seconds or similar. I …

Total answers: 1

udev makes duplicate /dev/disk/by-id symlinks for nvme drives & partitions

udev makes duplicate /dev/disk/by-id symlinks for nvme drives & partitions Recently, I noticed that there were extra symlinks in /dev/disk/by-id for my NVME drives, with the duplicates having the same name with _1 appended. # ls -lF /dev/disk/by-id/nvme-Samsung_SSD_970_EVO_500GB_S466XXXXXXXXXXW{,_1} lrwxrwxrwx 1 root root 13 Jul 29 19:22 /dev/disk/by-id/nvme-Samsung_SSD_970_EVO_500GB_S466XXXXXXXXXXW -> ../../nvme0n1 lrwxrwxrwx 1 root root 13 Jul …

Total answers: 1

Accidentally deleted /dev directory

Accidentally deleted /dev directory I’ve accidentally performed sudo rm -fr /dev Will I suffer from data loss or any side effects? I’ve rebooted the system and my data seems ok, but I’m afraid there is hidden or non-obvious loss of data that I simply haven’t found out yet. EDIT: I’ve read this post but didn’t …

Total answers: 1

How to mount a particular USB drive read-only

How to mount a particular USB drive read-only I have a requirement to mount certain USB drives read-only – not every drive, just those containing archived data. I want to prevent accidental or malicious changes. There has been much written about udev and it seems to be possible, but my rules don’t appear to be …

Total answers: 1

udev: hwclock set fail?

udev: hwclock set fail? There is a file in "/usr/lib/udev/hwclock-set": It shall set the correct date/time from RTC however it has a barrier: if [ -e /run/systemd/system ] ; then exit 0 fi /shin/hwclock …. Now, when udev runs the hwclock rules, the above folder is already existing so the script will exit, without setting …

Total answers: 1

Is udev also a pseudo-filesystem type?

Is udev also a pseudo-filesystem type? On an embedded device running GNU/Linux with a custom BSP, when I type df /dev in Filesystem column I get devtmpfs ps -A | grep udev gives 224 ? 00:00:00 systemd-udevd In a PC running Ubuntu 22.04, the same commands give udev and 744 ? 00:00:02 systemd-udevd respectively. My …

Total answers: 1