]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Revert "udev: do not execute hwdb builtin import twice or thrice"
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Mar 2021 09:17:23 +0000 (10:17 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 10 Mar 2021 14:26:45 +0000 (15:26 +0100)
This reverts commit 876c75fe870846b09b54423a6b719d80bc879b27.

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 #18125.

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

index c7079a05a25d99d361eb34bab9f00248615a17e1..346c742c87f7884e31cf4d8f4dc3458eccd37f36 100644 (file)
@@ -10,9 +10,8 @@ SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-
 SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc"
 SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"
 
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb", GOTO="default_hwdb_imported"
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
 ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"
-LABEL="default_hwdb_imported"
 
 ACTION!="add", GOTO="default_end"
 
index b1626650b7f2e4b0be4c1629958a95c83817a63a..f303e27fd54cfa4c82804cf2b3486202284548d0 100644 (file)
@@ -4,9 +4,8 @@ ACTION=="remove", GOTO="serial_end"
 SUBSYSTEM!="tty", GOTO="serial_end"
 
 SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}"
-# We already ran the hwdb builtin for devices with MODALIAS in 50-default.rules.
-# Let's cover the remaining case here, where we walk up the tree to find a node with $MODALIAS.
-ENV{MODALIAS}=="", SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci"
+SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci"
+SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
 
 # /dev/serial/by-path/, /dev/serial/by-id/ for USB devices
 KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="serial_end"