mirror of
https://github.com/systemd/systemd.git
synced 2025-03-11 20:58:27 +03:00
udev: Add /dev/media/by-path symlinks for media controllers
Add persistent symlinks for media controller ("mediaX") devices, based on their ID_PATH udev properties. For example, if the uvcvideo driver creates /dev/media0, a persistent name may be: /dev/media/by-path/pci-0000:04:00.3-usb-0:1:1.0-media-controller Persistent links are a handy tool to make scripts self-documenting during development or in tests, as well as less error prone in case of devices changing enumeration order. For media controllers, one can alternatively scan through all of them and look for a matching bus_info in their struct media_device_info, but the links are much handier when drafting something by hand. A similar pattern already exists for Video4Linux /dev/videoX devices, see 60-persistent-v4l.rules for those.
This commit is contained in:
parent
3976c43092
commit
04f19d6735
12
rules.d/60-persistent-media-controller.rules
Normal file
12
rules.d/60-persistent-media-controller.rules
Normal file
@ -0,0 +1,12 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
# Media controller rules
|
||||
|
||||
ACTION=="remove", GOTO="persistent_media_ctl_end"
|
||||
SUBSYSTEM!="media", GOTO="persistent_media_ctl_end"
|
||||
ENV{MAJOR}=="", GOTO="persistent_media_ctl_end"
|
||||
|
||||
IMPORT{builtin}="path_id"
|
||||
ENV{ID_PATH}=="?*", KERNEL=="media*", SYMLINK+="media/by-path/$env{ID_PATH}-media-controller"
|
||||
|
||||
LABEL="persistent_media_ctl_end"
|
Loading…
x
Reference in New Issue
Block a user