LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Autoloading sg module (https://www.linuxquestions.org/questions/slackware-14/autoloading-sg-module-4175454274/)

andy713 03-16-2013 12:02 AM

Autoloading sg module
 
I have a firewire scanner which worked fine until I upgraded to -current this morning. Now I have to load the sg module manually to get it to work. Loading it in initrd or rc.local are brute force ways to fix it, but I'm sure there's a right way out there somewhere. My scanner is still in 80-libsane.rules, but something else appears to have changed. Maybe too aggressive a fix to udev?

Andy

willysr 03-16-2013 03:10 AM

perhaps adding usb-storage in your /etc/rc.d/rc.modules fix this problem?
those modules are now modular and no longer built into the kernel

ljb643 03-16-2013 02:04 PM

When I upgraded to Slackware 14.0, I had to uncomment the line in /etc/rc.d/rc.modules that loads the "sg" module. This was needed to use an ordinary SATA or IDE CD writer. I think the older (Slackware 13.37 and earlier) 2.6.x kernels loaded sg when loading the scsi module, and the newer 3.2.x kernels do not do this automatically.

I don't know if there is a "better" (cleaner, preferred) way to get this to load at every boot.

andy713 03-16-2013 06:33 PM

{Kinda SOLVED] Autoloading sg module
 
I found this udev modprobe sg rule and decided to add it to 80-libsane.rules right before the libsane_scsi_rules_end LABEL near the end of the file:

SUBSYSTEM=="scsi_device", ACTION=="add", RUN+="/sbin/modprobe sg"
LABEL="libsane_scsi_rules_end"

A few quick commands:

udevadm control --reload-rules
rmmod sg

Cycle power on the scanner and now it works. Module sg gets loaded automagically. I like this fix better than loading it somewhere in the boot process. Maybe it should get pushed up into the tree? Or am I the corner case?

Andy

andy713 04-02-2013 08:50 PM

{not solved]
 
So, I thought I fixed it by patching 80-libsane.rules. Turns out that I only get the proper permissions on the sg device (660, root.lp) after the system has booted. During boot, it detects the scanner, but I get '600 / root.root' permissions instead, rendering it useless. So I added --debug to rc.udev to trace it. That made it work fine. So I took off the --debug, and now it doesn't work again. WTF?! SG only works when loaded manually after boot?

Goddammit, I'd piss on a spark plug if I thought it'd do any good! --Gen. Beringer, Wargames

Andy


All times are GMT -5. The time now is 11:58 AM.