Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
1
answers
2045
views
Where does udev get the model and vendor strings?
I am creating a udev rule which simply logs the usb storage devices. I have a usb flash disc with `ID_MODEL_ID==1234` and `ID_VENDOR_ID==abcd`. `udev` shows that this is: ID_MODEL=UDisk ID_VENDOR=General But I don't get where it gets this information. According to what I see in `usb.ids` of latest `...
I am creating a udev rule which simply logs the usb storage devices. I have a usb flash disc with
ID_MODEL_ID==1234
and ID_VENDOR_ID==abcd
. udev
shows that this is:
ID_MODEL=UDisk
ID_VENDOR=General
But I don't get where it gets this information.
According to what I see in usb.ids
of latest hwdata
:
$ cat /usr/share/hwdata/usb.ids | grep abcd
abcd Unknown
$ cat /usr/share/hwdata/usb.ids | grep 1234
1234 IronLogic RFID Adapter [Z-2 USB]
1234 Bluetooth Device
1234 Typhoon Redfun Modem V90 56k
1234 Flash Drive
1234 Cruzer Mini Flash Drive
1234 USB to ATAPI
1234 BACKPACK
1234 Storage Device
1234 Fastrack Xtend FXT001 Modem
1234 Brain Actuated Technologies
1234 PDS6062T Oscilloscope
1234 ATAPI Bridge
1234 Prototype Reader/Writer
My goal is to simply log ID_VENDOR_ID
and ID_MODEL_ID
instead of strings ID_VENDOR
and ID_MODEL
and to get these strings later when I need by looking up the hwdata
's usb.ids file. It seems to me that udev
gets these strings from somewhere else but where?
VP.
(111 rep)
May 25, 2018, 07:31 AM
• Last activity: Aug 5, 2025, 09:04 PM
5
votes
2
answers
2849
views
Mapping mouse buttons with udev hwdb
Following this guide: http://www.vxnick.com/blog/2014/10/binding-extra-mouse-buttons-on-linux/ I've set up a config file: $ lsusb | grep G500 Bus 006 Device 007: ID 046d:c068 Logitech, Inc. G500 Laser Mouse $ cat /etc/udev/hwdb.d/70-g500.hwdb keyboard:usb:v046DpC068* KEYBOARD_KEY_90009=9 KEYBOARD_KE...
Following this guide: http://www.vxnick.com/blog/2014/10/binding-extra-mouse-buttons-on-linux/
I've set up a config file:
$ lsusb | grep G500
Bus 006 Device 007: ID 046d:c068 Logitech, Inc. G500 Laser Mouse
$ cat /etc/udev/hwdb.d/70-g500.hwdb
keyboard:usb:v046DpC068*
KEYBOARD_KEY_90009=9
KEYBOARD_KEY_9000a=8
KEYBOARD_KEY_90006=0
Based on the following
evtest
output:
Event: time 1422711060.272136, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90009
Event: time 1422711060.272136, type 1 (EV_KEY), code 280 (?), value 1
Event: time 1422711060.272136, -------------- EV_SYN ------------
Event: time 1422711060.432134, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90009
Event: time 1422711060.432134, type 1 (EV_KEY), code 280 (?), value 0
Event: time 1422711060.432134, -------------- EV_SYN ------------
Event: time 1422711061.461191, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9000a
Event: time 1422711061.461191, type 1 (EV_KEY), code 281 (?), value 1
Event: time 1422711061.461191, -------------- EV_SYN ------------
Event: time 1422711061.628125, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9000a
Event: time 1422711061.628125, type 1 (EV_KEY), code 281 (?), value 0
Event: time 1422711061.628125, -------------- EV_SYN ------------
Event: time 1422711062.725119, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90006
Event: time 1422711062.725119, type 1 (EV_KEY), code 277 (BTN_FORWARD), value 1
Event: time 1422711062.725119, -------------- EV_SYN ------------
Event: time 1422711062.902137, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90006
Event: time 1422711062.902137, type 1 (EV_KEY), code 277 (BTN_FORWARD), value 0
And yet I get no keypresses (Or change in evtest
output) when I'm done.
(Yes I've done udevadm
hwdb --update
/trigger
)
J V
(283 rep)
Jan 31, 2015, 02:00 PM
• Last activity: Jul 29, 2025, 01:16 PM
2
votes
1
answers
2693
views
udev rule not working on Raspberry Pi 3
I'm trying to separate some keyboards so they're not read by Qt on a Raspberry Pi. I'm using a `udev` rule to do so, but it doesn't seem to be working. I'm trying to direct `/dev/input/event3` into `/dev/input/ccreader` and `/dev/input/event4` into `/dev/input/barcode`. Could anyone point me in the...
I'm trying to separate some keyboards so they're not read by Qt on a Raspberry Pi. I'm using a
udev
rule to do so, but it doesn't seem to be working. I'm trying to direct /dev/input/event3
into /dev/input/ccreader
and /dev/input/event4
into /dev/input/barcode
. Could anyone point me in the right direction? I'll post all info below:
Contents of /etc/udev/rules.d/99-com.rules (IMPORTANT 2 AT TOP):
KERNEL=="event*", ATTRS{idVendor}=="0801", ATTRS{idProduct}=="0001", MODE:="0660", NAME:="input/ccreader%n"
KERNEL=="event*", ATTRS{idVendor}=="05fe", ATTRS{idProduct}=="1010", MODE:="0660", NAME:="input/barcode%n"
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"
KERNEL=="ttyAMA", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
echo 0;\
elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi\
'", SYMLINK+="serial%c"
KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
echo 0; \
elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi \
'", SYMLINK+="serial%c"
*****************************************************************
# udevadm info --attribute-walk --name /dev/input/event4
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:0801:0001.0005/input/input4/event4':
KERNEL=="event4"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:0801:0001.0005/input/input4':
KERNELS=="input4"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRS{name}=="HID 0801:0001"
ATTRS{phys}=="usb-3f980000.usb-1.4/input0"
ATTRS{uniq}==""
ATTRS{properties}=="0"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:0801:0001.0005':
KERNELS=="0003:0801:0001.0005"
SUBSYSTEMS=="hid"
DRIVERS=="hid-generic"
ATTRS{country}=="00"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0':
KERNELS=="1-1.4:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="usbhid"
ATTRS{bInterfaceClass}=="03"
ATTRS{bInterfaceSubClass}=="01"
ATTRS{bInterfaceProtocol}=="01"
ATTRS{bNumEndpoints}=="01"
ATTRS{authorized}=="1"
ATTRS{supports_autosuspend}=="1"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceNumber}=="00"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4':
KERNELS=="1-1.4"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devpath}=="1.4"
ATTRS{idVendor}=="0801"
ATTRS{speed}=="12"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{busnum}=="1"
ATTRS{devnum}=="6"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="100mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="80"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="0"
ATTRS{bcdDevice}=="0100"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 1.10"
ATTRS{urbnum}=="40"
ATTRS{ltm_capable}=="no"
ATTRS{removable}=="removable"
ATTRS{idProduct}=="0001"
ATTRS{bDeviceClass}=="00"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1':
KERNELS=="1-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="02"
ATTRS{devpath}=="1"
ATTRS{idVendor}=="0424"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{busnum}=="1"
ATTRS{devnum}=="2"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="2mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="5"
ATTRS{bcdDevice}=="0200"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="72"
ATTRS{ltm_capable}=="no"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="9514"
ATTRS{bDeviceClass}=="09"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1':
KERNELS=="usb1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="01"
ATTRS{devpath}=="0"
ATTRS{idVendor}=="1d6b"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{authorized_default}=="1"
ATTRS{busnum}=="1"
ATTRS{devnum}=="1"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="0mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="1"
ATTRS{interface_authorized_default}=="1"
ATTRS{bcdDevice}=="0404"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="3f980000.usb"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="26"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 4.4.26-v7+ dwc_otg_hcd"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0002"
ATTRS{bDeviceClass}=="09"
ATTRS{product}=="DWC OTG Controller"
looking at parent device '/devices/platform/soc/3f980000.usb':
KERNELS=="3f980000.usb"
SUBSYSTEMS=="platform"
DRIVERS=="dwc_otg"
ATTRS{hnp}=="HstNegScs = 0x0"
ATTRS{srp}=="SesReqScs = 0x1"
ATTRS{regvalue}=="invalid offset"
ATTRS{hsic_connect}=="HSIC Connect = 0x1"
ATTRS{guid}=="GUID = 0x2708a000"
ATTRS{mode}=="Mode = 0x1"
ATTRS{srpcapable}=="SRPCapable = 0x1"
ATTRS{regdump}=="Register Dump"
ATTRS{gpvndctl}=="GPVNDCTL = 0x00000000"
ATTRS{ggpio}=="GGPIO = 0x00000000"
ATTRS{hprt0}=="HPRT0 = 0x00001005"
ATTRS{wr_reg_test}=="Time to write GNPTXFSIZ reg 10000000 times: 380 msecs (38 jiffies)"
ATTRS{driver_override}=="(null)"
ATTRS{hcd_frrem}=="HCD Dump Frame Remaining"
ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0"
ATTRS{gnptxfsiz}=="GNPTXFSIZ = 0x01000306"
ATTRS{remote_wakeup}=="Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0"
ATTRS{busconnected}=="Bus Connected = 0x1"
ATTRS{hcddump}=="HCD Dump"
ATTRS{gotgctl}=="GOTGCTL = 0x001c0001"
ATTRS{spramdump}=="SPRAM Dump"
ATTRS{grxfsiz}=="GRXFSIZ = 0x00000306"
ATTRS{gsnpsid}=="GSNPSID = 0x4f54280a"
ATTRS{gusbcfg}=="GUSBCFG = 0x20001700"
ATTRS{hptxfsiz}=="HPTXFSIZ = 0x02000406"
ATTRS{devspeed}=="Device Speed = 0x0"
ATTRS{fr_interval}=="Frame Interval = 0x1d4c"
ATTRS{rem_wakeup_pwrdn}==""
ATTRS{bussuspend}=="Bus Suspend = 0x0"
ATTRS{buspower}=="Bus Power = 0x1"
ATTRS{hnpcapable}=="HNPCapable = 0x1"
ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 940 msecs (94 jiffies)"
ATTRS{enumspeed}=="Device Enumeration Speed = 0x1"
ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0"
ATTRS{regoffset}=="0xffffffff"
looking at parent device '/devices/platform/soc':
KERNELS=="soc"
SUBSYSTEMS=="platform"
DRIVERS==""
ATTRS{driver_override}=="(null)"
looking at parent device '/devices/platform':
KERNELS=="platform"
SUBSYSTEMS==""
DRIVERS==""
********************************************************
# udevadm info --attribute-walk --name /dev/input/event3
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:05FE:1010.0004/input/input3/event3':
KERNEL=="event3"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:05FE:1010.0004/input/input3':
KERNELS=="input3"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRS{name}=="WIT Electron Company WIT 122-UFS V7.03"
ATTRS{phys}=="usb-3f980000.usb-1.3/input0"
ATTRS{uniq}==""
ATTRS{properties}=="0"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:05FE:1010.0004':
KERNELS=="0003:05FE:1010.0004"
SUBSYSTEMS=="hid"
DRIVERS=="hid-generic"
ATTRS{country}=="21"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0':
KERNELS=="1-1.3:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="usbhid"
ATTRS{bInterfaceClass}=="03"
ATTRS{bInterfaceSubClass}=="01"
ATTRS{bInterfaceProtocol}=="01"
ATTRS{bNumEndpoints}=="01"
ATTRS{authorized}=="1"
ATTRS{supports_autosuspend}=="1"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceNumber}=="00"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3':
KERNELS=="1-1.3"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devpath}=="1.3"
ATTRS{idVendor}=="05fe"
ATTRS{speed}=="1.5"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{busnum}=="1"
ATTRS{devnum}=="5"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="500mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="a0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="0"
ATTRS{bcdDevice}=="0001"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 1.10"
ATTRS{urbnum}=="13"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="WIT Electron Company"
ATTRS{removable}=="removable"
ATTRS{idProduct}=="1010"
ATTRS{bDeviceClass}=="00"
ATTRS{product}=="WIT 122-UFS V7.03"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1':
KERNELS=="1-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="02"
ATTRS{devpath}=="1"
ATTRS{idVendor}=="0424"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{busnum}=="1"
ATTRS{devnum}=="2"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="2mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="5"
ATTRS{bcdDevice}=="0200"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="72"
ATTRS{ltm_capable}=="no"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="9514"
ATTRS{bDeviceClass}=="09"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1':
KERNELS=="usb1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="01"
ATTRS{devpath}=="0"
ATTRS{idVendor}=="1d6b"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{authorized_default}=="1"
ATTRS{busnum}=="1"
ATTRS{devnum}=="1"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="0mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="1"
ATTRS{interface_authorized_default}=="1"
ATTRS{bcdDevice}=="0404"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="3f980000.usb"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="26"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 4.4.26-v7+ dwc_otg_hcd"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0002"
ATTRS{bDeviceClass}=="09"
ATTRS{product}=="DWC OTG Controller"
looking at parent device '/devices/platform/soc/3f980000.usb':
KERNELS=="3f980000.usb"
SUBSYSTEMS=="platform"
DRIVERS=="dwc_otg"
ATTRS{hnp}=="HstNegScs = 0x0"
ATTRS{srp}=="SesReqScs = 0x1"
ATTRS{regvalue}=="invalid offset"
ATTRS{hsic_connect}=="HSIC Connect = 0x1"
ATTRS{guid}=="GUID = 0x2708a000"
ATTRS{mode}=="Mode = 0x1"
ATTRS{srpcapable}=="SRPCapable = 0x1"
ATTRS{regdump}=="Register Dump"
ATTRS{gpvndctl}=="GPVNDCTL = 0x00000000"
ATTRS{ggpio}=="GGPIO = 0x00000000"
ATTRS{hprt0}=="HPRT0 = 0x00001005"
ATTRS{wr_reg_test}=="Time to write GNPTXFSIZ reg 10000000 times: 360 msecs (36 jiffies)"
ATTRS{driver_override}=="(null)"
ATTRS{hcd_frrem}=="HCD Dump Frame Remaining"
ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0"
ATTRS{gnptxfsiz}=="GNPTXFSIZ = 0x01000306"
ATTRS{remote_wakeup}=="Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0"
ATTRS{busconnected}=="Bus Connected = 0x1"
ATTRS{hcddump}=="HCD Dump"
ATTRS{gotgctl}=="GOTGCTL = 0x001c0001"
ATTRS{spramdump}=="SPRAM Dump"
ATTRS{grxfsiz}=="GRXFSIZ = 0x00000306"
ATTRS{gsnpsid}=="GSNPSID = 0x4f54280a"
ATTRS{gusbcfg}=="GUSBCFG = 0x20001700"
ATTRS{hptxfsiz}=="HPTXFSIZ = 0x02000406"
ATTRS{devspeed}=="Device Speed = 0x0"
ATTRS{fr_interval}=="Frame Interval = 0x1d4c"
ATTRS{rem_wakeup_pwrdn}==""
ATTRS{bussuspend}=="Bus Suspend = 0x0"
ATTRS{buspower}=="Bus Power = 0x1"
ATTRS{hnpcapable}=="HNPCapable = 0x1"
ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 920 msecs (92 jiffies)"
ATTRS{enumspeed}=="Device Enumeration Speed = 0x1"
ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0"
ATTRS{regoffset}=="0xffffffff"
looking at parent device '/devices/platform/soc':
KERNELS=="soc"
SUBSYSTEMS=="platform"
DRIVERS==""
ATTRS{driver_override}=="(null)"
looking at parent device '/devices/platform':
KERNELS=="platform"
SUBSYSTEMS==""
DRIVERS==""
Nick
(121 rep)
Feb 18, 2017, 02:11 PM
• Last activity: Jul 27, 2025, 06:03 PM
12
votes
1
answers
1003
views
How to force drives to be on a predictable device name
I have a computer, running Debian 12, that is equipped with 2 RDX (from dead Tandberg / Overland company) cartridge drives. One is an internal SATA, and one is an external USB. They are cartridge drives. That means that they can be without a cartridge inserted. Maybe because of that, the drives are...
I have a computer, running Debian 12, that is equipped with 2 RDX (from dead Tandberg / Overland company) cartridge drives. One is an internal SATA, and one is an external USB.
They are cartridge drives. That means that they can be without a cartridge inserted. Maybe because of that, the drives are not always assigned to the same device node.
For example, if both have a cartridge, the SATA one is on sdb, and the second on sdc. If the SATA is empty and I reboot, the drive will be sdb and the SATA on sdc. The device have been swapped. I want to be sure they will always be at the same device, regardless of the fact they have a drive inserted or not.
I guess I need to write a custom udev rule, but I am not sure on how to do so. I already have a udev rule to make it execute some action on drive cartridge insertion:
KERNEL=="sd[a-z][0-9]", SUBSYSTEMS=="usb", ATTRS{vendor}=="TANDBERG", ACTION=="add", RUN+="/bin/systemctl start rdx_mount@%k.service"
KERNEL=="sd[a-z][0-9]", SUBSYSTEMS=="scsi", ATTRS{vendor}=="TANDBERG", ACTION=="add", RUN+="/bin/systemctl start rdx_mount@%k.service"
KERNEL=="sd[a-z][0-9]", SUBSYSTEMS=="usb", ATTRS{vendor}=="TANDBERG", ACTION=="remove", RUN+="/bin/systemctl stop rdx_mount@%k.service"
KERNEL=="sd[a-z][0-9]", SUBSYSTEMS=="scsi", ATTRS{vendor}=="TANDBERG", ACTION=="remove", RUN+="/bin/systemctl stop rdx_mount@%k.service"
Keeping these rules working, how can I force each drive on a predictable device?
iXô
(327 rep)
Jul 19, 2025, 07:40 PM
• Last activity: Jul 25, 2025, 12:59 PM
1
votes
1
answers
3111
views
How to change default permission for usb devices filesystem
On Debian, when automounted, all files and directories in USB drives have 777 permissions. I don't like it very much. I know a bit of `udev` rules, and I think I could write a rule of mine to override the default behaviour. But I also would like to know which system rules are involved in this mechan...
On Debian, when automounted, all files and directories in USB drives have 777 permissions.
I don't like it very much. I know a bit of
udev
rules, and I think I could write a rule of mine to override the default behaviour.
But I also would like to know which system rules are involved in this mechanism, can you help me?
Daniele
(478 rep)
Apr 23, 2018, 02:13 PM
• Last activity: Jul 19, 2025, 07:05 PM
3
votes
2
answers
2268
views
How do I disable my CD/DVD drive?
I'd like to disable my CD/DVD drive so that it doesn't spin up every time I select Save in my Kate editor, or select a file-accessing action in other applications. The spinning up just delays what I'm doing, and I'm not even using the DVD drive. I want to leave the CD in the drive, and not have it s...
I'd like to disable my CD/DVD drive so that it doesn't spin up every time I select Save in my Kate editor, or select a file-accessing action in other applications. The spinning up just delays what I'm doing, and I'm not even using the DVD drive.
I want to leave the CD in the drive, and not have it spin up.
I found a website that said a udev rule will definitely disable the drive.
So far, I've tried the following 2 rules (separately), but neither of them disable the DVD drive (it still spins up - even when not mounted):
ENV{ID_SERIAL}=="PIONEER_DVD-RW_DVRTD11RS_SAC1009942", ENV{UDISKS_IGNORE}="1"
KERNEL=="sr0",ENV{UDISKS_IGNORE}="1", RUN+="/bin/touch /home/peter/udev-rule-ran"
The RUN+
in the second instance, creates my test file "udev-rule-ran", so this tells me that my rule file is being executed, and that the rule line is being run.
## My Question:
Could you tell me what I should be doing to definitely disable the darned DVD drive? I also want to be able to enable the drive again on the occasions that I need it.
## Supplementary Details:
I'm trying very hard to write a udev rule to disable my CD/DVD drive. I've tried various non-udev methods to disable it but none of them work.
There is no loaded module¹⁾ for the drive that I can unload, so I can't use that method to disable the drive.
*¹⁾ So I think the driver must be compiled into the kernel.*
dave
(31 rep)
Feb 5, 2017, 09:17 PM
• Last activity: Jul 17, 2025, 12:04 AM
1
votes
0
answers
28
views
systemd-logind: seat0 CanGraphical=yes despite untagging master-of-seat in 99- udev rule
Ubuntu 24.04 LTS, systemd 255 In a multiseat setup, I'm trying to set seat0 (Matrox DRM) to CanGraphical=no for TTY-only, but loginctl shows yes even after untagging master-of-seat in a 99- custom rule with minus-equal: ```SUBSYSTEM=="drm", ATTRS{vendor}=="0x102b", ATTRS{device}=="0x0533", ENV{ID_AU...
Ubuntu 24.04 LTS, systemd 255
In a multiseat setup, I'm trying to set seat0 (Matrox DRM) to CanGraphical=no for TTY-only, but loginctl shows yes even after untagging master-of-seat in a 99- custom rule with minus-equal:
=="drm", ATTRS{vendor}=="0x102b", ATTRS{device}=="0x0533", ENV{ID_AUTOSEAT}="0", ENV{ID_SEAT}="seat0", TAG+="seat", TAG-="master-of-seat", ENV{ID_FOR_SEAT}=""
Full udevadm test/loginctl output here .
udevadm test on the device shows master-of-seat not in CURRENT_TAGS (though in TAGS earlier) so I conclude my rule worked right. Why does CanGraphical remain yes? How to force no? I'm confused. Can somebody give me a hint?
trleith
(11 rep)
Jul 14, 2025, 12:17 PM
5
votes
1
answers
2287
views
linux udev rule to load gadget module for client driver
I'm having a hard time automating loading a gadget module and bringing up the usb0 device as a eth interface. The interface in question is g_ether for a embedded Linux device and connecting to a PC. I imagine there is a way to see the event from the plugin and run a script with udev. When I plug my...
I'm having a hard time automating loading a gadget module and bringing up the usb0 device as a eth interface. The interface in question is g_ether for a embedded Linux device and connecting to a PC.
I imagine there is a way to see the event from the plugin and run a script with udev. When I plug my device into a PC, I don't see any events. I tried different variations of udevadm monitor and I'm not sure how to find out what I can use as a udev rule to modprobe a gadget module.
Part of the reason I'm trying to load the otg module is because we are mostly using g_ether. I want to use avahi-autoipd but its getting an IP address before its plugged in. If I use allow-hotplug in the network interface it never automatically brings the interface up when its plugged in. So in theory, I want to plug in the device to a PC, run avahi-autoipd on the new network interface to retrieve an IP, and dhcpd to give one to the host.
Since someone else starting helping me in the stackoverflow (reposting here) I've got some more info.
/sys/bus/usb/devices$ ls
1-0:1.0 2-0:1.0 3-0:1.0 3-1 3-1:1.0 usb1 usb2 usb3
[ 4297.515400] g_ether gadget: high speed config #2: RNDIS
[ 4300.379021] g_ether gadget: high speed config #1: CDC Ethernet (ECM)
sys/bus/usb/devices$ ls
1-0:1.0 2-0:1.0 3-0:1.0 3-1 3-1:1.0 usb1 usb2 usb3
I've tried running
udevadm monitor --environment
udevadm monitor --environment --udev
udevadm monitor
udevadm monitor --kernel
udevadm monitor --kernel --udev
unplugging and plugging the device in doesn't show anything. The manpage says it "
Listens to the kernel uevents and events sent out by a udev rule" and I have no rules on my device. So I'm assuming that's probably why nothing prints out ever, even if I try to do some things with other hardware?
I'm running an embedded Linux distribution. I imagine I might not have everything a desktop has?
Its come to my attention I might have an issue with my g_ether module? These outputs never change.
cat /sys/class/net/usb0/carrier
cat: read error: Invalid argument
cat /sys/class/net/usb0/operstate
down
Kevin
(151 rep)
Apr 18, 2014, 09:14 PM
• Last activity: Jul 1, 2025, 10:02 PM
0
votes
1
answers
3755
views
Udev rules, need to obtain path like /dev/sda
I try to get the path of the last connected disk via an environment variable, i.e. a path like `/dev/sd*`. The problem is that DEVNAME or DEVPATH does not provide the desired path. The goal is to make `echo $...... > /var/.....` once the value is stored, and execute differents actions with RUN +=......
I try to get the path of the last connected disk via an environment variable, i.e. a path like
/dev/sd*
. The problem is that DEVNAME or DEVPATH does not provide the desired path.
The goal is to make echo $...... > /var/.....
once the value is stored, and execute differents actions with RUN +=... I get it out when I need it. I hope I was clear in my explanations, thank you
I'm trying to get the path of the current disk, in this case /dev/sd*
. I use udev rules to execute an action
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="/bin/device_added.sh" SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN+="/bin/device_removed.sh"
The problem is that when I retrieve with echo $KERNEL > my-file, I can't find the path of the current disk. I need this variable to execute smartctl commands from the disk that just arrived.
In device_added.sh the goal is to launch the smartctl -a /dev/sd*
command except that we replace /dev/sd*
by the last connected disk, so here is my problem now, I need to recover the path of the last connected disk/detected by udev
rules.
AnonymousREQUEST
(1 rep)
May 5, 2022, 08:29 AM
• Last activity: Jun 27, 2025, 06:01 PM
3
votes
1
answers
2209
views
How to avoid duplicate connection names? (32) Connection 'Auto Ethernet' is already active on enpXXX
Is there any way that I can make networkmanager to assign some unique names or device derrived name instead of `Auto Ethernet` so that we can avoid the names conflict? After I've upgraded to Ubuntu Vivid which uses systemd(though I'm not sure if it's directly related or it's just a bug / regression...
Is there any way that I can make networkmanager to assign some unique names or device derrived name instead of
Auto Ethernet
so that we can avoid the names conflict?
After I've upgraded to Ubuntu Vivid which uses systemd(though I'm not sure if it's directly related or it's just a bug / regression of network-manager) both of my mobile broadband devices get the "Auth Ethernet" name and are unable to get connected simultaneously.
I can temporarry fix it using nmcli con add type ethernet con-name my-office ifname ens3
but I would rather like to have network-manager handle this automatically (i.e. assign a random / unique conn name).
Use case:
I have two broadband USB devices and I need to connect to both of them. The issue is that NetworkManager displays them both as Auto Ethernet
(duplicate in the network manager applet) and when I try to connect to the second network it errors out `(32) Connection 'Auto Ethernet' is already active on enp0s20u
`.
When I try to "edit" the connections it displays only one Auto Ethernet
connection.
/etc/NetworkManager/system-connections
also lists only one Auto Ethernet
Anthony Hunt
(149 rep)
Jul 6, 2015, 06:13 AM
• Last activity: Jun 26, 2025, 04:01 AM
3
votes
1
answers
2306
views
udev rules assign same port name for a modem with 4 ttyUSB ports
I have a dlink DW-157 3g dongle. I am trying to assign the same port to the dongle everytime it boots up by modifying the udev rules file. Since the dongle on boot boots up as a storage media, I have to enter the command below to eject and mount for modem mode and then other command below it to make...
I have a dlink DW-157 3g dongle. I am trying to assign the same port to the dongle everytime it boots up by modifying the udev rules file. Since the dongle on boot boots up as a storage media, I have to enter the command below to eject and mount for modem mode and then other command below it to make use of the ttyUSB ports of the modem for running a dial up modem.
sudo eject /dev/sr0
sudo /bin/sh -c "echo 2001 7d0e > /sys/bus/usb-serial/drivers/option1/new_id
After entering these, sudo dmesg| grep ttyUSB appears as:
[ 17.581264] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB1
[ 17.584470] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB2
[ 17.593854] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB3
[ 17.594869] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB4
The actual port on which I can use the modem for dial up is ttyUSB1. So, I'm trying to assign ttyUSB1 to d_uart in my udev rules file:
ACTION=="add", ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7d0e", SYMLINK+="d_uart"
But what happens is d_uart gets assigned to ttyUSB4. What do I do to assign it to the first port always (ttyUSB1 in this case) ?
Also, the output of the command for ttyUSB1,ttyUSB2,ttyUSB3 and ttyUSB4 for the comnand below:
udevadm info -a -n /dev/ttyUSB4 | grep '{serial}' | head -n1
is the same.
ATTRS{serial}=="3f980000.usb"
Also, output of command ls -l /dev/d_uart
lrwxrwxrwx 1 root root 7 Oct 3 13:27 /dev/d_uart -> ttyUSB4
lsusb output:
Bus 001 Device 006: ID 2001:7d0e D-Link Corp.
Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root h
Output of udevadm info -n /dev/ttyUSB2:
P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.3/ttyUSB2/tty/ttyUSB2
N: ttyUSB2
S: d_uart
S: serial/by-id/usb-D-Link_Inc_D-Link_DWM-157-if03-port0
S: serial/by-path/platform-3f980000.usb-usb-0:1.4:1.3-port0
E: DEVLINKS=/dev/d_uart /dev/serial/by-id/usb-D-Link_Inc_D-Link_DWM-157-if03-port0 /dev/serial/by-path/platform-3f980000.usb-usb-0:1.4:1.3-port0
E: DEVNAME=/dev/ttyUSB2
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.3/ttyUSB2/tty/ttyUSB2
E: ID_BUS=usb
E: ID_MODEL=D-Link_DWM-157
E: ID_MODEL_ENC=D-Link\x20DWM-157
E: ID_MODEL_ID=7d0e
E: ID_PATH=platform-3f980000.usb-usb-0:1.4:1.3
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_4_1_3
E: ID_REVISION=0300
E: ID_SERIAL=D-Link_Inc_D-Link_DWM-157
E: ID_TYPE=generic
E: ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
E: ID_USB_DRIVER=option
E: ID_USB_INTERFACES=:020e00:0a0002:ff0201:ff0000:080650:
E: ID_USB_INTERFACE_NUM=03
E: ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
E: ID_VENDOR=D-Link_Inc
E: ID_VENDOR_ENC=D-Link\x2cInc\x20\x20
E: ID_VENDOR_FROM_DATABASE=D-Link Corp.
E: ID_VENDOR_ID=2001
E: MAJOR=188
E: MINOR=2
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=978899
bobdxcool
(31 rep)
Oct 3, 2016, 08:02 AM
• Last activity: Jun 25, 2025, 03:00 PM
0
votes
1
answers
2340
views
Udev rule refuses to trigger when harddrive is added
I'm on Ubuntu 20.04. I'm trying to execute an action when a specific harddrive is connected using an udev rule identifying the drive using UUID. The script will eventually do a routine where it will mount the drive and run rsync. To rule out any errors in that process I'm now just trying out a test...
I'm on Ubuntu 20.04.
I'm trying to execute an action when a specific harddrive is connected using an udev rule identifying the drive using UUID. The script will eventually do a routine where it will mount the drive and run rsync. To rule out any errors in that process I'm now just trying out a test command.
The harddrive is connected via SATA Hotswap and has an UUID which is confirmed to be correct. I've followed numerous guides that seem to use this exact syntax, and still absolutely nothing happens however I try.
Here are the steps I've done:
- Created a file called 90-backup.rules in
/etc/udev/rules.d
. The content is:
ACTION=="add", ENV{ID_FS_UUID}=="b527aadc-9dce-4ead-8937-e53ca2cfac84", RUN+="/bin/echo 1 >> /rule.test"
- Tried
udevadm control --reload-rules && udevadm trigger
- Tried systemctl reload udev
- Running udevadm test /dev/sdX
i can see that it lists the rules file:
Reading rules file: /etc/udev/rules.d/90-backup.rules
- Using udevadm info /dev/sdX
confirm that the ID_FS_UUID environmental variable is correct and can be read.
- Tried adding KERNEL=='sd?'
before the ACTION
argument.
Since the server is currently live in use, I haven't tried rebooting it yet. And it would be good to once and for all establish what is necessary to have udev reload the rules properly without reboot, for proper debugging.
Any help is appreciated.
All the best,
Andreas
A.H
(1 rep)
Jan 31, 2022, 01:23 AM
• Last activity: Jun 19, 2025, 05:00 AM
2
votes
0
answers
154
views
DRM: Artificially simulating a monitor Disconnect+Reconnect event, or a HOTPLUG uevent
Is there a way to simulate a physical HDMI cable unplugging and replugging on a Linux system running Xorg with AMDGPU driver? In my Xfce system on X11, I have trouble with monitor output/connector detection. In particular, when the system transitions from the Rescueshell/GRUB to the distro login man...
Is there a way to simulate a physical HDMI cable unplugging and replugging on a Linux system running Xorg with AMDGPU driver?
In my Xfce system on X11, I have trouble with monitor output/connector detection. In particular, when the system transitions from the Rescueshell/GRUB to the distro login manager (lightdm), the monitor turns blackish grey, and the only fix I've found so far is by unplugging the monitor's HDMI and replugging, or by changing the monitor's own FreeSync setting (Options: Standard Engine, Ultimate Engine, Off) in that black screen state and doing
Ctrl+Alt+F2
, which I think effectively "resets" the HDMI connection.
Using drm.edid=
as a kernel boot option can help with the issue, but having a valid Xorg.conf in /usr/share/X11/xorg.conf.d/
basically makes it useless and recreates the blackscreen, as I think Xorg/AMDGPU (my graphics driver) takes over control of the graphical output and uses the edid or modeline in the Xorg.conf, once it gets to the initial pre-login/post-login stage in lightdm. This switchup probably confuses my monitor. But I want to have a Xorg.conf for proper functionality.
The blackscreen isn't completely black, as in a no signal, but it's somewhat grey. If I switch TTYs, the screen will flicker and go grey again, but there'll be no display at this stage. It's like the monitor is detected, but there the signal isn't interpreted right.
I want to know if there is any way to make the KMS/DRM driver think that the monitor has been disconnected and reconnected, without a real physical disconnect, so the driver refreshes all "connectors" and hopefully gives output to the monitor, possibly using a udev HOTPLUG event.
According to the answers in this question: , it is possible to use udevadm trigger
to masquerade udev events to specific devices in /sys subsystems. Or by directly using
echo ACTION > /sys/class/SUBSYTEM/DEVICE/uevent
From udevadm trigger --verbose --action=help /sys/class/drm/card0-HDMI-A-1
I get a list of all possible 'trigger' options:
add
remove
change
move
online
offline
bind
unbind
I've tried using all of them, but they don't do anything equivalent to a full replugging. The screen stays on the whole time. However 'change' using
udevadm trigger --verbose --action=change /sys/class/drm/card0-HDMI-A-1
forces a rescan for the device EDID in dmesg
:
[34870.335496] Registering platform device 'HDMI-A-1'. Parent at platform
[34870.335523] device: 'HDMI-A-1': device_add
[34870.335545] platform HDMI-A-1: No ACPI support
[34870.335553] bus: 'platform': add device HDMI-A-1
[34870.335720] bus: 'platform': remove device HDMI-A-1
[34870.335746] [drm] Got external EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "HDMI-A-1"
This does not turn off the screen though, and so doesn't help with the problem.
Is there any way to mention a specific key / ENV{ATTRIBUTE} when triggering a udev event?
For example someone else's udev logs during a monitor unplug and replug cycle:
udevadm monitor --environment --udev
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
UDEV [1370.249130] change /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
ID_FOR_SEAT=drm-pci-0000_00_02_0
ID_PATH=pci-0000:00:02.0
ID_PATH_TAG=pci-0000_00_02_0
MAJOR=226
MINOR=0
SEQNUM=1884
SUBSYSTEM=drm
TAGS=:seat:uaccess:
USEC_INITIALIZED=715
Here the main ACTION is "change", but is there a way *I* can specify that HOTPLUG=1 parameter?
It's noteworthy that when *I* use udevadm monitor
and do an unplug cycle, nothing shows up in output. But when switching TTYs to F2 then F7 (my GUI) using Ctrl+Alt+...
, then I get this:
udevadm monitor --environment --udev
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
UDEV [4315.550505] add /devices/platform/HDMI-A-1 (platform)
ACTION=add
DEVPATH=/devices/platform/HDMI-A-1
SUBSYSTEM=platform
MODALIAS=platform:HDMI-A-1
SEQNUM=3714
USEC_INITIALIZED=4315229577
ID_PATH=platform-HDMI-A-1
ID_PATH_TAG=platform-HDMI-A-1
UDEV [4315.551278] remove /devices/platform/HDMI-A-1 (platform)
ACTION=remove
DEVPATH=/devices/platform/HDMI-A-1
SUBSYSTEM=platform
MODALIAS=platform:HDMI-A-1
SEQNUM=3715
USEC_INITIALIZED=4315229577
ID_PATH=platform-HDMI-A-1
ID_PATH_TAG=platform-HDMI-A-1
which could indicate that hotplugging is not supported or triggered properly in my system, leading to my issues.
I found a Gentoo forum post:
which had my same question regarding unplug and replug, but there was not a solution there.
I have tried
echo off > /sys/class/drm/card0-HDMI-A-1/status
and
echo on > /sys/class/drm/card0-HDMI-A-1/status
but it doesn't cause the monitor to turn off, only an EDID rescan in dmesg.
The same thing as a udevadm trigger --action=change
.
echoing to enabled
or dpms
in that same directory doesn't seem to be allowed.
I have tried
xset -display :0 dpms force off
(or -display :0.0)
from a TTY/shell script, but it doesn't turn off the monitor. Though it works in a GUI of course, after I've already unplugged the monitor once.
I tried
sudo mount -o remount,exec /dev
sudo vbetool dpms off
sudo mount -o remount,noexec /dev
from [this](https://old.reddit.com/r/linux4noobs/comments/vo7u7l/how_can_i_turn_the_display_off_in_a_tty/) and [this](https://askubuntu.com/questions/1384221/real-mode-call-failed-on-macbook-pro-when-trying-to-turn-screen-off-ubuntu-serve) , but it outputs
Real mode call failed
.
So now I tried
setterm --blank 1
from and
consoleblank=200
(approximate bootup time for my device in seconds)
as a kernel commandline parameter, and they also don't work as I want them to.
They can turn off the screen, but it's not a hard enough reset that makes the monitor redetected like in a physical replugging.
I've tried a systemd service like this
ExecStart=/bin/sh -c 'while [ -n "$(pidof lightdm)" ] || [ -n "$(pidof X)" ] || [ -n "$(pidof Xorg)" ]; do sleep 10; done; sleep 15; echo '' > /sys/module/drm/parameters/edid_firmware && pkill X'
to restart X at the login prompt, but it doesn't help either.
I came across this guide , which mentioned
> void (*output_poll_changed)(struct drm_device *dev);
>
>This operation notifies the driver that the status of one or more connectors has changed. Drivers that use the fb helper can just call the drm_fb_helper_hotplug_event function to handle this operation.
Is there a way I can compile a binary and call this function manually at X startup, to achieve what I'm looking for?
Or is there any other solution to address this?
I am having this issue on a PS4 system running Arch Linux, and I think the monitor might have trouble with EDID communication. So the hardware situation is a bit flaky, but most of the underlying mechanics are still the same.
feearent
(61 rep)
Jun 17, 2025, 08:00 PM
• Last activity: Jun 18, 2025, 10:39 AM
21
votes
3
answers
46026
views
/dev/hidraw: read permissions
What do I need to do to have read permissions on /dev/hidraw*? I'm seeing stuff about udev rules and saw [this][1] on the net, but the world of udev is like a foreign land to me, and if there's some sort of a simpler solution where I just add myself to a group that'd be dandy... (Ubuntu 13.10 Previe...
What do I need to do to have read permissions on /dev/hidraw*?
I'm seeing stuff about udev rules and saw this on the net, but the world of udev is like a foreign land to me, and if there's some sort of a simpler solution where I just add myself to a group that'd be dandy...
(Ubuntu 13.10 Preview)
Feel free to retag the question - I'm not too keen on what 'hidraw' exactly goes under.
EDIT:
H'okay, so, just some more information to clarify the issue:
I literally stepped through code that called the POSIX
open()
method, and got the errno
for insufficient permissions. Running cat
on the file as a normal user results in an insufficient permissions error, while running under su
results in a successful (albeit meaningless) cat
operation.
EDIT EDIT:
At request, I'm providing the relevant code with POSIX call. It's from the HIDAPI library by Signal11 (function hid_open_path
). I trust that this code is correct, as it has apparently been in use for quite some time now. I've added a comment located where the relevant errno
reading took place in GDB.
hid_device *dev = NULL;
hid_init();
dev = new_hid_device();
if (kernel_version == 0) {
struct utsname name;
int major, minor, release;
int ret;
uname(&name);
ret = sscanf(name.release, "%d.%d.%d", &major, &minor, &release);
if (ret == 3) {
kernel_version = major device_handle = open(path, O_RDWR);
// errno at this location is 13: insufficient permissions
/* If we have a good handle, return it. */
if (dev->device_handle > 0) {
/* Get the report descriptor */
int res, desc_size = 0;
struct hidraw_report_descriptor rpt_desc;
memset(&rpt_desc, 0x0, sizeof(rpt_desc));
/* Get Report Descriptor Size */
res = ioctl(dev->device_handle, HIDIOCGRDESCSIZE, &desc_size);
if (res device_handle, HIDIOCGRDESC, &rpt_desc);
if (res uses_numbered_reports =
uses_numbered_reports(rpt_desc.value,
rpt_desc.size);
}
return dev;
}
else {
/* Unable to open any devices. */
free(dev);
return NULL;
}
user
(661 rep)
Aug 2, 2013, 11:25 PM
• Last activity: Jun 16, 2025, 08:47 PM
3
votes
1
answers
4150
views
Why do I not seem to have hidraw options on my system, and how can I fix my usb devices?
Starting today, I noticed a few problems with my system. USB devices, including the internal ones such as microphones, don't seem to be working at all. I first noticed when my keyboard and mouse weren't responding - however, checking `dmesg`, both the logitech unifying receiver and my external mics...
Starting today, I noticed a few problems with my system. USB devices, including the internal ones such as microphones, don't seem to be working at all. I first noticed when my keyboard and mouse weren't responding - however, checking
dmesg
, both the logitech unifying receiver and my external mics usb connections were being recognized.
Thinking at first that the receiver may have simply stopped recognizing the input devices, I figured I'd resync them and I'd be good to go - except, that when I went to reference the needed hidraw device, I didn't have any. There is no /dev/hidraw
, no /sys/class/hidraw
, no anything it seems. (except a hidraw header under /usr/include
and some hidraw files under /usr/src
)
So that _seems_ to be at least part of the problem - udev seems to be failing to do its job somewhere. But I've got no idea where to go next.
Here's relevant bits that might be useful:
From dmesg:
[ 178.045682] usb 3-4: SerialNumber: 201203
[ 970.636450] usb 1-1.2: new full-speed USB device number 5 using ehci_hcd
[ 970.731693] usb 1-1.2: New USB device found, idVendor=046d, idProduct=c52b
[ 970.731698] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 970.731701] usb 1-1.2: Product: USB Receiver
[ 970.731704] usb 1-1.2: Manufacturer: Logitech
From lsusb:
Bus 001 Device 005: ID 046d:c52b Logitech, Inc. Unifying Receiver
From the udev monitor (udevadm monitor):
KERNEL[1111.431718] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 (usb)
KERNEL[1111.432374] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0 (usb)
KERNEL[1111.432430] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.1 (usb)
KERNEL[1111.432495] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.2 (usb)
UDEV [1111.438072] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 (usb)
UDEV [1111.441642] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0 (usb)
UDEV [1111.442308] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.1 (usb)
UDEV [1111.442924] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.2 (usb)
GlyphGryph
(131 rep)
Jan 26, 2013, 05:04 PM
• Last activity: Jun 9, 2025, 05:08 AM
0
votes
0
answers
20
views
Accessing USB Gadgetfs driver without sudo
I am working with an embedded machine (rock pi s) which can act as a USB device, communicating with a host device using the USB OTG port on the machine. I use the gadgetfs functionality of linux for this, specifically the driver /dev/gadget/ff400000.usb. It works, but only if I run the software as s...
I am working with an embedded machine (rock pi s) which can act as a USB device, communicating with a host device using the USB OTG port on the machine. I use the gadgetfs functionality of linux for this, specifically the driver /dev/gadget/ff400000.usb.
It works, but only if I run the software as sudo because the device files are access protected.
This causes headaches because I often need to debug various problems, but my remote debugging tools dot run the program as root, so basically I cannot use a debugger as it is now, slowing down development a lot.
So how can I enable access to my usb gadgetfs driver without root?
- I have tried simply temporarily chmod'ing the file, but it doesn't work because it also dynamically creates a bunch of secondary files for each usb endpoint, which also need sudo to access.
- I have also attempted to use udev rules, but if I run "udevadm info -a -n /dev/gadget/ff400000.usb", it just says "Unknown device", which afaik means that udev cannot be used on this driver?
GrixM
(101 rep)
Jun 8, 2025, 05:41 AM
0
votes
1
answers
2723
views
How does modprobe.d blacklist work, exactly?
## Problem I have conflicting drivers: `xpad` which comes standard with Arch, and [`xone`](https://github.com/medusalix/xone) which I installed from [AUR](https://aur.archlinux.org/packages/xone-dkms-git). Both claim to support my Xbox One wireless controller even though only the `xone` driver knows...
## Problem
I have conflicting drivers:
xpad
which comes standard with Arch, and [xone
](https://github.com/medusalix/xone) which I installed from [AUR](https://aur.archlinux.org/packages/xone-dkms-git) . Both claim to support my Xbox One wireless controller even though only the xone
driver knows what to do with it.
$ modprobe -R usb:v045Ep02F9d0114dcFFdscFFdpFFicFFisc5Dip01in00
xpad
xone_dongle
AFAIU, the culprit is the alias: usb:v045Ep*d*dc*dsc*dp*icFFisc5Dip01in*
in the xpad
driver which is too inclusive.
I want only the xone_dongle
loaded for the modalias above. But I don't want to disable the xpad
driver completely, because I also use a wired Xbox 360 controller usb:v045Ep028Ed0114dcFFdscFFdpFFicFFisc5Dip01in00
which I still want to be handled by xpad
. I don't need them to work at the same time, but at least if I plug one of them after a clean boot, either should work.
## Attempted solution
The manual page for modprobe.d
states:
> the blacklist
keyword indicates that all of that particular module's internal aliases are to be ignored.
Which sounds like if I blacklist xpad
and then define my own alias for it, it should work the way I want:
/etc/modprobe.d/gamepad.conf
blacklist xpad
alias usb:v045Ep028Ed0114dcFFdscFFdpFFicFFisc5Dip01in00 xpad
But instead it completely prevents the xpad
driver from loading, even though the alias is correct.
Also, even though I've blacklisted xpad
in the configuration, modprobe -R
still finds it for the modalias of the wireless dongle.
## Non-conclusion
Can someone please shed some light on how this actually works? Is there a bug in modprobe
? Is modprobe.d
documentation incomplete? Which aspects of modprobe
should be affected by the modprobe.d
configuration and which shouldn't?
SnakE
(151 rep)
Nov 21, 2023, 07:32 AM
• Last activity: Jun 1, 2025, 02:07 PM
3
votes
1
answers
4246
views
network interfaces rename not working as expected. Where to look?
System is Ubuntu 16.10. It has been updated quite some times, so it might have some remaining stuff from earlier versions in there (at least back till 14.04, probably much longer). The issue it the following: I have two network interfaces in the system (on mainboard). One was always named eth0. The...
System is Ubuntu 16.10. It has been updated quite some times, so it might have some remaining stuff from earlier versions in there (at least back till 14.04, probably much longer).
The issue it the following:
I have two network interfaces in the system (on mainboard). One was always named eth0. The second was not in use. Now I have a new situation in my network and want to use the second interface.
I learned a lot about interface rename and the new rename rules. So the second interface choses the name enp5s0 or similar, can't remember, therefore I need to rename it. But here is where my trouble starts.
eth0 was handled in
/etc/udev/rules.d/70-persistent-net.rules
which, I learned, is deprecated. I tried to add a second rule for "eth1" there (using its mac instead the one of eth0), but it did not work.
So after reading a bit I got rid of the old file and maybe I misunderstood something, but I figured eth* names are discouraged today, so I've chosen to call them lan0 and lan1 (which describes what they will be used for).
Then I added new files in /etc/systemd/network
:
10-eth-lan0.link 10-eth-lan1.linkWith this content:
[Match] MACAddress=00:23:54:96:74:07/06 [Link] Name=lan0/1for the different MACAddresses and the different names. For eth0 this seems to work, for eth1 (or whatever reason) it does not. And I am quite puzzled why the heck it won't work. I tripple checked the mac. dmesg | grep eth shows me this:
[ 6.233684] sky2 0000:08:00.0 eth0: addr 00:23:54:96:74:07 [ 6.233975] sky2 0000:05:00.0 eth1: addr 00:23:54:96:74:06 [ 6.661954] sky2 0000:08:00.0 lan0: renamed from eth0 [ 8.513836] sky2 0000:05:00.0 rename3: renamed from eth1I have absolutely no clue why it settled for "rename3" now... I experimented a bit with ip link set name after I saw the systemd link file not working. What puzzles me most is that it works for eth0 -> lan0 but not for eth1 -> lan1. What can I look into to find out why the rename is not working? Who is caching stuff here? The "ip link set name" did have some persistent effects (like the change to "rename3" from the enp5s0 or similar). [edit] I recognized one more thing now: My loopback interface gets renamed to lan1. Don't know why. But it happens on every boot now. Also I got rid of the *.link files described above and the renames still happen just the same.... ??? In /etc there is now just one mention of lan0 in /etc/network/interfaces and no mention of lan1. Somebody stores that stuff somewhere and I don't know who or where.
Garfonso
(31 rep)
Feb 26, 2017, 08:18 PM
• Last activity: May 21, 2025, 07:07 PM
5
votes
1
answers
4902
views
Delete /dev/loopX entry after detaching loop device
I created a loop device using `losetup /dev/loop90 /tmp/disk1`, where `/tmp/disk1` is a 512M file I have created. Then the loop device was detached using `losetup -d /dev/loop90`. It was removed from the output of `losetup -a`, but the entry in `/dev` and `/sys/devices/virtual/block` is still presen...
I created a loop device using
losetup /dev/loop90 /tmp/disk1
, where /tmp/disk1
is a 512M file I have created.
Then the loop device was detached using losetup -d /dev/loop90
.
It was removed from the output of losetup -a
, but the entry in /dev
and /sys/devices/virtual/block
is still present. Because this entry is present, whenever a udev scan is performed, all the removed devices are also listed.
How can these loop devices be completely deleted and all the entries removed without a reboot?
Akhil Mohan
(125 rep)
Sep 24, 2019, 09:26 AM
• Last activity: May 20, 2025, 09:08 AM
8
votes
1
answers
2404
views
How to rename devices for graphical output such as VGA0
On my Laptop the names of my graphical outputs change depending on what chip is activated in the BIOS. This leads to problems in some scripts where outputs such as VGA-0 or LVDS-0 are specified. So I want to rename the graphical outputs, similar to how you can specify persistent names for network de...
On my Laptop the names of my graphical outputs change depending on what chip is activated in the BIOS. This leads to problems in some scripts where outputs such as VGA-0 or LVDS-0 are specified.
So I want to rename the graphical outputs, similar to how you can specify persistent names for network devices with
udev
.
But I can't find anything that would explain how or if this is even possible at all.
In /sys I could find kernel names such as as:
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DVI-D-1
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-VGA-1
while xrandr
reports the names as DVI1
and VGA1
.
So they have to be renamed somewhere(?)
When I call udevadm info
on one of those devices I get a lot of information but not the names used by xrandr
and other X tools.
So is it possible to create a udev
rule to rename the outputs and if so how?
Are the names even set by udev
?
ifschleife
(273 rep)
Oct 5, 2013, 12:43 PM
• Last activity: May 19, 2025, 07:08 PM
Showing page 1 of 20 total questions