aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/Config.src58
-rw-r--r--util-linux/Kbuild.src1
-rw-r--r--util-linux/mdev.c88
3 files changed, 80 insertions, 67 deletions
diff --git a/util-linux/Config.src b/util-linux/Config.src
index bb45705a9..888bc8f3b 100644
--- a/util-linux/Config.src
+++ b/util-linux/Config.src
@@ -404,64 +404,6 @@ config LSUSB
This version uses sysfs (/sys/bus/usb/devices) only.
-config MDEV
- bool "mdev"
- default y
- select PLATFORM_LINUX
- help
- mdev is a mini-udev implementation for dynamically creating device
- nodes in the /dev directory.
-
- For more information, please see docs/mdev.txt
-
-config FEATURE_MDEV_CONF
- bool "Support /etc/mdev.conf"
- default y
- depends on MDEV
- help
- Add support for the mdev config file to control ownership and
- permissions of the device nodes.
-
- For more information, please see docs/mdev.txt
-
-config FEATURE_MDEV_RENAME
- bool "Support subdirs/symlinks"
- default y
- depends on FEATURE_MDEV_CONF
- help
- Add support for renaming devices and creating symlinks.
-
- For more information, please see docs/mdev.txt
-
-config FEATURE_MDEV_RENAME_REGEXP
- bool "Support regular expressions substitutions when renaming device"
- default y
- depends on FEATURE_MDEV_RENAME
- help
- Add support for regular expressions substitutions when renaming
- device.
-
-config FEATURE_MDEV_EXEC
- bool "Support command execution at device addition/removal"
- default y
- depends on FEATURE_MDEV_CONF
- help
- This adds support for an optional field to /etc/mdev.conf for
- executing commands when devices are created/removed.
-
- For more information, please see docs/mdev.txt
-
-config FEATURE_MDEV_LOAD_FIRMWARE
- bool "Support loading of firmwares"
- default y
- depends on MDEV
- help
- Some devices need to load firmware before they can be usable.
-
- These devices will request userspace look up the files in
- /lib/firmware/ and if it exists, send it to the kernel for
- loading into the hardware.
-
config MKSWAP
bool "mkswap"
default y
diff --git a/util-linux/Kbuild.src b/util-linux/Kbuild.src
index c06d911ec..468fc6bc1 100644
--- a/util-linux/Kbuild.src
+++ b/util-linux/Kbuild.src
@@ -26,7 +26,6 @@ lib-$(CONFIG_IPCS) += ipcs.o
lib-$(CONFIG_LOSETUP) += losetup.o
lib-$(CONFIG_LSPCI) += lspci.o
lib-$(CONFIG_LSUSB) += lsusb.o
-lib-$(CONFIG_MDEV) += mdev.o
lib-$(CONFIG_MKFS_EXT2) += mkfs_ext2.o
lib-$(CONFIG_MKFS_MINIX) += mkfs_minix.o
lib-$(CONFIG_MKFS_REISER) += mkfs_reiser.o
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index 7cabb1df6..27b35572d 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -8,19 +8,91 @@
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//config:config MDEV
+//config: bool "mdev"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: mdev is a mini-udev implementation for dynamically creating device
+//config: nodes in the /dev directory.
+//config:
+//config: For more information, please see docs/mdev.txt
+//config:
+//config:config FEATURE_MDEV_CONF
+//config: bool "Support /etc/mdev.conf"
+//config: default y
+//config: depends on MDEV
+//config: help
+//config: Add support for the mdev config file to control ownership and
+//config: permissions of the device nodes.
+//config:
+//config: For more information, please see docs/mdev.txt
+//config:
+//config:config FEATURE_MDEV_RENAME
+//config: bool "Support subdirs/symlinks"
+//config: default y
+//config: depends on FEATURE_MDEV_CONF
+//config: help
+//config: Add support for renaming devices and creating symlinks.
+//config:
+//config: For more information, please see docs/mdev.txt
+//config:
+//config:config FEATURE_MDEV_RENAME_REGEXP
+//config: bool "Support regular expressions substitutions when renaming device"
+//config: default y
+//config: depends on FEATURE_MDEV_RENAME
+//config: help
+//config: Add support for regular expressions substitutions when renaming
+//config: device.
+//config:
+//config:config FEATURE_MDEV_EXEC
+//config: bool "Support command execution at device addition/removal"
+//config: default y
+//config: depends on FEATURE_MDEV_CONF
+//config: help
+//config: This adds support for an optional field to /etc/mdev.conf for
+//config: executing commands when devices are created/removed.
+//config:
+//config: For more information, please see docs/mdev.txt
+//config:
+//config:config FEATURE_MDEV_LOAD_FIRMWARE
+//config: bool "Support loading of firmwares"
+//config: default y
+//config: depends on MDEV
+//config: help
+//config: Some devices need to load firmware before they can be usable.
+//config:
+//config: These devices will request userspace look up the files in
+//config: /lib/firmware/ and if it exists, send it to the kernel for
+//config: loading into the hardware.
+
+//applet:IF_MDEV(APPLET(mdev, BB_DIR_SBIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_MDEV) += mdev.o
+
//usage:#define mdev_trivial_usage
//usage: "[-s]"
//usage:#define mdev_full_usage "\n\n"
-//usage: " -s Scan /sys and populate /dev during system boot\n"
+//usage: "mdev -s is to be run during boot to scan /sys and populate /dev.\n"
//usage: "\n"
-//usage: "It can be run by kernel as a hotplug helper. To activate it:\n"
-//usage: " echo /sbin/mdev > /proc/sys/kernel/hotplug\n"
+//usage: "Bare mdev is a kernel hotplug helper. To activate it:\n"
+//usage: " echo /sbin/mdev >/proc/sys/kernel/hotplug\n"
//usage: IF_FEATURE_MDEV_CONF(
+//usage: "\n"
//usage: "It uses /etc/mdev.conf with lines\n"
-//usage: "[-]DEVNAME UID:GID PERM"
-//usage: IF_FEATURE_MDEV_RENAME(" [>|=PATH]")
+//usage: " [-]DEVNAME UID:GID PERM"
+//usage: IF_FEATURE_MDEV_RENAME(" [>|=PATH]|[!]")
//usage: IF_FEATURE_MDEV_EXEC(" [@|$|*PROG]")
+//usage: "\n"
+//usage: "where DEVNAME is device name regex, @major,minor[-minor2], or\n"
+//usage: "environment variable regex. A common use of the latter is\n"
+//usage: "to load modules for hotplugged devices:\n"
+//usage: " $MODALIAS=.* 0:0 660 @modprobe \"$MODALIAS\"\n"
//usage: )
+//usage: "\n"
+//usage: "If /dev/mdev.seq file exists, mdev will wait for its value\n"
+//usage: "to match $SEQNUM variable. This prevents plug/unplug races.\n"
+//usage: "To activate this feature, create empty /dev/mdev.seq at boot."
//usage:
//usage:#define mdev_notes_usage ""
//usage: IF_FEATURE_MDEV_CONFIG(
@@ -64,9 +136,9 @@
* If /etc/mdev.conf exists, it may modify /dev/device_name's properties.
* /etc/mdev.conf file format:
*
- * [-][subsystem/]device user:grp mode [>|=path] [@|$|*command args...]
- * [-]@maj,min[-min2] user:grp mode [>|=path] [@|$|*command args...]
- * [-]$envvar=val user:grp mode [>|=path] [@|$|*command args...]
+ * [-][subsystem/]device user:grp mode [>|=path]|[!] [@|$|*command args...]
+ * [-]@maj,min[-min2] user:grp mode [>|=path]|[!] [@|$|*command args...]
+ * [-]$envvar=val user:grp mode [>|=path]|[!] [@|$|*command args...]
*
* Leading minus in 1st field means "don't stop on this line", otherwise
* search is stopped after the matching line is encountered.