Summary: | net-wireless/bluez-utils udev helper | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Bash <bash83> |
Component: | Current packages | Assignee: | Mobile Herd (OBSOLETE) <mobile+disabled> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | astralbat, gregkh |
Priority: | High | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Should resides in /etc/hotplug/ directory
Hintful for gentoo net.agent patch /etc/hotplug.d/bluetooth/bluetooth Proposed /etc/udev/rules.d/70-bluetooth.rules Proposed /etc/udev/scripts/bluetooth.sh Proposed /etc/udev/rules.d/70-bluetooth.rules Proposed /etc/udev/scripts/bluetooth.sh |
Description
Bash
2005-03-07 13:17:09 UTC
Created attachment 52866 [details]
Should resides in /etc/hotplug/ directory
Created attachment 52868 [details, diff]
Hintful for gentoo net.agent patch
With this patch net.agent produce clever hint for gentoo distribution.
Example: I plug in USB cable from my Zaurus PDA and look at /var/log/messages:
Mar 7 21:06:55 blackhole ohci_hcd 0000:00:02.3: wakeup
Mar 7 21:06:55 blackhole usb 2-1: new full speed USB device using address 28
Mar 7 21:06:55 blackhole usb0: register usbnet at usb-0000:00:02.3-1, Sharp
Zaurus, PXA-2xx based
Mar 7 21:06:55 blackhole net.agent[28204]: Please create /etc/init.d/net.usb0
for your usb0 interface
Mar 7 21:06:55 blackhole net.agent[28204]: *HINT* just run this command: ln
-sf /etc/init.d/net.eth0 /etc/init.d/net .usb0
Mar 7 21:06:55 blackhole net.agent[28204]: and add new config line to
/etc/conf.d/net like this:
Mar 7 21:06:55 blackhole net.agent[28204]: iface_usb0="192.168.50.1 broadcast
192.168.50.255 netmask 255.255.255.0"
Mar 7 21:06:55 blackhole net.agent[28204]: add event not handled
I'm using this methodology (symlink from net.eth0 to net.IFACE and config in
/etc/conf.d/net) for my usb0 iface (for Zaurus) and bnep0 (for bluetooth
network). And all works very well.
Adding base-system to CC: since they mainaint sys-apps/hotplug. No, I maintain hotplug. The net.agent patch isn't acceptable. We don't spam people in the syslog. The bluetooth hotplug agent will not handle multiple devices, right? You should use the /etc/dev.d inteface instead, the /etc/hotplug one is depreciated. Greg: So an /etc/dev.d/ script for adding this functionality would be the correct thing - and likely to be accepted? Meybe it's depricated, but this forks fine for me. Ok, let's closing... Re-opening to get an answer to comment #7 - please don't close bug reports with unanswered questions, especially when the question is from a developer ;) I can't see how an /etc/dev.d/ script can do this - no udev event is generated when I insert my USB bluetooth adaptor... Created attachment 71270 [details]
/etc/hotplug.d/bluetooth/bluetooth
Greg, how about this one?
How about a udev rule instead? We are slowly moving away from the hotplug agent scripts. (In reply to comment #12) > How about a udev rule instead? We are slowly moving away from the hotplug agent > scripts. As noted in comment #10, no udev event was generated when I inserted my bluetooth adapter back then. I'll recheck with latest udev release when I get back home later today - if we can use udev, I would prefer that as well. I don't believe you, you should get a udev event :) (In reply to comment #14) > I don't believe you, you should get a udev event :) I do now (the comment in udev.conf about how to enable debug is outdated, it seems). To make the udev bluetooth rules work with multiple bluetooth adapters, we need to check if any hciX devices are still present before stopping the init script. I have not found a way to do this from a simple udev rule, so I suggest using a script. Created attachment 72005 [details]
Proposed /etc/udev/rules.d/70-bluetooth.rules
Created attachment 72006 [details]
Proposed /etc/udev/scripts/bluetooth.sh
Greg, please review :)
Do you really want to run "start" on every bluetooth device that is added? Or should it only startup for the first one? Created attachment 72641 [details]
Proposed /etc/udev/rules.d/70-bluetooth.rules
I've finally had the chance to test with multiple bluetooth devices, and I've
changed the script + rules slightly.
If there are no objections, I will add these to net-wireless/bluez-utils.
Created attachment 72642 [details]
Proposed /etc/udev/scripts/bluetooth.sh
Put udev scripts in /lib/udev, not under /etc please. No other scripts should be in /etc/udev/scripts/ right now. Other than that, it looks fine to me. (In reply to comment #21) > Put udev scripts in /lib/udev, not under /etc please. No other scripts should > be in /etc/udev/scripts/ right now. Should I put it in as /lib/udev/bluetooth.sh or /lib/udev/scripts/bluetooth.sh ? > Other than that, it looks fine to me. Ok, thank you for looking it over. Fixed in net-wireless/bluez-utils-2.24. Hi, I stumbled on this bug from the udev-event error: run_program: exec of program '/lib/udev/bluetooth.sh' failed in my boot messages. I understand this is because /lib/udev/bluetooth.sh has been removed from bluez-utils and orphaned /etc/udev/rules.d/70-bluetooth.rules on my system. Why has this been taken out? I have a problem with my dongle adapter where it never gets detected on boot and I have to unplug it/plug it back for it to be detected and have my bluetooth mouse usable. Is this anything to do with this bug? (In reply to comment #24) > I understand this is because /lib/udev/bluetooth.sh has been removed from > bluez-utils and orphaned /etc/udev/rules.d/70-bluetooth.rules on my system. What makes you think it has been taken out? Do you have USE="udev"? (In reply to comment #25) > (In reply to comment #24) > > I understand this is because /lib/udev/bluetooth.sh has been removed from > > bluez-utils and orphaned /etc/udev/rules.d/70-bluetooth.rules on my system. > > What makes you think it has been taken out? Do you have USE="udev"? > That's what I was missing - thanks :) |