]> 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)
committerLukas Nykryn <lnykryn@redhat.com>
Thu, 25 Oct 2018 14:21:26 +0000 (16:21 +0200)
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.

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

index b386c705e118e4ed34612c603c5db9a422c14e83..647c61ce739c049f4e8d36d5876d37a7eab09da3 100644 (file)
@@ -66,7 +66,8 @@ int proc_cmdline_parse_given(const char *line, proc_cmdline_parse_t parse_item,
 
                         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 ffc45fddb964113e33a020f68f5f9d9f6d5a5313..bb8b18d3b1f9d156e1804feac01209d8a532f849 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);