Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib/udev: explicitly load the sg module in the udev rule #88

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

hnez
Copy link
Member

@hnez hnez commented Jan 29, 2025

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 #87.

I've tested the change on may Arch Linux System that would not automatically load the sg module before, but does with the updated udev rule. I've also checked if having an explicit kmod load in an (upstream) udev rule is uncommon:

$ cd /usr/lib/udev
rg kmod
rules.d/80-drivers.rules
5:ENV{MODALIAS}=="?*", RUN{builtin}+="kmod load"
6:SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN{builtin}+="kmod load tifm_sd"
7:SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN{builtin}+="kmod load tifm_ms"
8:SUBSYSTEM=="memstick", RUN{builtin}+="kmod load ms_block mspro_block"
9:SUBSYSTEM=="i2o", RUN{builtin}+="kmod load i2o_block"
10:SUBSYSTEM=="module", KERNEL=="parport_pc", RUN{builtin}+="kmod load ppdev"
11:KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN{builtin}+="kmod load sm_ftl"

This looks to me like they are not that common, but they exist.

Resolves #87.

@hnez
Copy link
Member Author

hnez commented Jan 29, 2025

The failed CI job is unrelated to this PR and should be fixed by #89.

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]: linux-automation#87

Signed-off-by: Leonard Göhrs <[email protected]>
@SmithChart SmithChart merged commit 9b4e4bc into linux-automation:master Jan 30, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggest to use udev for loading sg
2 participants