1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 #include "alloc-util.h"
7 #include "parse-util.h"
8 #include "proc-cmdline.h"
9 #include "string-table.h"
10 #include "string-util.h"
11 #include "volatile-util.h"
13 int query_volatile_mode(VolatileMode
*ret
) {
14 _cleanup_free_
char *mode
= NULL
;
17 r
= proc_cmdline_get_key("systemd.volatile", PROC_CMDLINE_VALUE_OPTIONAL
, &mode
);
28 m
= volatile_mode_from_string(mode
);
39 static const char* const volatile_mode_table
[_VOLATILE_MODE_MAX
] = {
41 [VOLATILE_YES
] = "yes",
42 [VOLATILE_STATE
] = "state",
43 [VOLATILE_OVERLAY
] = "overlay",
46 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(volatile_mode
, VolatileMode
, VOLATILE_YES
);