Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: kumba@g.o
Subject: Re: [gentoo-dev] Make udev optional in net-wireless/bluez?
Date: Mon, 10 Mar 2014 17:27:43
Message-Id: 20140310182725.7813467e@pomiot.lan
In Reply to: Re: [gentoo-dev] Make udev optional in net-wireless/bluez? by Joshua Kinard
1 Dnia 2014-03-10, o godz. 06:57:22
2 Joshua Kinard <kumba@g.o> napisał(a):
3
4 > On 03/10/2014 5:55 AM, Samuli Suominen wrote:
5 > >
6 > > On 10/03/14 10:48, Joshua Kinard wrote:
7 > >> On 03/10/2014 2:59 AM, Alexandre Rostovtsev wrote:
8 > >>> On Mon, 2014-03-10 at 01:45 -0400, Alexandre Rostovtsev wrote:
9 > >>>> On Sun, 2014-03-09 at 23:22 -0400, Joshua Kinard wrote:
10 > >>>>> On 03/08/2014 9:55 PM, Alexandre Rostovtsev wrote:
11 > >>>>>> On Sat, 2014-03-08 at 21:23 -0500, Joshua Kinard wrote:
12 > >>>>>>> So I want to try and play around with a particular network domination tool
13 > >>>>>>> on my home network, Omphalos. However, its current configure script has a
14 > >>>>>>> hard dependency on bluetooth.h, part of the net-wireless/bluez package.
15 > >>>>>>>
16 > >>>>>>> Currently, net-wireless/bluez has a harddep on virtual/udev, which works
17 > >>>>>>> great if you use either udev or eudev. I'm using busybox's mdev instead, so
18 > >>>>>>> the logic of the bluez ebuild needs some changes:
19 > >>>>>> [...]
20 > >>>>>>> Thoughts on this?
21 > >>>>>> Does mdev have any API which is equivalent to libudev's hwdb? See
22 > >>>>>> http://www.freedesktop.org/software/systemd/libudev/libudev-udev-hwdb.html
23 > >>>>>>
24 > >>>>>> If yes, then optimal solution would be to patch bluez to allow using
25 > >>>>>> mdev's hwdb support, and get the patch upstreamed :)
26 > >>>>> It's actually not a matter of the hwdb support, it's just the fact that
27 > >>>>> bluez currently has a harddep on a specific device manager, either udev or
28 > >>>>> eudev.
29 > >>>> Bluez does not require an abstract device manager. It requires the
30 > >>>> libudev library. Or rather, it requires some kind of library which
31 > >>>> provides the following API:
32 > >>>>
33 > >>>> 1. querying hwdb (given a kernel modalias for a device, retrieve
34 > >>>> corresponding oui, vendor, and model data); and
35 > >>>> 2. querying the device tree (manually traversing /sys is of course
36 > >>>> possible, but not very easy to do correctly, so bluez developers are
37 > >>>> relying on libudev).
38 > >>> And by "requires", I mean that without libudev, a variety of bluetooth
39 > >>> devices and adapters will simply fail to work.
40 > >>>
41 > >>> So if mdev does not have some equivalent of libudev, a reasonable
42 > >>> solution would probably be the following:
43 > >>>
44 > >>> @@ -14,19 +14,19 @@
45 > >>> LICENSE="GPL-2+ LGPL-2.1+"
46 > >>> SLOT="0/3"
47 > >>> KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86"
48 > >>> -IUSE="cups debug +obex readline selinux systemd test"
49 > >>> +IUSE="cups debug +obex readline selinux systemd test +udev"
50 > >>> REQUIRED_USE="test? ( ${PYTHON_REQUIRED_USE} )"
51 > >>>
52 > >>> RDEPEND="
53 > >>> >=dev-libs/glib-2.28:2
54 > >>> >=sys-apps/dbus-1.6:=
55 > >>> >=sys-apps/hwids-20121202.2
56 > >>> - >=virtual/udev-171
57 > >>> cups? ( net-print/cups:= )
58 > >>> obex? ( dev-libs/libical )
59 > >>> readline? ( sys-libs/readline:= )
60 > >>> selinux? ( sec-policy/selinux-bluetooth )
61 > >>> systemd? ( sys-apps/systemd )
62 > >>> + udev? ( >=virtual/udev-171 )
63 > >>> "
64 > >>> DEPEND="${RDEPEND}
65 > >>> virtual/pkgconfig
66 > >>> @@ -46,6 +46,11 @@
67 > >>> pkg_setup() {
68 > >>> enewgroup plugdev
69 > >>> use test && python-any-r1_pkg_setup
70 > >>> +
71 > >>> + if ! use udev; then
72 > >>> + ewarn "You are installing ${P} with USE=-udev. This means various bluetooth"
73 > >>> + ewarn "devices and adapters from Apple, Dell, Logitech etc. will fail to work."
74 > >>> + fi
75 > >>> }
76 > >>>
77 > >>> src_prepare() {
78 > >>> @@ -92,13 +97,13 @@
79 > >>> $(use_enable test) \
80 > >>> --enable-tools \
81 > >>> --enable-monitor \
82 > >>> - --enable-udev \
83 > >>> + $(use_enable udev) \
84 > >>> $(use_enable cups) \
85 > >>> $(use_enable obex) \
86 > >>> --enable-client \
87 > >>> $(use_enable systemd) \
88 > >>> $(systemd_with_unitdir) \
89 > >>> - --enable-sixaxis
90 > >>> + $(use_enable udev sixaxis)
91 > >>> }
92 > >>>
93 > >>> src_install() {
94 > >>> @@ -134,7 +139,7 @@
95 > >>> pkg_postinst() {
96 > >>> readme.gentoo_print_elog
97 > >>>
98 > >>> - udev_reload
99 > >>> + use udev && udev_reload
100 > >>>
101 > >>> has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp."
102 > >>>
103 > >> Hey, this sounds like it'll work in my case :)
104 > >>
105 > >> I don't use bluetooth, nor udev, so the issues surrounding making udev
106 > >> optional in bluez or not isn't really my concern. Making udev optional was
107 > >> the easier solution than trying to figure out how to cut out the lib/ folder
108 > >> from bluez and wrapping it in a separate libbluetooth package. Thought I'd
109 > >> just suggest the solution to the list for input.
110 > >>
111 > >
112 > > You know, you can have udev installed (to have libudev installed) but
113 > > still run something else, like mdev
114 > > It would likely still work for this case even if udevd daemon isn't running
115 > >
116 > > And yes, I realize it's not perfect for some embedded systems
117 >
118 > Except the tool I wanted to test out, Omphalos, doesn't need _anything_ from
119 > udev or libudev. It wants bluetooth.h and probably whatever .so/.a files
120 > are tied to that specific header:
121 >
122 > [...]
123 >
124 > It's bluez that wants to invite the entire udev/systemd party in, because of
125 > the virtual/udev harddep. So, I modded a local copy of bluez to not need
126 > virtual/udev initially so I could get past Omphalos' bluetooth build
127 > requirement. But I got stopped by the need for wireless, which is not in
128 > the kernel running on my main Linux machine (Ethernet II only, weee).
129
130 I'm sorry but I don't get what you are complaining about.
131
132 Bluez -- that is the package that aims to bring bluetooth support --
133 requires udev to support most of bluetooth hardware, and properly
134 depends on it. You are complaining about that because it collides with
135 your fancy device manager that doesn't have any API that could bring
136 hardware support to bluez.
137
138 So now, do you request that we should provide bluez *without* bluetooth
139 support? Wouldn't the correct solution be to, say, make bluetooth
140 support in your package optional if you don't need it?
141
142 --
143 Best regards,
144 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies