Package: firmware-b43-installer
Version: 1:019-2
Severity: minor

The obvious fix for #756664 should actually fix this issue, but I believe
the proper procedure is to report this as a separate bug.

The error checking during firmware download/installation is incorrect and
missing a few steps.  Notably if `wget` fails (perhaps for running out of
space on /tmp) the postinst script exits with a return code of 0, which
indicates to dpkg that installation was successful, which it isn't.  The
other two steps very likely to fail are `tar` (again space in /tmp) and
b43-fwcutter (misc reasons).

Suggested patch:

--- ./var/lib/dpkg/info/firmware-b43-installer.postinst.orig  2015-04-05 
19:21:07.000000000 -0700
+++ ./var/lib/dpkg/info/firmware-b43-installer.postinst  2016-03-23 
19:12:46.000000000 -0700
@@ -24,16 +24,22 @@
 
 if ! wget --timeout=60 
http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2 ; then
        echo "Some problem occurred during the firmware download. Please check 
your internet connection."
-       exit 0
+       exit 1
     else
        if [ -d /lib/firmware/b43 ]; then
           echo "Deleting old extracted firmware..."
           rm -rf /lib/firmware/b43
        fi
 fi
-tar xvjf broadcom-wl-5.100.138.tar.bz2
+if ! tar xvjf broadcom-wl-5.100.138.tar.bz2 ; then
+       echo "Unpacking firmware file failed, unable to continue (is /tmp 
full?)."                                                                        
      
+       exit 1
+fi
 cd broadcom-wl-5.100.138/linux
-b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" wl_apsta.o
+if ! b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" wl_apsta.o ; then
+       echo "Extraction of firmware from wl_apsta.o failed, unable to 
continue."
+       exit 1
+fi
 rm -rf $tmp
 }

Note, small adjustments will be needed if #810161 and/or #819129 are
adopted.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sig...@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445

Reply via email to