Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 84431 - net-wireless/bluez-utils udev helper
Summary: net-wireless/bluez-utils udev helper
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Mobile Herd (OBSOLETE)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-03-07 13:17 UTC by Bash
Modified: 2006-04-15 12:45 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Should resides in /etc/hotplug/ directory (bluetooth.agent,593 bytes, text/plain)
2005-03-07 13:19 UTC, Bash
Details
Hintful for gentoo net.agent patch (net.agent.patch,643 bytes, patch)
2005-03-07 14:26 UTC, Bash
Details | Diff
/etc/hotplug.d/bluetooth/bluetooth (bluetooth.hotplug,799 bytes, text/plain)
2005-10-23 04:14 UTC, Henrik Brix Andersen
Details
Proposed /etc/udev/rules.d/70-bluetooth.rules (70-bluetooth.rules,84 bytes, text/plain)
2005-11-03 04:30 UTC, Henrik Brix Andersen
Details
Proposed /etc/udev/scripts/bluetooth.sh (bluetooth.sh,485 bytes, text/plain)
2005-11-03 04:31 UTC, Henrik Brix Andersen
Details
Proposed /etc/udev/rules.d/70-bluetooth.rules (70-bluetooth.rules,82 bytes, text/plain)
2005-11-11 05:54 UTC, Henrik Brix Andersen
Details
Proposed /etc/udev/scripts/bluetooth.sh (bluetooth.sh,567 bytes, text/plain)
2005-11-11 05:55 UTC, Henrik Brix Andersen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bash 2005-03-07 13:17:09 UTC
I have USB bluetooth dongle adapter (I believe Im not alone :])
and I use hotplug package for auto modules loading and starting bluetooth related services (like hcid, sdpd, etc). But there is no default bluetooth agent in hotplug package, so I'v made it by myself (it's very simple):)) I offer it for yours examination and  propose to include this one in sys-app/hotplug package.
Comment 1 Bash 2005-03-07 13:19:00 UTC
Created attachment 52866 [details]
Should resides in /etc/hotplug/ directory
Comment 2 Bash 2005-03-07 14:26:43 UTC
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.
Comment 3 Henrik Brix Andersen 2005-04-26 10:19:42 UTC
Adding base-system to CC: since they mainaint sys-apps/hotplug.
Comment 4 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-04-26 14:17:38 UTC
No, I maintain hotplug.
Comment 5 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-04-26 14:18:34 UTC
The net.agent patch isn't acceptable.  We don't spam people in the syslog.
Comment 6 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-04-26 14:19:15 UTC
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.
Comment 7 Henrik Brix Andersen 2005-06-10 07:23:34 UTC
Greg: So an /etc/dev.d/ script for adding this functionality would be the
correct thing - and likely to be accepted?
Comment 8 Bash 2005-06-10 08:33:29 UTC
Meybe it's depricated, but this forks fine for me.
Ok, let's closing...
Comment 9 Henrik Brix Andersen 2005-06-10 08:44:36 UTC
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 ;)
Comment 10 Henrik Brix Andersen 2005-06-11 03:41:26 UTC
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...
Comment 11 Henrik Brix Andersen 2005-10-23 04:14:15 UTC
Created attachment 71270 [details]
/etc/hotplug.d/bluetooth/bluetooth

Greg, how about this one?
Comment 12 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-10-25 15:06:02 UTC
How about a udev rule instead?  We are slowly moving away from the hotplug agent
scripts.

Comment 13 Henrik Brix Andersen 2005-10-26 01:13:16 UTC
(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.

Comment 14 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-10-31 23:16:58 UTC
I don't believe you, you should get a udev event :)
Comment 15 Henrik Brix Andersen 2005-11-03 04:29:42 UTC
(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.
Comment 16 Henrik Brix Andersen 2005-11-03 04:30:35 UTC
Created attachment 72005 [details]
Proposed /etc/udev/rules.d/70-bluetooth.rules
Comment 17 Henrik Brix Andersen 2005-11-03 04:31:21 UTC
Created attachment 72006 [details]
Proposed /etc/udev/scripts/bluetooth.sh

Greg, please review :)
Comment 18 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-11-04 21:06:26 UTC
Do you really want to run "start" on every bluetooth device that is added?

Or should it only startup for the first one?
Comment 19 Henrik Brix Andersen 2005-11-11 05:54:16 UTC
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.
Comment 20 Henrik Brix Andersen 2005-11-11 05:55:08 UTC
Created attachment 72642 [details]
Proposed /etc/udev/scripts/bluetooth.sh
Comment 21 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-11-12 16:51:56 UTC
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.
Comment 22 Henrik Brix Andersen 2005-12-17 07:16:27 UTC
(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.
Comment 23 Henrik Brix Andersen 2006-01-17 10:16:35 UTC
Fixed in net-wireless/bluez-utils-2.24.
Comment 24 Mark Barrett 2006-04-15 06:25:32 UTC
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?
Comment 25 Henrik Brix Andersen 2006-04-15 11:01:12 UTC
(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"?
Comment 26 Mark Barrett 2006-04-15 12:45:58 UTC
(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 :)