Re: [Utopia] kernel -> dbus event delivery?



On Fri, 2004-07-09 at 19:18 +0200, Kay Sievers wrote:

> Here is the next round. I've made a small bridge from the netlink socket
> to the dbus-system-daemon. Everything needed, you can get from here:
> 
>   http://vrfy.org/projects/kdbusd/
> 
> Just patch your kernel, install the dbus-policy, compile and run './kdbusd' and
> watch the emitted dbus-events with 'python kernel-listen.py', while mounting a
> filesystem or putting a media in your CDROM. Easy, isnt't it :)

Awesome, Kay!

> here is what I've learned last night:
>   The netlink event delivery is a really nice architecture. It's pretty
>   much easy as listen for UDP packets on a network socket. You need to be
>   root, just open the socket and wait for the incoming messages. The
>   kernel sends the messages as multicast, so it's possible to have
>   _multiple_ listeners for the same message. The kernel generated message is
>   sent to one of 32 possible multicast groups, a client can subscribe to (look
>   at groups in kdbusd),

netlink is very nice.

> naming:
>   As the composed message has nothing to do with dbus, and any low
>   level thing may listen directly to the kernel, shouldn't be the kernel
>   part renamed to 'uevent', 'eventlink' or something better?

Yes, it should be renamed.  I don't care to what.

> message format
>   I want to be able to send hotplug messages on a new group, so what is the
>   best raw format to compose it. We need to pass several key value pairs, like
>   we do in the environment of the hotplug call today. Should the strings be:
>     'KEY=value\0KEY2=value2\0', or should we use
>     'KEY:value\nKEY2:value2\n\n', like the mail header format?

Off the top of my head, I would use '\n' as the delimiter ...

>   (As a proof of the concept, I will probably convert udevd to listen on the
>    socket, instead of getting the message by the forked udevsend helper)

Neat.

	Robert Love





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