Re: why does udev-167 break /lib64/udev/firmware ?

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

 



On Thu, Apr 14, 2011 at 18:53, Jason Vas Dias <jason.vas.dias@xxxxxxxxx> wrote:
> Â 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

There is something seriously broken on your system:

First, there is no /lib64/udev/ directory for udev ever. Gentoo should
finally stop doing that nonsense. /lib64 is for shared libs only, the
application private directory is /lib/udev/ regardless of the
architecture.

Also all udev default rules like the firmware loader live in
/lib/udev/rules.d/, not in /etc/udev/rules.d/. /etc is only for
admins, not for packages.

Udev's firmware binary does never link against libusb:
  $ # ldd /lib/udev/firmware
	linux-vdso.so.1 =>  (0x00007fff011ff000)
	librt.so.1 => /lib64/librt.so.1 (0x00007fd2e37ea000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fd2e347d000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fd2e3279000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fd2e3c12000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd2e305c000)

The udev shipped rules file looks like this:
  $ cat /lib/udev/rules.d/50-firmware.rules
  # do not edit this file, it will be overwritten on update

  # firmware-class requests, copies files into the kernel
  SUBSYSTEM=="firmware", ACTION=="add", \
    RUN+="firmware --firmware=$env{FIRMWARE} --devpath=$env{DEVPATH}"

Seems there is a lot to do to clean up the mess you have on your box.
That's nothing we can fix here. :)

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

That should work fine, and does work here.

Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux