- /* init rules, permissions */
- namedev_init();
-
- /* name, create node, store in db */
- retval = udev_add_device(&udev, class_dev);
-
+ /* get major/minor */
+ if (udev.type == DEV_BLOCK || udev.type == DEV_CLASS)
+ udev.devt = get_devt(class_dev);
+
+ if (udev.type == DEV_NET || udev.devt) {
+ /* name device */
+ udev_rules_get_name(&rules, &udev, class_dev);
+ if (udev.ignore_device) {
+ info("device event will be ignored");
+ sysfs_close_class_device(class_dev);
+ goto cleanup;
+ }
+ if (udev.name[0] == '\0') {
+ info("device node creation supressed");
+ sysfs_close_class_device(class_dev);
+ goto cleanup;
+ }
+ /* create node, store in db */
+ retval = udev_add_device(&udev, class_dev);
+ } else {
+ dbg("no dev-file found");
+ udev_rules_get_run(&rules, &udev, class_dev, NULL);
+ if (udev.ignore_device) {
+ info("device event will be ignored");
+ sysfs_close_class_device(class_dev);
+ goto cleanup;
+ }
+ }