- /* init rules, permissions */
- namedev_init();
-
- /* name, create node, store in db */
- retval = udev_add_device(&udev, class_dev);
-
- /* run dev.d/ scripts if we created a node or changed a netif name */
- if (udev.devname[0] != '\0') {
- setenv("DEVNAME", udev.devname, 1);
- dev_d_execute(&udev, DEVD_DIR, DEVD_SUFFIX);
+ /* 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(&udev, class_dev);
+ if (udev.ignore_device) {
+ info("device event will be ignored");
+ goto cleanup;
+ }
+ if (udev.name[0] == '\0') {
+ info("device node creation supressed");
+ goto cleanup;
+ }
+
+ /* create node, store in db */
+ retval = udev_add_device(&udev, class_dev);
+ } else {
+ dbg("no dev-file found");
+ udev_rules_get_run(&udev, NULL);
+ if (udev.ignore_device) {
+ info("device event will be ignored");
+ goto cleanup;
+ }