Support for kmod tmpfiles is required for creating static nodes, see: http://cgit.freedesktop.org/systemd/systemd/commit/?id=f4f8f7b546508e1e7c94b072df685ac1342e8d7e http://cgit.freedesktop.org/systemd/systemd/commit/?id=edeb68c53f1cdc452016b4c8512586a70b1262e3
For example, from my system: $ kmod static-nodes --format=tmpfiles c /dev/ppp 0600 - - - 108:0 d /dev/snd 0755 - - - c /dev/snd/timer 0600 - - - 116:33 d /dev/snd 0755 - - - c /dev/snd/seq 0600 - - - 116:1 ssuominen@null ~ $ kmod static-nodes --format=human Module: ppp_generic Device node: /dev/ppp Type: character device Major: 108 Minor: 0 Module: snd_timer Device node: /dev/snd/timer Type: character device Major: 116 Minor: 33 Module: snd_seq Device node: /dev/snd/seq Type: character device Major: 116 Minor: 1 ssuominen@null ~ $ kmod static-nodes --format=devname ppp_generic ppp c108:0 snd_timer snd/timer c116:33 snd_seq snd/seq c116:1 So there is 3 different formats we can parse from OpenRC and kmod also has --output flag to put the output in a file.
OpenRC support tmpd files so everything we need is to: a). verify that rc/sh/tmpfiles.sh supports creation of static nodes. It's there _c() { # Create a character device node if it doesn't exist yet local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6 [ ! -e "$path" ] && dryrun_or_real mknod $path c ${arg%:*} ${arg#*:} } b). create init script in udev package that will run @KMOD@ static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf before tmpfiles.setup. c). verify that current 0.11.8 version has rc/sh/tmpfiles.sh and init.d/tmpfiles.setup. If not - then backport patches. So everything we need exists in OpenRC codebase and we don't need to add anything there. But we need to create new init script in udev package.
Created attachment 354000 [details] udev kmod init script Please add this init script to udev package. And please create such bugs _BEFORE_ an actual bump!
(In reply to Alexander Vershilov from comment #3) > Created attachment 354000 [details] > udev kmod init script > > Please add this init script to udev package. Why do you think this belongs to sys-fs/udev when udevd explicitely removed support for this? Shouldn't such init script be part of kmod so it'll be installed for eg. mdev as well?
Comment on attachment 354000 [details] udev kmod init script Fails as following: $ kmod --format=tmpfiles --output=/tmp/foo.foo kmod: unrecognized option '--format=tmpfiles' And is missing eend $? to match ebegin as well Plus shouldn't hardcode path to kmod
(In reply to Samuli Suominen from comment #4) > (In reply to Alexander Vershilov from comment #3) > > Created attachment 354000 [details] > > udev kmod init script > > > > Please add this init script to udev package. > > Why do you think this belongs to sys-fs/udev when udevd explicitely removed > support for this? > Shouldn't such init script be part of kmod so it'll be installed for eg. > mdev as well? Udev removed static node creation and provide a unit file that creates tmpfiles.d. This provides same functionality as: diff --git a/units/kmod-static-nodes.service.in b/units/kmod-static-nodes.service.in new file mode 100644 index 0000000..f8a2d47 --- a/dev/null +++ b/units/kmod-static-nodes.service.in @@ -0,0 +1,16 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Create list of required static device nodes for the current kernel +DefaultDependencies=no +Before=sysinit.target systemd-tmpfiles-setup-dev.service + +[Service] +Type=oneshot +ExecStartPre=/usr/bin/mkdir -p /run/tmpfiles.d +ExecStart=@KMOD@ static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf bt because systemd has logically built-in udev and common codebase, they can move this service between folders and say smth about moving functionality, so they did by moving udev-kmod unit into units folder. OpenRC doesn't belong on udev only, and this init script is needed for >=udev-206 only, so I see no reason for keeping it somewhere but udev. Kmod may be an option however, but if kmod+eudev is a possible configuration it will lead to a problem. I'd like to hear another suggestions on this point. So for keeping related thing together having init script in udev is a logical step.
(In reply to Samuli Suominen from comment #5) > Comment on attachment 354000 [details] > udev kmod init script > > Fails as following: > > $ kmod --format=tmpfiles --output=/tmp/foo.foo > kmod: unrecognized option '--format=tmpfiles' > > And is missing eend $? to match ebegin as well > > Plus shouldn't hardcode path to kmod yes needs to be kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf
kmod-14-r1 in portage
With kmod-15 we'll get proper warning if modules.devname is missing (like it would on CONFIG_MODULES=n kernel) http://git.kernel.org/cgit/utils/kernel/kmod/kmod.git/commit/?id=ae17710117 "Warning: /lib/modules/$(uname -r)/modules.devname not found - ignoring"