diff --git a/contrib/helper.sh b/contrib/helper.sh new file mode 100644 index 0000000..ef9877a --- /dev/null +++ b/contrib/helper.sh @@ -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.$$" diff --git a/contrib/mdev.conf b/contrib/mdev.conf new file mode 100644 index 0000000..ff5334c --- /dev/null +++ b/contrib/mdev.conf @@ -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.$$