4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering This file is part of systemd.
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering Copyright 2010 Lennart Poettering
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering systemd is free software; you can redistribute it and/or modify it
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering under the terms of the GNU Lesser General Public License as published by
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering (at your option) any later version.
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering systemd is distributed in the hope that it will be useful, but
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering Lesser General Public License for more details.
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering You should have received a copy of the GNU Lesser General Public License
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering return get_process_cmdline(1, 0, false, ret);
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering return read_one_line_file("/proc/cmdline", ret);
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poetteringint parse_proc_cmdline(int (*parse_item)(const char *key, const char *value)) {
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering const char *p;
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering r = extract_first_word(&p, &word, NULL, EXTRACT_QUOTES|EXTRACT_RELAX);
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering /* Filter out arguments that are intended only for the
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering if (!in_initrd() && startswith(word, "rd."))
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poetteringint get_proc_cmdline_key(const char *key, char **value) {
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering _cleanup_free_ char *line = NULL, *ret = NULL;
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering const char *p;
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering const char *e;
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering r = extract_first_word(&p, &word, NULL, EXTRACT_QUOTES|EXTRACT_RELAX);
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering /* Filter out arguments that are intended only for the
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering if (!in_initrd() && startswith(word, "rd."))
4e731273edfe852a3eee2949cd20f49fd5b4f6d7Lennart Poettering r = get_proc_cmdline_key("systemd.restore_state=", &value);
c573dcfeb1abd390cd4c4288056df97752ef18f0Evgeny Vereshchaginconst char* runlevel_to_target(const char *word) {
c573dcfeb1abd390cd4c4288056df97752ef18f0Evgeny Vereshchagin for (i = 0; i < ELEMENTSOF(rlmap); i += 2)