add examples

This commit is contained in:
illiliti
2020-08-15 15:49:36 +03:00
parent 752f500a90
commit 0105b25e70
2 changed files with 26 additions and 0 deletions

13
contrib/helper.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/sh -f
#
# this helper required for CONFIG_UEVENT_HELPER aka /proc/sys/kernel/hotplug
# for mdev you can use simple one-liner, refer to mdev.conf for more info
#
# usage:
# echo /full/path/to/helper.sh > /proc/sys/kernel/hotplug
# echo "/full/path/to/helper.sh UDEV_MONITOR_DIR" > /proc/sys/kernel/hotplug
#
# NOTE: writing variables to file (e.g PWD or PATH)
# that are not related to uevent properties is harmless
env > "${1:-/tmp/.libudev-zero}/uevent.$$"

13
contrib/mdev.conf Normal file
View File

@@ -0,0 +1,13 @@
#
# example basic mdev config representing libudev-zero usage
# uncomment needed rules
#
# NOTE: you must change "/tmp/.libudev-zero" if you use non-default UDEV_MONITOR_DIR
# NOTE: mdev can only handle ADD and/or REMOVE events
# will handle all uevents
#-.* root:root 660 *env > /tmp/.libudev-zero/uevent.$$
# will handle only drm and input uevents (recommended)
#SUBSYSTEM=drm;.* root:video 660 *env > /tmp/.libudev-zero/uevent.$$
#SUBSYSTEM=input;.* root:input 660 *env > /tmp/.libudev-zero/uevent.$$