autoloading generic SCSI support: a solution

From: jes@presto.med.upenn.edu
Date: Fri Jan 28 2000 - 11:02:28 PST

  • Next message: Mentore #cat# Siesto: "Latest SANE snapshot: question"

    Ok, it feels a little squishy, but it works.

    To /etc/conf.modules, add:

      alias sg_scsi_hostadapter aic7xxx
      alias char-major-21 sg
      pre-install sg modprobe sg_scsi_hostadapter

    Now, when I do 'scanimage --list-devices', it autoloads the sg.o
    module, which in turn calls modprobe to load the required scsi adapter
    module.

    The down side of this approach is that the dependence (of sg.o on
    aic7xxx.o) is unknown to modprobe, and thus sg (15k) is autocleaned,
    but not aic7xxx (>100k).

    The dependence can be specified _ad hoc_ by adding a line to the
    module dependency file, like this (for RedHat and derivatives):

       # Tested on Mandrake 6.1; other distros may need something else!
       modules="/lib/modules/`uname -r`"
       depfile="$modules/modules.dep"

       echo -e "\n$modules/scsi/sg.o: $modules/scsi/aic7xxx.o" >>$depfile

    In this case, only the 'alias char-major-21 sg' line is necessary in
    conf.modules. You can run this from rc.local; the modules will be
    loaded when the scanner is accessed.

    Loading the aic7xxx on a running system is a little scary: everything
    (and I do mean _everything_!) stops for about 3-4 seconds.

    I've not tested this enough to know if there are any surprises; please
    pass the clues if there is something I've overlooked.

    Thanks to Chris Pinkham for the helpful suggestion!

    <Joe

    -- 
     Joe Smith
     jes@presto.med.upenn.edu
    

    -- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com



    This archive was generated by hypermail 2b29 : Fri Jan 28 2000 - 13:06:24 PST