skarnet / mdevd Goto Github PK
View Code? Open in Web Editor NEWA kernel event manager compatible with mdev.conf
Home Page: https://skarnet.org/software/mdevd/
License: ISC License
A kernel event manager compatible with mdev.conf
Home Page: https://skarnet.org/software/mdevd/
License: ISC License
The documentation on the website doesn't mention that nsss
is an optional build-time and boot-time dependency, even though it's mentioned in the NEWS
file that as of 0.1.0.2
support for nsss
was added, and a --enable-nsss
flag is listed in the configure file.
Also what kind of dependency is it? Is it only a build-time dependency, or a boot-time dependency or a run-time dependency?
I propose to add support for /etc/mdevd.d for user configs and /lib/mdevd.d for package-specific configs.
/lib/mdevd.d is useful for packages that want to install rules without user interaction. The idea is similar to /lib/udev/rules.d
This proposal definitely complicates mdevd. On the other side, it also makes mdevd a more usable alternative to udev. Anyway, I'd like to hear your thoughts.
This feature isn't compatible with busybox mdev
(and probably upcoming toybox mdev
). However, it is actually useful to have the ability to run commands on change action. The one of possible use cases is a battery capacity notifier. See https://github.com/Ventto/batify.
Proposed syntax:
# do something on ACTION=change
<rule> <own>:<grp> <perm> %<cmd>
Currently, libudev-zero uses files to get uevents from device manager. I admit that this looks hacky and improper, but I can't do anything on my side.
I propose to rebroadcast uevent messages. This way, I could implement race-free file-less hotplugging for libudev-zero.
As far as I know, there are two ways how it could be done.
[1]
https://man7.org/linux/man-pages/man7/netlink.7.html nl_groups
oasislinux/hotplugd@6d19eb4
Due to lack of synchronization, a race condition may occur when e.g other programs/services need rw access to /dev/input/*. Since mdevd doesn't provide a way to request its state of processing coldplug uevents, those programs/services have no synchronization with mdevd which may lead to breakage due to bad permissions in /dev/input/*.
This is tricky issue to fix i think. Udev has udevadm settle
which blocks until all events are processed. Mdev has mdev -s
which set proper permissions in /dev/* without need for daemon. What mdevd should do? Looking forward to your ideas!
By default, kernel config CONFIG_UEVENT_HELPER_PATH
calls /bin/mdev, what should this be changed to when using mdevd?
Hi @skarnet
it looks like mdevd-coldplug is very slow? It triggers the hardware / device detection in round about 1 second what is as fast as the following snippet to load the needed drivers:
grep -h MODALIAS /sys/bus/*/devices/*/uevent | cut -d= -f2 | xargs modprobe -abq 2> /dev/null
But it looks like the snippet have done all the work with loading the modules, but mdevd-coldplug just triggers mdevd to load the modules which have much delay until all the modules are loaded?
After mdevd-coldplug is finished I see some seconds (7-10 seconds, qemu-kvm) some debugging output.
modprobe: module dmi:bvnSeaBIOS:bvrrel-1.10.2-0-g5f4c7b1-prebuilt.qemu-project.org:bd04/01/2014:svnQEMU:pnStandardPC(i440FX+PIIX,1996):pvrpc-i440fx-2.8:cvnQEMU:ct1:cvrpc-i440fx-2.8: not found in modules.dep
modprobe: module input:b0011v0002p0006e0000-e0,1,2,k110,111,112,113,114,r0,1,6,8,amlsfw not found in modules.dep
modprobe: module input:b0019v0000p0001e0000-e0,1,k74,ramlsfw not found in modules.dep
modprobe: module platform:reg-dummy not found in modules.dep
modprobe: module acpi:PNP0103: not found in modules.dep
modprobe: module platform:platform-framebuffer not found in modules.dep
modprobe: module platform:alarmtimer not found in modules.dep
modprobe: module platform:Fixed MDIO bus not found in modules.dep
modprobe: module platform:serial8250 not found in modules.dep
modprobe: module platform:i8042 not found in modules.dep
modprobe: module pci:v00008086d00001237sv00001AF4sd00001100bc06sc00i00 not found in modules.dep
modprobe: module pci:v00008086d00007000sv00001AF4sd00001100bc06sc01i00 not found in modules.dep
modprobe: module cpu:type:x86,ven0002fam0006mod0006:feature:,0000,0002,0003,0004,0005,0006,0007,0008,0009,000B,000C,000D,000E,000F,0010,0011,0013,0017,0018,0019,001A,0020,0022,0023,0024,0025,0026,0027,0028,0029,002B,002C,002D,002E,002F,0030,0031,0034,0037,0038,003D,006E,0071,0074,0075,0079,0080,008D,009F,00C0,00C2,00C8,00EC,00F3,010F
not found in modules.dep
modprobe: module acpi:PNP0103: not found in modules.dep
modprobe: module acpi:LNXSYBUS: not found in modules.dep
modprobe: module acpi:PNP0501: not found in modules.dep
modprobe: module acpi:PNP0C0F: not found in modules.dep
modprobe: module acpi:PNP0A06: not found in modules.dep
modprobe: module acpi:LNXPWRBN: not found in modules.dep
modprobe: module acpi:PNP0C0F: not found in modules.dep
modprobe: module not found in modules.dep
modprobe: module acpi:LNXSYSTM: not found in modules.dep
modprobe: module acpi:PNP0F13: not found in modules.dep
modprobe: module not found in modules.dep
modprobe: module acpi:LNXSYBUS: not found in modules.dep
modprobe: module acpi:PNP0C0F: not found in modules.dep
modprobe: module acpi:PNP0B00: not found in modules.dep
modprobe: module acpi:PNP0C0F: not found in modules.dep
modprobe: module acpi:PNP0A06: not found in modules.dep
modprobe: can't load module pcc_cpufreq (kernel/drivers/cpufreq/pcc-cpufreq.ko): No such device
modprobe: can't load module acpi_cpufreq (kernel/drivers/cpufreq/acpi-cpufreq.ko): No such device
modprobe: module acpi:PNP0303: not found in modules.dep
modprobe: module acpi:PNP0C0F: not found in modules.dep
modprobe: module acpi:PNP0A06: not found in modules.dep
modprobe: module acpi:PNP0A03: not found in modules.dep
modprobe: module acpi:ACPI0010:PNP0A05: not found in modules.dep
modprobe: module input:b0010v001Fp0001e0100-e0,12,kramls1,2,fw not found in modules.dep
modprobe: module platform:floppy not found in modules.dep
modprobe: module platform:parport_pc not found in modules.dep
modprobe: module platform:parport_pc not found in modules.dep
modprobe: module platform:parport_pc not found in modules.dep
the grep modprobe snippet just takes 1-2 seconds with the following debugging output.
modprobe: module acpi:ACPI0010:PNP0A05: not found in modules.dep
modprobe: can't load module pcc_cpufreq (kernel/drivers/cpufreq/pcc-cpufreq.ko): No such device
modprobe: can't load module acpi_cpufreq (kernel/drivers/cpufreq/acpi-cpufreq.ko): No such device
modprobe: module acpi:LNXPWRBN: not found in modules.dep
modprobe: module acpi:LNXSYBUS: not found in modules.dep
modprobe: module acpi:LNXSYBUS: not found in modules.dep
modprobe: module acpi:LNXSYSTM: not found in modules.dep
modprobe: module acpi:PNP0103: not found in modules.dep
modprobe: module acpi:PNP0303: not found in modules.dep
modprobe: module acpi:PNP0501: not found in modules.dep
modprobe: module acpi:PNP0A03: not found in modules.dep
modprobe: module acpi:PNP0A06: not found in modules.dep
modprobe: module acpi:PNP0A06: not found in modules.dep
modprobe: module acpi:PNP0A06: not found in modules.dep
modprobe: module acpi:PNP0B00: not found in modules.dep
modprobe: module acpi:PNP0C0F: not found in modules.dep
modprobe: module acpi:PNP0C0F: not found in modules.dep
modprobe: module acpi:PNP0C0F: not found in modules.dep
modprobe: module acpi:PNP0C0F: not found in modules.dep
modprobe: module acpi:PNP0C0F: not found in modules.dep
modprobe: module acpi:PNP0F13: not found in modules.dep
modprobe: module cpu:type:x86,ven0002fam0006mod0006:feature:,0000,0002,0003,0004,0005,0006,0007,0008,0009,000B,000C,000D,000E,000F,0010,0011,0013,0017,0018,0019,001A,0020,0022,0023,0024,0025,0026,0027,0028,0029,002B,002C,002D,002E,002F,0030,0031,0034,0037,0038,003D,006E,0071,0074,0075,0079,0080,008D,009F,00C0,00C2,00C8,00EC,00F3,010F not found in modules.dep
modprobe: module pci:v00008086d00001237sv00001AF4sd00001100bc06sc00i00 not found in modules.dep
modprobe: module pci:v00008086d00007000sv00001AF4sd00001100bc06sc01i00 not found in modules.dep
modprobe: module platform:Fixed not found in modules.dep
modprobe: module MDIO not found in modules.dep
modprobe: module bus not found in modules.dep
modprobe: module acpi:PNP0103: not found in modules.dep
modprobe: module acpi:QEMU0002: not found in modules.dep
modprobe: module platform:alarmtimer not found in modules.dep
modprobe: module platform:floppy not found in modules.dep
modprobe: module platform:i8042 not found in modules.dep
modprobe: module platform:platform-framebuffer not found in modules.dep
modprobe: module platform:reg-dummy not found in modules.dep
modprobe: module platform:serial8250 not found in modules.dep
So the snippet is a considerable faster alternative to mdevd-coldplug implementation? Any way to improve it?
Libudev-zero has the same license from mdevd, the code is clean and easy to maintain, libudev-zero support will increase from mdevd ability with hardware!
I got the following error, while installing mdevd:
so:libskarnet.so.2.6 (missing):
required by:
mdevd-0.1.0.1-r0[so:libskarnet.so.2.6]
Unfortunately, the packet "skalibs" is in version 2.7, which might cause this error. Since you are also the maintainer of this packet, it should be easy to build against the new version (or build it static)
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.