Bug#562594: Use modalias to detect modules when driver does not register
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')
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?
Patch available at: http://bugs.debian.org/562594#39
Reply to: