[PATCH] udev - CALLOUT is PROGRAM now
replace CALLOUT by PROGRAM and fix old rule format
This commit is contained in:
parent
9ab314222d
commit
7e5f7397f9
|
@ -6,7 +6,7 @@
|
||||||
# %M - the kernel major number for the device
|
# %M - the kernel major number for the device
|
||||||
# %m - the kernel minor number for the device
|
# %m - the kernel minor number for the device
|
||||||
# %b - the bus id for the device
|
# %b - the bus id for the device
|
||||||
# %c - the return value for the CALLOUT program (note, this doesn't work within
|
# %c - the return value of the external PROGRAM (note, this doesn't work within
|
||||||
# the PROGRAM field for the obvious reason.)
|
# the PROGRAM field for the obvious reason.)
|
||||||
# %D - use the devfs style disk name for this device.
|
# %D - use the devfs style disk name for this device.
|
||||||
# For partitions, this will result in 'part%n'
|
# For partitions, this will result in 'part%n'
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# %M - the kernel major number for the device
|
# %M - the kernel major number for the device
|
||||||
# %m - the kernel minor number for the device
|
# %m - the kernel minor number for the device
|
||||||
# %b - the bus id for the device
|
# %b - the bus id for the device
|
||||||
# %c - the return value for the CALLOUT program (note, this doesn't work within
|
# %c - the return value of the external PROGRAM (note, this doesn't work within
|
||||||
# the PROGRAM field for the obvious reason.)
|
# the PROGRAM field for the obvious reason.)
|
||||||
# %D - use the devfs style disk name for this device.
|
# %D - use the devfs style disk name for this device.
|
||||||
# For partitions, this will result in 'part%n'
|
# For partitions, this will result in 'part%n'
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# %M - the kernel major number for the device
|
# %M - the kernel major number for the device
|
||||||
# %m - the kernel minor number for the device
|
# %m - the kernel minor number for the device
|
||||||
# %b - the bus id for the device
|
# %b - the bus id for the device
|
||||||
# %c - the return value for the CALLOUT program (note, this doesn't work within
|
# %c - the return value of the external PROGRAM (note, this doesn't work within
|
||||||
# the PROGRAM field for the obvious reason.)
|
# the PROGRAM field for the obvious reason.)
|
||||||
# %D - use the devfs style disk name for this device.
|
# %D - use the devfs style disk name for this device.
|
||||||
# For partitions, this will result in 'part%n'
|
# For partitions, this will result in 'part%n'
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# udev CALLOUT script
|
# udev external PROGRAM script
|
||||||
# return devfs-names for ide-devices
|
# return devfs-names for ide-devices
|
||||||
# CALLOUT, BUS="ide", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", ID="hd*", NAME="%1c", SYMLINK="%2c %3c"
|
# BUS="ide", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", RESULT="hd*", NAME="%1c", SYMLINK="%2c %3c"
|
||||||
|
|
||||||
HOST="${2%\.[0-9]}"
|
HOST="${2%\.[0-9]}"
|
||||||
TARGET="${2#[0-9]\.}"
|
TARGET="${2#[0-9]\.}"
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
# a horribly funny script that shows how flexible udev can really be
|
# a horribly funny script that shows how flexible udev can really be
|
||||||
# This is to be executed by udev with the following rules:
|
# This is to be executed by udev with the following rules:
|
||||||
# CALLOUT, BUS="ide", PROGRAM="name_cdrom.pl %M %m", ID="good*", NAME="%2c", SYMLINK="cdrom"
|
# BUS="ide", PROGRAM="name_cdrom.pl %M %m", PROGRAM="good*", NAME="%2c", SYMLINK="cdrom"
|
||||||
# CALLOUT, BUS="scsi", PROGRAM="name_cdrom.pl %M %m", ID="good*", NAME="%2c", SYMLINK="cdrom"
|
# BUS="scsi", PROGRAM="name_cdrom.pl %M %m", PROGRAM="good*", NAME="%2c", SYMLINK="cdrom"
|
||||||
#
|
#
|
||||||
# The scsi rule catches USB cdroms and ide-scsi devices.
|
# The scsi rule catches USB cdroms and ide-scsi devices.
|
||||||
#
|
#
|
||||||
|
|
|
@ -309,7 +309,7 @@ static int execute_program(char *path, char *value, int len)
|
||||||
int value_set = 0;
|
int value_set = 0;
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
char *pos;
|
char *pos;
|
||||||
char *args[CALLOUT_MAXARG];
|
char *args[PROGRAM_MAXARG];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
dbg("executing '%s'", path);
|
dbg("executing '%s'", path);
|
||||||
|
@ -331,7 +331,7 @@ static int execute_program(char *path, char *value, int len)
|
||||||
if (strchr(path, ' ')) {
|
if (strchr(path, ' ')) {
|
||||||
/* exec with arguments */
|
/* exec with arguments */
|
||||||
pos = path;
|
pos = path;
|
||||||
for (i=0; i < CALLOUT_MAXARG-1; i++) {
|
for (i=0; i < PROGRAM_MAXARG-1; i++) {
|
||||||
args[i] = strsep(&pos, " ");
|
args[i] = strsep(&pos, " ");
|
||||||
if (args[i] == NULL)
|
if (args[i] == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -45,7 +45,7 @@ struct sysfs_class_device;
|
||||||
#define FIELD_NAME "NAME"
|
#define FIELD_NAME "NAME"
|
||||||
#define FIELD_SYMLINK "SYMLINK"
|
#define FIELD_SYMLINK "SYMLINK"
|
||||||
|
|
||||||
#define CALLOUT_MAXARG 10
|
#define PROGRAM_MAXARG 10
|
||||||
#define MAX_SYSFS_PAIRS 5
|
#define MAX_SYSFS_PAIRS 5
|
||||||
|
|
||||||
struct sysfs_pair {
|
struct sysfs_pair {
|
||||||
|
|
Loading…
Reference in a new issue