X Tutup
Skip to content

Commit 451ba55

Browse files
keszybzpoettering
authored andcommitted
Revert "udev: do not execute hwdb builtin import twice or thrice"
This reverts commit 876c75f. The patch seems to cause usb devices to get some attributes set from the parent PCI device. 'hwdb' builtin has support for breaking iteration upwards on usb devices. But when '--subsystem=foo' is specified, iteration is continued. I'm sure it *could* be figured out, but it seems hard to get all the combinations correct. So let's revert to functional status quo ante, even if does the lookup more than once unnecessarily. Fixes systemd#18125.
1 parent 4b252ea commit 451ba55

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

rules.d/50-udev-default.rules.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-
1010
SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc"
1111
SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"
1212

13-
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb", GOTO="default_hwdb_imported"
13+
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
1414
ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"
15-
LABEL="default_hwdb_imported"
1615

1716
ACTION!="add", GOTO="default_end"
1817

rules.d/60-serial.rules

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ ACTION=="remove", GOTO="serial_end"
44
SUBSYSTEM!="tty", GOTO="serial_end"
55

66
SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}"
7-
# We already ran the hwdb builtin for devices with MODALIAS in 50-default.rules.
8-
# Let's cover the remaining case here, where we walk up the tree to find a node with $MODALIAS.
9-
ENV{MODALIAS}=="", SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci"
7+
SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci"
8+
SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
109

1110
# /dev/serial/by-path/, /dev/serial/by-id/ for USB devices
1211
KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="serial_end"

0 commit comments

Comments
 (0)
X Tutup