I'm starting to wonder if it is getting the base name by looking at the
PCI or USB information for the device...

/etc/dynamic/scripts/part.script seems to be the one making the
directory and modifying /etc/fstab. It relies on the variable $mpoint.
So do many of the other scripts in /etc/dynamic... but none of them
actually set the damned variable.

and in looking for it, we discover that rgrep isn't actually recursing
(sort of belies the r, neh?):
[jack@chupacabra jack]$ sudo rgrep mpoint /etc/*       
[jack@chupacabra jack]$ sudo rgrep mpoint /etc/dynamic/*
/etc/dynamic/scripts/part.script:    /usr/sbin/drakupdate_fstab --auto
--$1 $2 | while read mpoint type; do
/etc/dynamic/scripts/part.script:           [ ! -d $mpoint ] && mkdir
$mpoint
/etc/dynamic/scripts/part.script:               mount $mpoint
...
man rgrep, and
       -r
              recursively scan through directory tree

sigh... yes Virginia, the rgrep command requires a freaking -r flag to
make it actually recurse. That's pretty lame.

However, even with an rgrep -r I still can't find the memory_card string
or the mpoint variable definition... google to the rescue. The Answer
Guy posted this snippet:
"    mount | {
        IFS="      (,)";
        while read dev x mpoint x type opts; do
           echo $dev $type;
        done
        }
"

which makes it clear that $mpoint is being defined here:
/etc/dynamic/scripts/part.script:    /usr/sbin/drakupdate_fstab --auto
--$1 $2 |
 while read mpoint type; do

I looked in /usr/sbin/drakupdate_fstab and it's a perl script, which
sets mpoint here:
sub set_mount_point {
    my ($part, $fstab) = @_;

    my $mntpoint = detect_devices::suggest_mount_point($part) or return;
    $mntpoint = "/mnt/$mntpoint";

    foreach ('', 2 .. 10) {
        next if fsedit::mntpoint2part("$mntpoint$_", $fstab);
        $part->{mntpoint} = "$mntpoint$_";
        return 1;
    }
    0;
}

which relies on the use statements at the top:
use lib qw(/usr/lib/libDrakX);

use detect_devices;
...

and if we look in /usr/lib/libDrakX/detect_devices.pm we will see:
sub usb_description2removable {
    local ($_) = @_;
    return 'camera' if /\bcamera\b/i;
    return 'memory_card' if /\bmemory\s?stick\b/i ||
/\bcompact\s?flash\b/i || /
\bsmart\s?media\b/i;
    return 'memory_card' if /DiskOnKey/i || /IBM-DMDM/i;
    return 'zip' if /\bzip\s?(100|250|750)/i;
    return 'floppy' if /\bLS-?120\b/i;
    return;
}


Look in that file and you'll probably find the one you wanted changed
too.

Talk about a journey through the plumbing...
Jack

On Mon, 2002-10-21 at 13:16, bascule wrote:
> exactly, if i could find that then i could just edit whatever file it was to 
> say 'camera' instead,
> except of course that i also have a scsi removable drive that gets mounted 
> there too if it's connected!
> 
> it's all a bit too clever for it's own good, i'd just like to turn this 
> behaviour off and go back to good old manual mounting
> 
> bascule
> 
> On Monday 21 Oct 2002 7:58 pm, Jack Coates wrote:
> >
> > I took a look at this area, and it's definitely cause for suspicion, but
> > I can't find exactly where it's doing what it does because it's a morass
> > of functions which pass each other flags (so a variable may be defined
> > in one file, called in a second for passing to a third, and acted on in
> > the third).
> >
> > This set of scripts seems to do some cool stuff -- for instance, I think
> > it's responsible for auto-detecting my memory stick slot and mounting it
> > under /mnt/memory_card. But I'll be damned if I can find where it
> > decided that /mnt/[foobar] is the right mount point...
> 
> -- 
> "Another world, another day, another dawn. "
> 
> 
> ----
> 

> Want to buy your Pack or Services from MandrakeSoft? 
> Go to http://www.mandrakestore.com
-- 
Jack Coates
Monkeynoodle: A Scientific Venture...


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to