linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* why does udev-167 break /lib64/udev/firmware ?
@ 2011-04-14 16:53 Jason Vas Dias
  2011-04-14 17:13 ` Kay Sievers
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Jason Vas Dias @ 2011-04-14 16:53 UTC (permalink / raw)
  To: linux-hotplug

Hi - 
 
   I upgraded to the gentoo version of udev-167 today and found that my wireless interface ( a b43 )
   was disabled,  that I only now ( a few hours later ) now found was because /lib64/udev/firmware
   seems to be thoroughly broken (and somehow the gentoo's firmware loading rules usually in
   /etc/udev/rules.d/50_firmware had disappeared - maybe because they couldn't get this program
   to work either ? ) 

   Having cobbled together a new /etc/udev/rules.d/50_firmware :
  
   SUBSYSTEM="firmware", ACTION="add", RUN+="/lib64/udev/firmware"

   "firmware" simply emits some error message the first line of which contains "libusb: main.c:" 
   for valid arguments and does nothing .  I double, triple-checked that the correct "FIRMWARE_PATH"
   is generated during config . 
   
   But the whole idea of using some complicated libusb internal function,  or even any new executable program,
   is incomprehensible to me - to implement these few lines of shell script , which I ended up having to write,
   because udev's complicated libusb method failed - so I'm posting here in the hope that udev will see sense
   and give us a working firmware script instead of some broken libusb using executable, and to help anyone
   else caught by the same issue:

   to fix, as root:
   #  mv /lib64/udev/firmware /lib64/udev/firmware.broken
   #  cat <<'EOF' 
#!/bin/bash
logger "FIRMWARE: $1 $2"
if  ! echo "$1" | egrep -q '^--firmware' ; then 
   logger "FIRMWARE: bad firmware arg: $1";
   exit 1;
elif ! echo "$2" | egrep -q '^--devpath' ; then 
   logger "FIRMWARE: bad  devpath arg: $2";
   exit 1;
fi
firmware=$1
firmware=${firmware#--firmware=}
devpath=$2
devpath=${devpath#--devpath=}
if [ ! -f /sys/${devpath}/loading ] ; then
   logger "FIRMWARE: no loading: /sys/${devpath}/loading";
   exit 1;
fi
if [ ! -f /sys/${devpath}/data ] ; then
   logger "FIRMWARE: no data: /sys/${devpath}/data";
   exit 1;
fi
echo 1 > /sys/${devpath}/loading
cp -fp /lib64/firmware/${firmware} /sys/${devpath}/data;
status=$?;
echo 0 > /sys/${devpath}/loading
logger "FIRMWARE: copied /lib64/firmware/$firmware to /sys/${devpath}/loading OK: $status"
exit $status;
EOF
     >> /lib64/udev/firmware; chmod a+rx /lib64/udev/firmware


P.S. why doesn't udev use libusb-1.0 ? Rebuilding against libusb-0.1-compat didn't help though.

Sorry, new to this list - please reply to : jason.vas.dias@gmail.com

All the best,
Jason.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-04-24 19:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-14 16:53 why does udev-167 break /lib64/udev/firmware ? Jason Vas Dias
2011-04-14 17:13 ` Kay Sievers
2011-04-14 19:03 ` Jason Vas Dias
2011-04-14 19:29 ` Jason Vas Dias
2011-04-14 21:26 ` Kay Sievers
2011-04-14 22:56 ` Jason Vas Dias
2011-04-14 23:00 ` Kay Sievers
2011-04-24 19:53 ` Matthias Schwarzott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).