]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: add safe guard for setting by-id symlink 25246/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 3 Nov 2022 00:52:23 +0000 (09:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 3 Nov 2022 00:59:54 +0000 (09:59 +0900)
The ID_BUS property is necessary for creating by-id symlinks.

rules.d/60-serial.rules

index 2c1488e930a3ed31b815660e365906c559f1bedf..a0e66323a9bbb304e0df8e6f1989a594a74a133d 100644 (file)
@@ -17,6 +17,7 @@ IMPORT{builtin}="path_id"
 ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="", SYMLINK+="serial/by-path/$env{ID_PATH}"
 ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-path/$env{ID_PATH}-port$env{.ID_PORT}"
 
+ENV{ID_BUS}=="", GOTO="serial_end"
 ENV{ID_SERIAL}=="", GOTO="serial_end"
 ENV{ID_USB_INTERFACE_NUM}=="", GOTO="serial_end"
 ENV{.ID_PORT}=="", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}"