X-Original-To: alpine-devel@mail.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id EA343DC46B1 for ; Sat, 16 Jan 2016 18:25:04 +0000 (UTC) Received: from mail-ob0-f179.google.com (mail-ob0-f179.google.com [209.85.214.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id C5420DC090A for ; Sat, 16 Jan 2016 18:25:04 +0000 (UTC) Received: by mail-ob0-f179.google.com with SMTP id vt7so134593415obb.1 for ; Sat, 16 Jan 2016 10:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HTheBPEdKzsJaVWkGjct48d0EZEyx6qms0K+YVutCfk=; b=z5nL6DfjsAoUWzUEXSgkaYF934aPmOBULEU63lsvEmomqDXOX3qyuBWTgAVwacaTqO c2gSdvZtzZhD1RtHaOtkQbxK3fHkLQDDW+TwsSIkDnArsw1G5iZvgTIJ3G5TWe+GFyoM LPi+iJmxLd0BqM3RI49QZcA+Y4ztcEYBwS/zZcX/hN5aWob9qIH7zmK2wJtzmu4rNCfc Ff3RTqiQmhHq/la01eNfTNitFQd592GLMj6kZmx/U/dGwIljJ/ZRpKwistH79deOmM/M Da6PF3bZsFHyEz4IEaI55elroYgpR+zcDVTsBUDlqCjjCWQDPv3F0gXe1oNNmZaaH85v 0Kvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=HTheBPEdKzsJaVWkGjct48d0EZEyx6qms0K+YVutCfk=; b=ZgDyMsxLv9vhLLxGbK0Y+qTulXxbLTj91eTFGBXS5HaOJg7nqXihJY8TRnx1SuVpw6 9FipB9cmdzXAZzzLHbOncEt2ehvaL9ik7BdSyoR3Qgx7iv6eOuDZmLUaHLwrq2FuL+JQ wMDpVD2R7cZC9XEJApbNrQJidy0UQKRyTFtuiB4rASEDRyGUk1KYIcKbcJavemjCUtB8 3cTxCcla/Cc34N+c9UBCOaY6q0fvCA0rzp0yd1XOH6W3C97EBvIQGyJvYz5sxpATvKdM if1tR3ijPgQdPINahKUdOYXrxKGPLYbk34bh/DrE14gbyecmAzVNbEm14o1a7JkaBMa5 lWMQ== X-Gm-Message-State: ALoCoQkbQVl+4LPdYtfsfTo4QDuOLE5autYw+TO4pLh7hSXjQ1OBVlVoxuCTuxiBubRqkRIZKmH6sET9P7FwhMjh3JYcRQ7ZOQ== X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 X-Received: by 10.182.19.234 with SMTP id i10mr13122936obe.67.1452968703950; Sat, 16 Jan 2016 10:25:03 -0800 (PST) Received: by 10.202.81.6 with HTTP; Sat, 16 Jan 2016 10:25:03 -0800 (PST) In-Reply-To: <20160115045451.GA10573@newbook> References: <20150728052436.GC1923@newbook> <20160112153804.GI32545@example.net> <56953ABE.5090203@skarnet.org> <56958E22.90806@skarnet.org> <56964414.1000605@skarnet.org> <56978822.8020205@skarnet.org> <20160115045451.GA10573@newbook> Date: Sat, 16 Jan 2016 13:25:03 -0500 Message-ID: Subject: Re: [alpine-devel] udev replacement on Alpine Linux From: Jude Nelson To: Isaac Dunham Cc: Laurent Bercot , alpine-devel@lists.alpinelinux.org Content-Type: multipart/alternative; boundary=001a11c2c7be7805de052977a360 X-Virus-Scanned: ClamAV using ClamSMTP --001a11c2c7be7805de052977a360 Content-Type: text/plain; charset=UTF-8 Hi Isaac, On Thu, Jan 14, 2016 at 11:54 PM, Isaac Dunham wrote: > On Thu, Jan 14, 2016 at 12:36:02PM +0100, Laurent Bercot wrote: > > On 14/01/2016 06:55, Jude Nelson wrote: > > >I think you're close. The jist of it is that vdev needs to supply a > > >lot more information than the kernel gives it. In particular, its > > >helper programs go on to query the properties and status of each > > >device (this often requires root privileges, i.e. via privileged > > >ioctl()s), and vdev gathers the information into a (much larger) > > >event packet and stores it in a directory tree under /dev for > > >subsequent query by less-privileged programs. > > > > I see. > > I think this is exactly what could be made modular. I've heard > > people say they were reluctant to using vdev because it's not KISS, and > > I suspect the ioctl machinery and data gathering is a large part of > > the complexity. If that part could be pluggable, i.e. if admins could > > choose a "data gatherer" just complex enough for their needs, I believe > > it could encourage adoption. In other words, I'm looking at a 3-part > > program: > > - the netlink listener > > - the data gatherer > > - the event publisher > > > > Of course, for libudev to work, you would need the full data gatherer; > > but if people aren't using libudev programs, they can use a simpler one, > > closer to what mdev is doing. > > It's all from a very high point-of-view, and I don't know the details of > > the code so I have no idea whether it's envisionable for vdev, but that's > > what I'm thinking off the top of my head. > > I haven't really looked at the vdevd code in a while, but from what > I recollect... > The vdev/libudev-compat "solution" is split up as follows: > -the netlink listener, vdevd > -several data gatherers, which are invoked according to a set of rules > for vdevd (analogous to mdev.conf) > -helper scripts to create extra links and so on, run via the same rules > -I don't recall exactly how the event publishing is done, but IIRC, > there's a daemon watching the directory where the helpers write out the > data, and then distributing it as described -libudev-compat is libudev, patched to read events that are published > as described > -IIRC, there's some helper that will (also? instead?) maintain a list of > devices more like the way udev does, so you don't *need* libudev-compat. > Yup--all the requisite device state is maintained under /dev/metadata. The libudev-compat event helper behaves just like any other vdev/mdev-style script--when invoked, it reads /dev/metadata for a given device, sets up the appropriate files in /run/udev, and generates, writes, and hard-links the event-file (which libudev-compat clients detect and consume). Libudev-compat is totally unnecessary if device-aware programs and scripts can get away with reading and watching the contents of /dev/metadata. -Jude --001a11c2c7be7805de052977a360 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Isaac,

On Thu, Jan 14, 2016 at 11:54 PM, Isaac Dunham &= lt;ibid.ag@gmail.com= > wrote:
On Thu, Jan 14, 2016 at 12:36:02PM +0100, Laurent Ber= cot wrote:
> On 14/01/2016 06:55, Jude Nelson wrote:
> >I think you're close.=C2=A0 The jist of it is that vdev needs = to supply a
> >lot more information than the kernel gives it.=C2=A0 In particular= , its
> >helper programs go on to query the properties and status of each > >device (this often requires root privileges, i.e. via privileged > >ioctl()s), and vdev gathers the information into a (much larger) > >event packet and stores it in a directory tree under /dev for
> >subsequent query by less-privileged programs.
>
>=C2=A0 I see.
>=C2=A0 I think this is exactly what could be made modular. I've hea= rd
> people say they were reluctant to using vdev because it's not KISS= , and
> I suspect the ioctl machinery and data gathering is a large part of > the complexity. If that part could be pluggable, i.e. if admins could<= br> > choose a "data gatherer" just complex enough for their needs= , I believe
> it could encourage adoption. In other words, I'm looking at a 3-pa= rt
> program:
>=C2=A0 - the netlink listener
>=C2=A0 - the data gatherer
>=C2=A0 - the event publisher
>
>=C2=A0 Of course, for libudev to work, you would need the full data gat= herer;
> but if people aren't using libudev programs, they can use a simple= r one,
> closer to what mdev is doing.
>=C2=A0 It's all from a very high point-of-view, and I don't kno= w the details of
> the code so I have no idea whether it's envisionable for vdev, but= that's
> what I'm thinking off the top of my head.

I haven't really looked at the vdevd code in a while, but f= rom what
I recollect...
The vdev/libudev-compat "solution" is split up as follows:
-the netlink listener, vdevd
-several data gatherers, which are invoked according to a set of rules
for vdevd (analogous to mdev.conf)
-helper scripts to create extra links and so on, run via the same rules
-I don't recall exactly how the event publishing is done, but IIRC,
there's a daemon watching the directory where the helpers write out the=
data, and then distributing it as described
-libudev-compat is libudev, patched to read events that are published
as described
-IIRC, there's some helper that will (also? instead?) maintain a list o= f
devices more like the way udev does, so you don't *need* libudev-compat= .=C2=A0

Yup--all the requisite device s= tate is maintained under /dev/metadata.=C2=A0 The libudev-compat event help= er behaves just like any other vdev/mdev-style script--when invoked, it rea= ds /dev/metadata for a given device, sets up the appropriate files in /run/= udev, and generates, writes, and hard-links the event-file (which libudev-c= ompat clients detect and consume).=C2=A0 Libudev-compat is totally unnecess= ary if device-aware programs and scripts can get away with reading and watc= hing the contents of /dev/metadata.

-Jude

=
--001a11c2c7be7805de052977a360-- --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---