naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
ac3a84
From 080747ee6685b9c5877073c5120375e7a04d8216 Mon Sep 17 00:00:00 2001
ac3a84
From: Yu Watanabe <watanabe.yu+github@gmail.com>
ac3a84
Date: Thu, 3 Nov 2022 09:39:36 +0900
ac3a84
Subject: [PATCH] udev: first set properties based on usb subsystem
ac3a84
ac3a84
After 479da1107a0d4e2f7ef5cd938512b87a0e45f180, the usb_id builtin
ac3a84
command does not set ID_SERIAL if ID_BUS is already set.
ac3a84
Before the commit, all properties set based on pci bus were overwritten
ac3a84
by the usb_id, hence now it is sufficient setting them only when ID_BUS is
ac3a84
not set yet.
ac3a84
ac3a84
Fixes #25238.
ac3a84
ac3a84
(cherry picked from commit 01e704eba982fbc1517287cd261d229ff8e0a779)
ac3a84
ac3a84
Related #2138081
ac3a84
---
ac3a84
 rules.d/60-serial.rules | 5 +++--
ac3a84
 1 file changed, 3 insertions(+), 2 deletions(-)
ac3a84
ac3a84
diff --git a/rules.d/60-serial.rules b/rules.d/60-serial.rules
ac3a84
index f303e27fd5..c133f26109 100644
ac3a84
--- a/rules.d/60-serial.rules
ac3a84
+++ b/rules.d/60-serial.rules
ac3a84
@@ -3,9 +3,10 @@
ac3a84
 ACTION=="remove", GOTO="serial_end"
ac3a84
 SUBSYSTEM!="tty", GOTO="serial_end"
ac3a84
 
ac3a84
-SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}"
ac3a84
-SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci"
ac3a84
 SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
ac3a84
+SUBSYSTEMS=="pci", ENV{ID_BUS}=="", ENV{ID_BUS}="pci", \
ac3a84
+  ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}", \
ac3a84
+  IMPORT{builtin}="hwdb --subsystem=pci"
ac3a84
 
ac3a84
 # /dev/serial/by-path/, /dev/serial/by-id/ for USB devices
ac3a84
 KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="serial_end"