From c11128d35f5bb52497163d54d0fc507a811689f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= Date: Wed, 29 Jan 2025 08:27:35 +0100 Subject: [PATCH] contrib/udev: explicitly load the sg module in the udev rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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]: https://github.com/linux-automation/usbsdmux/issues/87 Signed-off-by: Leonard Göhrs --- contrib/udev/99-usbsdmux.rules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/udev/99-usbsdmux.rules b/contrib/udev/99-usbsdmux.rules index a9b1907..e3d2625 100644 --- a/contrib/udev/99-usbsdmux.rules +++ b/contrib/udev/99-usbsdmux.rules @@ -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"