p = line;
for (;;) {
_cleanup_free_ char *word = NULL;
- const char *e;
+ const char *e, *k, *q;
r = extract_first_word(&p, &word, NULL, EXTRACT_QUOTES|EXTRACT_RELAX);
if (r < 0)
if (r == 0)
break;
+ k = word;
+
/* Automatically filter out arguments that are intended only for the initrd, if we are not in the
* initrd. */
- if (!in_initrd() && startswith(word, "rd."))
+ q = startswith(word, "rd.");
+ if (q) {
+ if (!in_initrd())
+ continue;
+
+ if (FLAGS_SET(flags, PROC_CMDLINE_STRIP_RD_PREFIX))
+ k = q;
+
+ } else if (FLAGS_SET(flags, PROC_CMDLINE_RD_STRICT) && in_initrd())
continue;
if (value) {
- e = proc_cmdline_key_startswith(word, key);
+ e = proc_cmdline_key_startswith(k, key);
if (!e)
continue;
found = true;
} else {
- if (streq(word, key))
+ if (streq(k, key))
found = true;
}
}