Bug#562594: Use modalias to detect modules when driver does not register
On Mon, Dec 28, 2009 at 03:17:49PM +0100, Frans Pop wrote:
> On Monday 28 December 2009, Jérémy Bobbio wrote:
> > This problem looks similar to the one I had while trying to use a daily
> > build image on a PowerEdge R410.
> > The network interfaces on these machines are supported by the bnx2
> > module, but when no firmware is available, the driver does not register
> > itself for the device, and there is no `$devpath/driver` directory
> > available.
> > The attached patch adds to `check-missing-firmware` another way to
> > determine the module by using `modprobe` and `$devpath/modalias`.
> Thanks Jérémy. Looks good.
> I think the patch needs an added test that modalias exists, something like:
> elif [ -e $devpath/modalias ]; then
> And that long line could do with a split to the next line after the pipe.
> The "|| true" is probably not needed as the sed statement will absorb any
> errors from modprobe, but maybe there should be a redirect of errors:
> module=$(modprobe --show-depends "$modalias" 2>/dev/null | \
> sed -n -e '$s#^.*/\([^.]*\)\.ko.*$#\1#p')
I see that modprobe has --resolve-alias flag which prints out the
module(s) matching an alias, which renders the whole sed concoction
> A comment that the module supporting the device is the last line returned
> by modprobe would be useful. It's not quite self-evident.
> > Once this changes applied, it sucessfully prompted for the relevant
> > firmware files.
> Jurij: does this patch also work for you?
Looks reasonable, thanks. Unfortunately, I'm on vacation for the next
two weeks without access to my sparc, so I'll not be able to test it
until the third week of January.
> Patch available at: http://bugs.debian.org/562594#39
Jurij Smakov firstname.lastname@example.org
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC