Skip to content

Commit

Permalink
udev: add safe guard for setting by-id symlink
Browse files Browse the repository at this point in the history
The ID_BUS property is necessary for creating by-id symlinks.
  • Loading branch information
yuwata committed Nov 3, 2022
1 parent b2e53f5 commit 5286da0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rules.d/60-serial.rules
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 5286da0

Please sign in to comment.