summaryrefslogtreecommitdiffstats
path: root/rules.d/60-serial.rules
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-11-03 01:52:23 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-11-03 01:59:54 +0100
commit5286da064c97d2ac934cb301066aaa8605a3c8f9 (patch)
tree342e993f71e8836a7e370d348a50b0111aaab1c8 /rules.d/60-serial.rules
parentudev: drop redundant call of usb_id and assignment of ID_USB_INTERFACE_NUM (diff)
downloadsystemd-5286da064c97d2ac934cb301066aaa8605a3c8f9.tar.xz
systemd-5286da064c97d2ac934cb301066aaa8605a3c8f9.zip
udev: add safe guard for setting by-id symlink
The ID_BUS property is necessary for creating by-id symlinks.
Diffstat (limited to '')
-rw-r--r--rules.d/60-serial.rules1
1 files changed, 1 insertions, 0 deletions
diff --git a/rules.d/60-serial.rules b/rules.d/60-serial.rules
index 2c1488e930..a0e66323a9 100644
--- a/rules.d/60-serial.rules
+++ b/rules.d/60-serial.rules
@@ -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}"