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 9C4F6DC053F; Mon, 27 Jul 2015 10:00:58 +0000 (UTC) Received: from ncopa-desktop.alpinelinux.org (unknown [79.160.13.133]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: n@tanael.org) by mail.alpinelinux.org (Postfix) with ESMTPSA id B4EE1DC04B8; Mon, 27 Jul 2015 10:00:56 +0000 (UTC) Date: Mon, 27 Jul 2015 12:00:52 +0200 From: Natanael Copa To: Rob Landley Cc: Alan Pillay , alpine-devel@lists.alpinelinux.org, judecn@gmail.com, sin@2f30.org, hiltjo@codemadness.org, frank@tuxrocks.com, dev@frign.de Subject: Re: [alpine-devel] Re: udev replacement on Alpine Linux Message-ID: <20150727120052.315fa82b@ncopa-desktop.alpinelinux.org> In-Reply-To: <55B4554A.6020708@landley.net> References: <55B4554A.6020708@landley.net> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-alpine-linux-musl) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP On Sat, 25 Jul 2015 22:34:34 -0500 Rob Landley wrote: > On 07/25/2015 07:11 PM, Alan Pillay wrote: > > Dear Alpine Linux developers and mailing-list lurkers, > > > > udev is currently being used on Alpine version 3.2.2, but we all know > > it detracts from the philosophy to keep things simple, small and > > efficient. > > There are many programs out there that could replace udev and help > > Alpine get in a better shape. I will list some that I know. > > > > [mdev] there are 2 mdev implementations that I know, busybox's and > > toybox's. On Alpine Linux, busybox already comes installed by default > > (and its mdev comes with it, which is weird since it isn't currently > > used, but I digress) > > I'm the primary developer of toybox and the original author of busybox > mdev, but busybox's mdev has grown a lot of new features over the years > that toybox doesn't implement yet. Busybox mdev has lots of feature/solutions for problems that I think should not been there in first place. For example firmware loading, now handled by kernel, device node creation could be handled by devtmpfs (if we want be able to optionally use udev for Xorg we will need devtmpfs anyway). busybox mdev has also a solution for serialization of the hotplug events, which I think is an ugly hack. Code could have been simpler by just reading events from netlink. > I'm happy to add them, but am mostly waiting for patches from the users > telling me what they need. (My own embedded systems mostly just use > devtmpfs, they don't tend to hotplug a lot of stuff.) So what I have been thinking: a netlink socket activator[1], which when there comes an event, fork and execs a handler and passes over the the netlink socket. The handler reads various events from netlink socket. It should be able load kernel modules without forking, and ideally, it should be able to handle each event without forking, including doing blkid lookups without forking. After one or two seconds without any netlink event it will exit and the socket activator takes over again. There was a huge thread about netlink and mdev in busybox mailing list. There were some strong opinions of making a more general read events from any pipe, but I think that needlessly complicates things. I am also interested in loading modules without forking, so I was thinking of making modprobe read modaliases from a stream. Doing so in busybox would require a major refactoring so I instead looked at using libkmod for that. But then libkmod only works with binary format of modaliases so busybox depmod needed a fix[2][3] to generate a binary format of the indexes so libkmod can read those. The current plan is to use nlsockd as socket activator, a netlink reader[4] which will load kernel modules with libkmod and fork mdev - but only on the relevant events - those who has DEVNAME set. > If there's interest in my fleshing out toybox's mdev, I can bump it up > the todo list, but I tend to be chronically overcommitted so need > repeated poking... What I might be interested in is making toybox mdev read events from a netlink socket (stdin or other filedescriptor), add support for loading modaliases without forking. -nc [1]: http://git.alpinelinux.org/cgit/user/ncopa/nlplug/tree/nlsockd.c [2]: http://lists.busybox.net/pipermail/busybox/2015-July/083143.html [3]: http://lists.busybox.net/pipermail/busybox/2015-July/083142.html [4]: http://git.alpinelinux.org/cgit/user/ncopa/nlplug/tree/nlplug.c --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---