[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

SOLVED: autoloading sg driver during boot



Aleksandar Milivojevic wrote:
Probably something trivial, but can't seem to find solution (other than placing "modprobe sg" in /etc/rc.local).

I attempted something like this in modprobe.conf:

alias char-major-21 sg

(and also char-major-21-* variant)

The problem is, there are no /dev/sg* entries in /dev when machine boots. They are created by udev when "sg" driver loads. Chicken and egg problem. Kind of. So the above lien in modprobe.conf does not really work.

So.... the question is, is there any way to instruct udev to create /dev/sg* nodes (so that applications can access it and trigger auto loading of sg driver)? Or instruct system to autoload sg module during boot if there are any SCSI devices, which would trigger udev to create /dev/sg* nodes? Other than placing "modprobe sg" in /etc/rc.local.

Problem solved. In short, I had a buggy version of hotplug package installed.


The fix is simple. What needs to be done is to edit /etc/hotplug/scsi.agent script. It checks the device type and loads appropriate driver. The stock Fedora script does not load any drivers for type 8 (changer) device, and the one I have (taken from RHEL 4) had a typo in the line for changer device.

Near the end of the script is a case statement that selects appropriate driver depending on numeric SCSI device type (as return by device when it is queried). The stock Fedora script has a line for changer device empty (does not load any driver):

8) TYPE=changer ;;

And the script from RHEL 4 has a typo (note misspelled word moudle -> module):

8) TYPE=changer ; MOUDLE = sg ;;

It should read:

8) TYPE=changer ; MODULE = sg ;;

As soon as I fixed it, everything works OK, and sg module is automatically loaded during boot (by hotplug subsystem), and udev creates appropriate device nodes automagically (as it is supposed to do). Weehee...

--
Aleksandar Milivojevic <amilivojevic pbl ca>    Pollard Banknote Limited
Systems Administrator                           1499 Buffalo Place
Tel: (204) 474-2323 ext 276                     Winnipeg, MB  R3T 1L7


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]