[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#562594: Use modalias to detect modules when driver does not register



tags 562594 + patch
thanks

Hi!

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`.

Once this changes applied, it sucessfully prompted for the relevant
firmware files.

Cheers,
-- 
Jérémy Bobbio - Administrateur système et réseau
Mezcalito - http://www.mezcalito.fr
17 boulevard Agutte Sembat - 38000 Grenoble
04 76 01 03 91
diff -Naur hw-detect-1.74.orig/check-missing-firmware.sh hw-detect-1.74/check-missing-firmware.sh
--- hw-detect-1.74.orig/check-missing-firmware.sh	2009-12-28 14:11:59.877649354 +0100
+++ hw-detect-1.74/check-missing-firmware.sh	2009-12-28 14:13:13.623342950 +0100
@@ -31,7 +31,14 @@
 			# The realpath of the destination of the
 			# driver/module symlink should be
 			# something like "/sys/module/e100"
-			module=$(basename $(realpath $devpath/driver/module)) || true
+			if [ -d $devpath/driver ]; then
+				module=$(basename $(realpath $devpath/driver/module)) || true
+			else
+				# Use modalias when driver does not register when firmware
+				# is missing
+				modalias="$(cat $devpath/modalias)"
+				module=$(modprobe --show-depends "$modalias" | sed -n -e '$s#^.*/\([^.]*\)\.ko.*$#\1#p') || true
+			fi
 			if [ -z "$module" ]; then
 				log "failed to determine module from $devpath"
 				continue

Attachment: signature.asc
Description: PGP signature


Reply to: