Skip to contentSkip to conversation

UDEV rule for uploading firmware

DISCUSSION Berthold Höllmann 3 participants 4 messages Dec 24, 2006 – Dec 26, 2006

lore
Share & tools
lore
#0 lore raw

I try to fix a UDEV rule for uploading firmware for an USB audio device. The tool madfuload has to get the device name in either the DEVICE environment variable or via a command line switch. The original rule as delivered with the program is:

ACTION="add", SUBSYSTEM="usb", DEVPATH="/*.0", ENV{PRODUCT}="763/2806/*", RUN+="/usr/local/sbin/madfuload -l -3 -f /usr/local/share/usb/maudio/ma006100.bin"

But this gives only

madfuload: --device not given, and DEVICE not set

in /var/log/messages when I attach the device.

I tried a lot with the command line, even hardcoding the next predictable device name, but always get

madfuload: cannot open '/dev/.tmp-0-0': No such device or address

or

madfuload: cannot open /dev/bus/usb/005/028: No such file or directory

even when a manual call with /dev/bus/usb/005/028 is successfull afterwards.

The original rule file name is 42-madfuload.rules and I tried to increase the leading number to get the rules applied later in the chain, but no go.

With SuSE 10.1 I fixed the problem by reactivating the usbfs mount by fixing the /etc/fstab, but with openSuSE 10.2 I only get

# mount -a
mount: mount point /proc/bus/usb does not exist
# pre SuSE 10.1
#usbfs                /proc/bus/usb        usbfs      noauto
#0 0
# SuSE 10.1
/dev/bus/usb         /proc/bus/usb        usbfs      defaults              0 0

Is there a way to fix this problem in udev, do I have to change my fstab entry or do I have to switch to a different tool like HAL?

Thanks
Berthold

Signature · 13 lines
[email protected] / <http://höllmanns.de/>
[email protected]                 / <http://starship.python.net/crew/bhoel/>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw

I try to fix a UDEV rule for uploading firmware for an USB audio device. The tool madfuload has to get the device name in either the DEVICE environment variable or via a command line switch. The original rule as delivered with the program is:

ACTION="add", SUBSYSTEM="usb", DEVPATH="/*.0", ENV{PRODUCT}="763/2806/*", RUN+="/usr/local/sbin/madfuload -l -3 -f /usr/local/share/usb/maudio/ma006100.bin"

But this gives only

madfuload: --device not given, and DEVICE not set

in /var/log/messages when I attach the device.

I tried a lot with the command line, even hardcoding the next predictable device name, but always get

madfuload: cannot open '/dev/.tmp-0-0': No such device or address

or

madfuload: cannot open /dev/bus/usb/005/028: No such file or directory

even when a manual call with /dev/bus/usb/005/028 is successfull afterwards.

The original rule file name is 42-madfuload.rules and I tried to increase the leading number to get the rules applied later in the chain, but no go.

With SuSE 10.1 I fixed the problem by reactivating the usbfs mount by fixing the /etc/fstab, but with openSuSE 10.2 I only get

# mount -a
mount: mount point /proc/bus/usb does not exist
# pre SuSE 10.1
#usbfs                /proc/bus/usb        usbfs      noauto
#0 0
# SuSE 10.1
/dev/bus/usb         /proc/bus/usb        usbfs      defaults              0 0

Is there a way to fix this problem in udev, do I have to change my fstab entry or do I have to switch to a different tool like HAL?

Thanks
Berthold

Signature · 12 lines
[email protected] / <http://höllmanns.de/>
[email protected]                 / <http://starship.python.net/crew/bhoel/>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#2 lore raw
In reply to Berthold Höllmann
Quoted 6 lines · Berthold Höllmann

I try to fix a UDEV rule for uploading firmware for an USB audio device. The tool madfuload has to get the device name in either the DEVICE environment variable or via a command line switch. The original rule as delivered with the program is:

ACTION="add", SUBSYSTEM="usb", DEVPATH="/*.0", ENV{PRODUCT}="763/2806/*", RUN+="/usr/local/sbin/madfuload -l -3 -f /usr/local/share/usb/maudio/ma006100.bin"

Try hooking into the "usb_device" event, not "usb". The device node may not be around at the time you receive the "usb" event. You need to match on sysfs vendor/product values to indentify your device then. The device-node path is available in the event environment of the "usb_device" event so you can pass it to the called tool.

Quoted 10 lines

But this gives only

madfuload: --device not given, and DEVICE not set

in /var/log/messages when I attach the device.

I tried a lot with the command line, even hardcoding the next predictable device name, but always get

madfuload: cannot open '/dev/.tmp-0-0': No such device or address

These are the major/minor numbers, 0-0 should never exist. You can create and access a temp-node with $temnode in udev-rules, but you should not need this. All the temp-node stuff is only needed for accessing the device _before_ the device-naming happened.

Quoted 12 lines

madfuload: cannot open /dev/bus/usb/005/028: No such file or directory

even when a manual call with /dev/bus/usb/005/028 is successfull afterwards.

The original rule file name is 42-madfuload.rules and I tried to increase the leading number to get the rules applied later in the chain, but no go.

With SuSE 10.1 I fixed the problem by reactivating the usbfs mount by fixing the /etc/fstab, but with openSuSE 10.2 I only get

Quoted 8 lines
# mount -a
mount: mount point /proc/bus/usb does not exist
# pre SuSE 10.1
#usbfs                /proc/bus/usb        usbfs      noauto
#0 0
# SuSE 10.1
/dev/bus/usb         /proc/bus/usb        usbfs      defaults              0 0

SUSE already disabled usbfs in the kernel, as it is no longer needed today and can't handle ACL's needed for multi-user setups. Other distros will need to do the same, when we ship a "pam_console"-successor along with HAL.

Quoted 2 lines

Is there a way to fix this problem in udev, do I have to change my fstab entry or do I have to switch to a different tool like HAL?

Usbfs is dead, also the DEVICE environment variable. HAL should work the same way as udev. Hooking into the right event with udev should just do it.

Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Berthold Höllmann
Quoted 6 lines · Kay Sievers
Quoted 5 lines · Berthold Höllmann

I try to fix a UDEV rule for uploading firmware for an USB audio device. The tool madfuload has to get the device name in either the DEVICE environment variable or via a command line switch. The original rule as delivered with the program is:

Quoted 7 lines
Quoted 1 line

ACTION="add", SUBSYSTEM="usb", DEVPATH="/*.0", ENV{PRODUCT}="763/2806/*", RUN+="/usr/local/sbin/madfuload -l -3 -f /usr/local/share/usb/maudio/ma006100.bin"

Try hooking into the "usb_device" event, not "usb". The device node may not be around at the time you receive the "usb" event. You need to match on sysfs vendor/product values to indentify your device then. The device-node path is available in the event environment of the "usb_device" event so you can pass it to the called tool.

Thanks for your help. For the records, the working solution (at least for me) is:

ACTION="add", SUBSYSTEM="usb_device", SYSFS{idVendor}="0763", SYSFS{idProduct}="2806", RUN+="/usr/local/sbin/madfuload -l -3 -f /usr/local/share/usb/maudio/ma006100.bin -D $env{DEVNAME}"

Kind regards
Berthold

Signature · 12 lines
[email protected] / <http://höllmanns.de/>
[email protected]                 / <http://starship.python.net/crew/bhoel/>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel