1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 Copyright 2015 Lennart Poettering
8 #include "alloc-util.h"
10 #include "parse-util.h"
11 #include "proc-cmdline.h"
12 #include "string-table.h"
13 #include "string-util.h"
14 #include "volatile-util.h"
16 int query_volatile_mode(VolatileMode
*ret
) {
17 _cleanup_free_
char *mode
= NULL
;
18 VolatileMode m
= VOLATILE_NO
;
21 r
= proc_cmdline_get_key("systemd.volatile", PROC_CMDLINE_VALUE_OPTIONAL
, &mode
);
28 m
= volatile_mode_from_string(mode
);
41 static const char* const volatile_mode_table
[_VOLATILE_MODE_MAX
] = {
43 [VOLATILE_YES
] = "yes",
44 [VOLATILE_STATE
] = "state",
47 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(volatile_mode
, VolatileMode
, VOLATILE_YES
);