diff options
author | Rob Landley <rob@landley.net> | 2006-06-26 14:11:33 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-06-26 14:11:33 +0000 |
commit | ef10d52745a72f524e36edc375a6a05d3365ede4 (patch) | |
tree | bd1ee024e81262ec2485c4d5f391ef910d85bd38 /util-linux/Config.in | |
parent | cf7577d4171d517690e95e7225979bfde32fce7c (diff) | |
download | busybox-w32-ef10d52745a72f524e36edc375a6a05d3365ede4.tar.gz busybox-w32-ef10d52745a72f524e36edc375a6a05d3365ede4.tar.bz2 busybox-w32-ef10d52745a72f524e36edc375a6a05d3365ede4.zip |
Upgrade mdev to allow commands to be run on create/delete.
Both Jason Schoon and Giuseppe Ciotta deserve credit for this, I used elements
of both. It's been upgraded so that you can specify that a given command
should run at create, at delete, or at both using different special characters
(@, $, and * respectively). It uses the system() method of running command
lines which means you can use environment variables on the command line (it
sets $MDEV to the name of the current device being created/deleted, which is
useful if you matched it via regex), and the documentation warns that you need
a /bin/sh to make that work, so you probably want to pick a default shell.
Diffstat (limited to 'util-linux/Config.in')
-rw-r--r-- | util-linux/Config.in | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/util-linux/Config.in b/util-linux/Config.in index a493fbfb4..501ed6bfc 100644 --- a/util-linux/Config.in +++ b/util-linux/Config.in | |||
@@ -265,16 +265,31 @@ config CONFIG_FEATURE_MDEV_CONF | |||
265 | 265 | ||
266 | That's device name (with regex match), uid:gid, and permissions. | 266 | That's device name (with regex match), uid:gid, and permissions. |
267 | 267 | ||
268 | Optionally, that can be followed (on the same line) by an asterisk | ||
269 | and a command line to run after creating the corresponding device(s), | ||
270 | ala: | ||
271 | |||
272 | hdc root:cdrom 660 *ln -s hdc cdrom | ||
273 | |||
274 | Config file parsing stops on the first matching line. If no config | 268 | Config file parsing stops on the first matching line. If no config |
275 | entry is matched, devices are created with default 0:0 660. (Make | 269 | entry is matched, devices are created with default 0:0 660. (Make |
276 | the last line match .* to override this.) | 270 | the last line match .* to override this.) |
277 | 271 | ||
272 | config CONFIG_FEATURE_MDEV_EXEC | ||
273 | bool "Support command execution at device addition/removal" | ||
274 | default n | ||
275 | depends on CONFIG_FEATURE_MDEV_CONF | ||
276 | help | ||
277 | This adds support for an optional field to /etc/mdev.conf, consisting | ||
278 | of a special character and a command line to run after creating the | ||
279 | corresponding device(s) and before removing, ala: | ||
280 | |||
281 | hdc root:cdrom 660 *ln -s $MDEV cdrom | ||
282 | |||
283 | The $MDEV environment variable is set to the name of the device. | ||
284 | |||
285 | The special characters and their meanings are: | ||
286 | @ Run after creating the device. | ||
287 | $ Run before removing the device. | ||
288 | * Run both after creating and before removing the device. | ||
289 | |||
290 | Commands are executed via system() so you need /bin/sh, meaning you | ||
291 | probably want to select a default shell in the Shells menu. | ||
292 | |||
278 | config CONFIG_MKSWAP | 293 | config CONFIG_MKSWAP |
279 | bool "mkswap" | 294 | bool "mkswap" |
280 | default n | 295 | default n |