From: Lukas Nykryn Date: Thu, 25 Oct 2018 14:21:26 +0000 (+0200) Subject: proc-cmdline: introduce PROC_CMDLINE_RD_STRICT X-Git-Tag: v240~468^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed58820d7669971762dd887dc117d922c23f2543;p=thirdparty%2Fsystemd.git proc-cmdline: introduce PROC_CMDLINE_RD_STRICT 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. --- diff --git a/src/basic/proc-cmdline.c b/src/basic/proc-cmdline.c index b386c705e11..647c61ce739 100644 --- a/src/basic/proc-cmdline.c +++ b/src/basic/proc-cmdline.c @@ -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) diff --git a/src/basic/proc-cmdline.h b/src/basic/proc-cmdline.h index ffc45fddb96..bb8b18d3b1f 100644 --- a/src/basic/proc-cmdline.h +++ b/src/basic/proc-cmdline.h @@ -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);