# if this is a ide cdrom, name it the default name, and create a symlink to cdrom
CALLOUT, BUS="ide", PROGRAM="/bin/cat /proc/ide/%k/media", ID="cdrom", NAME="%k", SYMLINK="cdrom"
-
+# device mapper creates its own device nodes
+IGNORE, KERNEL="dm-[0-9]*"
REPLACE, KERNEL="radio[0-9]*", NAME="v4l/radio%n"
REPLACE, KERNEL="vbi[0-9]*", NAME="v4l/vbi%n"
REPLACE, KERNEL="vtx[0-9]*", NAME="v4l/vtx%n"
+
+# dm devices
+IGNORE, KERNEL="dm-[0-9]*"
return; /* here to prevent compiler warning... */
}
+static int do_ignore(struct sysfs_class_device *class_dev, struct udevice *udev, struct sysfs_device *sysfs_device)
+{
+ struct config_device *dev;
+ struct list_head *tmp;
+
+ list_for_each(tmp, &config_device_list) {
+ dev = list_entry(tmp, struct config_device, node);
+ if (dev->type != IGNORE)
+ continue;
+
+ dbg("compare name '%s' with '%s'", dev->kernel_name, class_dev->name);
+ if (strcmp_pattern(dev->kernel_name, class_dev->name) != 0)
+ continue;
+
+ dbg("found name, '%s' will be ignored", dev->kernel_name);
+
+ return 0;
+ }
+ return -ENODEV;
+}
+
static int exec_callout(struct config_device *dev, char *value, int len)
{
int retval;
dbg("kernel_number='%s'", udev->kernel_number);
/* rules are looked at in priority order */
+ retval = do_ignore(class_dev, udev, sysfs_device);
+ if (retval == 0) {
+ dbg("name, '%s' is being ignored", class_dev->name);
+ return 1;
+ }
+
retval = do_callout(class_dev, udev, sysfs_device);
if (retval == 0)
goto found;
TOPOLOGY = 3,
REPLACE = 4,
CALLOUT = 5,
+ IGNORE = 6,
};
#define BUS_SIZE 30
#define TYPE_TOPOLOGY "TOPOLOGY"
#define TYPE_REPLACE "REPLACE"
#define TYPE_CALLOUT "CALLOUT"
+#define TYPE_IGNORE "IGNORE"
#define FIELD_BUS "BUS"
#define FIELD_ID "ID"
dbg_parse("CALLOUT name='%s', bus='%s', program='%s', id='%s'",
dev->name, dev->bus, dev->exec_program, dev->id);
break;
+ case IGNORE:
+ dbg_parse("IGNORE name='%s', kernel_name='%s'",
+ dev->name, dev->kernel_name);
+ break;
default:
dbg_parse("unknown type of method");
}
goto keys;
}
+ if (strcasecmp(temp2, TYPE_IGNORE) == 0) {
+ dev.type = IGNORE;
+ goto keys;
+ }
+
dbg_parse("unknown type of method '%s'", temp2);
goto error;
keys:
(*dev.exec_program == '\0'))
goto error;
break;
+ case IGNORE:
+ dbg_parse(TYPE_IGNORE "name='%s', kernel_name='%s'",
+ dev.name, dev.kernel_name);
+ if ((*dev.kernel_name == '\0'))
+ goto error;
+ break;
default:
dbg_parse("unknown type of method");
goto error;
string replacement of the kernel device name
.br
.RB "key: " KERNEL
+.TP
+.B IGNORE
+tell udev to not care about creation of this device, e.g. because the
+device is already handled by another program
+.br
+.RB "key: " KERNEL
.P
The methods are applied in the following order:
-.BR CALLOUT ", " LABEL ", " NUMBER ", " TOPOLOGY ", " REPLACE "."
+.BR IGNORE ", " CALLOUT ", " LABEL ", " NUMBER ", " TOPOLOGY ", " REPLACE "."
.P
.RB "The " NAME " ," SYMLINK " and " PROGRAM
fields support simple printf-like string substitution:
sysbus_disconnect();
exit:
+ if (retval > 0)
+ retval = 0;
+
return -retval;
}