chiark / gitweb /
man: recreate from xml
[elogind.git] / udev_rules_parse.c
index 111fead9ad19a1c0579c137b84ae20df500df747..535b59590a0e21310f5c263168eb6ca83d6e7a2f 100644 (file)
@@ -241,6 +241,7 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
        char *linepos;
        char *attr;
        size_t padding;
+       int physdev = 0;
        int retval;
 
        /* get all the keys */
@@ -373,6 +374,12 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
                                err("error parsing ATTRS attribute");
                                goto invalid;
                        }
+                       if (strncmp(attr, "device/", 7) == 0)
+                               err("the 'device' link is deprecated and will be removed from a future kernel, "
+                                   "please fix it in %s:%u", filename, lineno);
+                       else if (strchr(attr, '/') != NULL)
+                               err("do not reference parent sysfs directories directly, that may break with a future kernel, "
+                                   "please fix it in %s:%u", filename, lineno);
                        if (add_rule_key_pair(rule, &rule->attrs, operation, attr, value) != 0)
                                goto invalid;
                        valid = 1;
@@ -385,6 +392,8 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
                                err("error parsing ENV attribute");
                                goto invalid;
                        }
+                       if (strncmp(attr, "PHYSDEV", 7) == 0)
+                               physdev = 1;
                        if (add_rule_key_pair(rule, &rule->env, operation, attr, value) != 0)
                                goto invalid;
                        valid = 1;
@@ -570,6 +579,10 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
                err("unknown key '%s' in %s:%u", key, filename, lineno);
        }
 
+       if (physdev && rule->wait_for_sysfs.operation == KEY_OP_UNSET)
+               err("PHYSDEV* values are deprecated and will be removed from a future kernel, "
+                   "please fix it in %s:%u", filename, lineno);
+
        /* skip line if not any valid key was found */
        if (!valid)
                goto invalid;