chiark / gitweb /
prepare for module loading rules and add MODALIAS key
[elogind.git] / udev_rules_parse.c
index 3f07521ccb81210994cb93a0117d1cb234317cd5..89925a35e42862c6f111ba281cf78f0e5ece4409 100644 (file)
@@ -269,6 +269,13 @@ static int rules_parse(const char *filename)
                                continue;
                        }
 
+                       if (strcasecmp(key, KEY_DEVPATH) == 0) {
+                               strlcpy(rule.devpath, value, sizeof(rule.devpath));
+                               rule.devpath_operation = operation;
+                               valid = 1;
+                               continue;
+                       }
+
                        if (strcasecmp(key, KEY_BUS) == 0) {
                                strlcpy(rule.bus, value, sizeof(rule.bus));
                                rule.bus_operation = operation;
@@ -325,6 +332,13 @@ static int rules_parse(const char *filename)
                                continue;
                        }
 
+                       if (strcasecmp(key, KEY_MODALIAS) == 0) {
+                               strlcpy(rule.modalias, value, sizeof(rule.modalias));
+                               rule.modalias_operation = operation;
+                               valid = 1;
+                               continue;
+                       }
+
                        if (strcasecmp(key, KEY_DRIVER) == 0) {
                                strlcpy(rule.driver, value, sizeof(rule.driver));
                                rule.driver_operation = operation;
@@ -349,21 +363,19 @@ static int rules_parse(const char *filename)
 
                        if (strncasecmp(key, KEY_NAME, sizeof(KEY_NAME)-1) == 0) {
                                attr = get_key_attribute(key + sizeof(KEY_NAME)-1);
-                               /* FIXME: remove old style options and make OPTIONS= mandatory */
                                if (attr != NULL) {
                                        if (strstr(attr, OPTION_PARTITIONS) != NULL) {
                                                dbg("creation of partition nodes requested");
                                                rule.partitions = DEFAULT_PARTITIONS_COUNT;
                                        }
+                                       /* FIXME: remove old style option and make OPTIONS= mandatory */
                                        if (strstr(attr, OPTION_IGNORE_REMOVE) != NULL) {
                                                dbg("remove event should be ignored");
                                                rule.ignore_remove = 1;
                                        }
                                }
-                               if (value[0] != '\0')
-                                       strlcpy(rule.name, value, sizeof(rule.name));
-                               else
-                                       rule.ignore_device = 1;
+                               rule.name_operation = operation;
+                               strlcpy(rule.name, value, sizeof(rule.name));
                                valid = 1;
                                continue;
                        }