]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
proc-cmdline: introduce PROC_CMDLINE_RD_STRICT
authorLukas Nykryn <lnykryn@redhat.com>
Thu, 25 Oct 2018 14:21:26 +0000 (16:21 +0200)
committerLukáš Nykrýn <lnykryn@redhat.com>
Tue, 4 Dec 2018 12:21:23 +0000 (13:21 +0100)
Our current set of flags allows an option to be either
use just in initrd or both in initrd and normal system.
This new flag is intended to be used in the case where
you want apply some settings just in initrd or just
in normal system.

(cherry picked from commit ed58820d7669971762dd887dc117d922c23f2543)

Related: #1643429

src/basic/proc-cmdline.c
src/basic/proc-cmdline.h

index add481c2ae61fd9c91694ef0a3985a5816f629fa..530ac3746087c3826e7193ecff361a652974853e 100644 (file)
@@ -72,7 +72,8 @@ int proc_cmdline_parse(proc_cmdline_parse_t parse_item, void *data, unsigned fla
 
                         if (flags & PROC_CMDLINE_STRIP_RD_PREFIX)
                                 key = q;
-                }
+                } else if (in_initrd() && flags & PROC_CMDLINE_RD_STRICT)
+                        continue;
 
                 value = strchr(key, '=');
                 if (value)
index 4a9e6e0f6201173729a2411de00c22e92d3a2c0a..140200dbf48cb7fd60769d0e4e55ccc5e103ae6e 100644 (file)
@@ -8,6 +8,7 @@
 enum {
         PROC_CMDLINE_STRIP_RD_PREFIX = 1,
         PROC_CMDLINE_VALUE_OPTIONAL = 2,
+        PROC_CMDLINE_RD_STRICT = 4
 };
 
 typedef int (*proc_cmdline_parse_t)(const char *key, const char *value, void *data);