]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/proc-cmdline: extend comments
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Thu, 26 Mar 2026 12:47:44 +0000 (13:47 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 26 Mar 2026 17:53:40 +0000 (18:53 +0100)
Inspired by the discussion in #41161.

Also change the order of flags to be more logical. First the option
to specify at what fields we look, then the option to specify how we
return their name, the the value, and finally what to do if the value
is missing.

src/basic/proc-cmdline.h

index 42a8ef1eb9c91d79f59988f798945a3e5325cea6..6abf57ac3c1ea8cba02d97cb0a0ba894a8978237 100644 (file)
@@ -4,10 +4,15 @@
 #include "basic-forward.h"
 
 typedef enum ProcCmdlineFlags {
-        PROC_CMDLINE_STRIP_RD_PREFIX    = 1 << 0, /* automatically strip "rd." prefix if it is set (and we are in the initrd, since otherwise we'd not consider it anyway) */
-        PROC_CMDLINE_VALUE_OPTIONAL     = 1 << 1, /* the value is optional (for boolean switches that can omit the value) */
-        PROC_CMDLINE_RD_STRICT          = 1 << 2, /* ignore this in the initrd */
-        PROC_CMDLINE_TRUE_WHEN_MISSING  = 1 << 3, /* default to true when the key is missing for bool */
+        PROC_CMDLINE_RD_STRICT          = 1 << 0, /* Only look at options with the "rd." prefix when in the initrd and only
+                                                   * at options without the prefix when not in the initrd.
+                                                   */
+        PROC_CMDLINE_STRIP_RD_PREFIX    = 1 << 1, /* Automatically strip "rd." prefix if we are in the initrd.
+                                                   * When this is specified, the handler function must check for unprefixed
+                                                   * option names. */
+        PROC_CMDLINE_VALUE_OPTIONAL     = 1 << 2, /* The value is optional (for boolean switches that can omit the value). */
+        PROC_CMDLINE_TRUE_WHEN_MISSING  = 1 << 3, /* Make proc_cmdline_get_bool() return true instead of false (the default)
+                                                   * when the key is not present on the command line. */
 } ProcCmdlineFlags;
 
 typedef int (*proc_cmdline_parse_t)(const char *key, const char *value, void *data);