Fwd: Re: modprobe /dev/*
Below is a message from Richard Gooch regarding devfsd. I suggested telling
devfsd to ignore LOOKUP operations on any device node ending in '*'. With
the current setup when you do "ls -l /dev/abc*" the devfsd will run
`modprobe "abc*"` which is not desired.
Richard believes that the shell globbing should be changed.
I am currently planning to disregard his suggestion and make the default
configuration for devfsd in Debian ignore any LOOKUP event for a device node
that ends in '*'. This means that if anyone writes a device driver that uses
a '*' character in it's name it might cause problems with module loading (but
surely no-one would want to do that). But apart from that I can't think of
any reason for not doing this.
Any comments?
Russell Coker writes:
> On Fri, 15 Feb 2002 05:12, Richard Gooch wrote:
> > > At linux.conf.au Keith and I were looking into devfs module loading
> > > issues.
> > >
> > > We noticed that the distribution he was running (some RPM distribution)
> > > had a lot of scripts with code like the following:
> > >
> > > for n in /dev/dsp* ; do
> > > ...
> > > done
> > >
> > > This results in `modprobe "/dev/dsp*"` being run once for the for line
> > > and then a second time in the body of the loop.
> > >
> > > We discovered that a significant number of useless modprobe runs
> > > were removed when we added the following to devfsd.conf:
> > > LOOKUP \*$ IGNORE
> > >
> > > Before the following line in the default config:
> > > LOOKUP .* MODLOAD
> > >
> > > I think that this should be part of the default config file.
> >
> > This sounds to me like it's a script problem. For bash-v1.x I have:
> > allow_null_glob_expansion=
> >
> > and for bash-v2.x I have:
> > shopt -s nullglob
>
> So that means one modprobe invocation instead of two.
No, it means none, since the shell will do a directory read to expand
/dev/dsp* and will get no entries. Thus no LOOKUP events.
> Also "ls /dev/foo*" will result in modprobe being called when (IMHO)
> it shouldn't.
Not with null globbing.
> > Why not just fix the scripts? A trailing '*' might be used in a
> > filename, so I'd prefer not to break that.
>
> Why would someone want to put a '*' character into a devfs file
> name? I have never heard of any version of Unix using '*' or '?'
> characters in file names for /dev, why would someone want to start
> such foolishness now?
I just prefer to avoid imposing policy if I don't have to. And since
this seems to be a problem with the scripts...
Regards,
Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca
-------------------------------------------------------
--
http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/ Postal SMTP/POP benchmark
http://www.coker.com.au/projects.html Projects I am working on
http://www.coker.com.au/~russell/ My home page
Reply to: