Asbjørn Sloth Tønnesen wrote:
> I have logged interesting events to tty3, so I know it gets there, and I
> have looked at e100.c, so I know it has to have been up'ed first.
> 
> Ok, just found the source for the first up:
> 
> bottom of packages/hw-detect/ethdetect.sh:
> > # Some modules only try to load firmware once brought up. So bring up and
> > # then down all interfaces.

Ah right. It's been a while since I wrote that code and I never
got a chance to test it since the system where I'd seen the problem
was already in production.

This patch will probably do it. Can you test it?

-- 
see shy jo
Index: ethdetect.sh
===================================================================
--- ethdetect.sh        (revision 65557)
+++ ethdetect.sh        (working copy)
@@ -254,17 +254,11 @@
        fi
 done
 
-# Some modules only try to load firmware once brought up. So bring up and
-# then down all interfaces.
-for iface in $(lsifaces); do
-       ip link set "$iface" up || true
-       ip link set "$iface" down || true
-done
 db_get ethdetect/prompt_missing_firmware
 if [ "$RET" = true ]; then
-       check-missing-firmware
+       check-missing-firmware $(lsifaces)
 else
-       check-missing-firmware -n
+       check-missing-firmware -n $(lsifaces)
 fi
 
 sysfs-update-devnames || true
Index: debian/changelog
===================================================================
--- debian/changelog    (revision 65557)
+++ debian/changelog    (working copy)
@@ -1,3 +1,14 @@
+hw-detect (1.82) UNRELEASED; urgency=low
+
+  * check-missing-firmware: When called from ethdetect, take interfaces
+    up and down each time through the loop. Previously this was only done
+    once, which caused a bug, as the first pass through does not prompt
+    for missing firmware, and on subsequent passes, the firmware was not
+    requested. Closes: #537502
+    (Thanks, Asbjørn Sloth Tønnesen)
+
+ -- Joey Hess <jo...@debian.org>  Tue, 23 Nov 2010 12:42:30 -0400
+
 hw-detect (1.81) unstable; urgency=low
 
   [ Thibaut Girka ]
Index: check-missing-firmware.sh
===================================================================
--- check-missing-firmware.sh   (revision 65557)
+++ check-missing-firmware.sh   (working copy)
@@ -11,6 +11,8 @@
        NONINTERACTIVE=""
 fi
 
+IFACES="$@"
+
 log () {
        logger -t check-missing-firmware "$@"
 }
@@ -32,7 +34,18 @@
        fi
 }
 
+# Some modules only try to load firmware once brought up. So bring up and
+# then down any interfaces specified by ethdetect.
+upnics() {
+       for iface in $IFACES; do
+               ip link set "$iface" up || true
+               ip link set "$iface" down || true
+       done
+}
+
 check_missing () {
+       upnics
+
        # Give modules some time to request firmware.
        sleep 1
        
@@ -221,7 +234,7 @@
        fi
 
        # remove and reload modules so they see the new firmware
-       # Sort to only reload a given module once if it ask for more
+       # Sort to only reload a given module once if it asks for more
        # than one firmware file (example iwlagn)
        for module in $(echo $modules | tr " " "\n" | sort -u); do
                modprobe -r $module || true

Attachment: signature.asc
Description: Digital signature

Reply via email to