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
;
15 VolatileMode m
= VOLATILE_NO
;
18 r
= proc_cmdline_get_key("systemd.volatile", PROC_CMDLINE_VALUE_OPTIONAL
, &mode
);
25 m
= volatile_mode_from_string(mode
);
38 static const char* const volatile_mode_table
[_VOLATILE_MODE_MAX
] = {
40 [VOLATILE_YES
] = "yes",
41 [VOLATILE_STATE
] = "state",
44 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(volatile_mode
, VolatileMode
, VOLATILE_YES
);