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

Re: Bug#725714: Partial fix using hw-setup for the missing firmware problem in d-i?



Here is another draft, this time also providing the module name.  I
dropped the code looking in /proc/modules, as three ways to find
firmware seem a bit too much.  I added similar code to the
isenkram-cli package to install needed firmware packages into
/target/, and it seem to work well there. :)

This new version is not yet tested in the udeb, but the key parts
worked when I tested on the command line.

diff --git a/check-missing-firmware.sh b/check-missing-firmware.sh
index 60c6ff4..87f2839 100755
--- a/check-missing-firmware.sh
+++ b/check-missing-firmware.sh
@@ -69,6 +69,29 @@ check_missing () {
 	
 	modules=""
 	files=""
+
+	# Workaround for bug #725714, the kernel and udev no longer
+	# let us know via /dev/.udev/firmware-missing and
+	# /run/udev/firmware-missing which firmware files the kernel
+	# drivers look for.
+	fwlist=/tmp/check-missing-firmware-dmesg.list
+	dmesg | grep 'firmware: failed to load' \
+	    | cut -d\] -f2- | cut -d" " -f2,8 > $fwlist
+	while read module fwfile ; do
+	    log "looking for firmware file $fwfile requested by $module"
+	    if [ ! -e /lib/firmware/$fwfile ] ; then
+		if grep -q "^$fwfile$" $DENIED 2>/dev/null; then
+		    log "listed in $DENIED"
+		    continue
+		fi
+		files="${files:+$files }$fwfile"
+		modules="$module${modules:+ $modules}"
+	    fi
+	done < $fwlist
+
+	# This block looking in $MISSING should be removed when
+	# hw-detect no longer should support installing using older
+	# udev and kernel versions.
 	for missing_dir in $MISSING
 	do
 		if [ ! -d "$missing_dir" ]; then
@@ -121,7 +144,7 @@ check_missing () {
 		log "missing firmware files ($files) for $modules"
 		return 0
 	else
-		log "no missing firmware in $MISSING"
+		log "no missing firmware loaded kernel modules"
 		return 1
 	fi
 }

-- 
Happy hacking
Petter Reinholdtsen


Reply to: