]> git.proxmox.com Git - systemd.git/blob - debian/patches/udev-first-set-properties-based-on-usb-subsystem.patch
Update upstream source from tag 'upstream/252.1'
[systemd.git] / debian / patches / udev-first-set-properties-based-on-usb-subsystem.patch
1 From: Yu Watanabe <watanabe.yu+github@gmail.com>
2 Date: Thu, 3 Nov 2022 09:39:36 +0900
3 Subject: [PATCH] udev: first set properties based on usb subsystem
4
5 After 479da1107a0d4e2f7ef5cd938512b87a0e45f180, the usb_id builtin
6 command does not set ID_SERIAL if ID_BUS is already set.
7 Before the commit, all properties set based on pci bus were overwritten
8 by the usb_id, hence now it is sufficient setting them only when ID_BUS is
9 not set yet.
10
11 Fixes #25238.
12 ---
13 rules.d/60-serial.rules | 5 +++--
14 1 file changed, 3 insertions(+), 2 deletions(-)
15
16 diff --git a/rules.d/60-serial.rules b/rules.d/60-serial.rules
17 index f303e27..c133f26 100644
18 --- a/rules.d/60-serial.rules
19 +++ b/rules.d/60-serial.rules
20 @@ -3,9 +3,10 @@
21 ACTION=="remove", GOTO="serial_end"
22 SUBSYSTEM!="tty", GOTO="serial_end"
23
24 -SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}"
25 -SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci"
26 SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
27 +SUBSYSTEMS=="pci", ENV{ID_BUS}=="", ENV{ID_BUS}="pci", \
28 + ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}", \
29 + IMPORT{builtin}="hwdb --subsystem=pci"
30
31 # /dev/serial/by-path/, /dev/serial/by-id/ for USB devices
32 KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="serial_end"