Skip to content

Commit

Permalink
contrib/udev: explicitly load the sg module in the udev rule
Browse files Browse the repository at this point in the history
We never got around to figuring out why the `sg` module is auto-loaded on
some systems/distributions (e.g. Debian) but not on others (e.g. Arch).
We have since used workarounds like adding `sg` to `/etc/modules`.

Instead just use udev to load the module if a new USB-SD-Mux is connected,
as suggested by @frosteyes in [1].

[1]: #87

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
  • Loading branch information
hnez committed Jan 30, 2025
1 parent a90da1e commit c6557db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrib/udev/99-usbsdmux.rules
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# USB-SD-Mux
ACTION=="add", SUBSYSTEM=="scsi_generic", KERNEL=="sg[0-9]*", ATTRS{manufacturer}=="Pengutronix", ATTRS{product}=="usb-sd-mux*", SYMLINK="usb-sd-mux/id-$attr{serial}", TAG+="uaccess", GROUP="plugdev"
ACTION=="add", SUBSYSTEM=="scsi_generic", KERNEL=="sg[0-9]*", ATTRS{manufacturer}=="Linux Automation GmbH", ATTRS{product}=="usb-sd-mux*", SYMLINK="usb-sd-mux/id-$attr{serial}", TAG+="uaccess", GROUP="plugdev"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{manufacturer}=="Pengutronix", ATTRS{product}=="usb-sd-mux*", RUN{builtin}+="kmod load sg"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{manufacturer}=="Linux Automation GmbH", ATTRS{product}=="usb-sd-mux*", RUN{builtin}+="kmod load sg"

0 comments on commit c6557db

Please sign in to comment.