- r = proc_cmdline(&line);
- if (r < 0)
- log_warning("Failed to read /proc/cmdline, ignoring: %s", strerror(-r));
- if (r <= 0)
- return 0;
-
- FOREACH_WORD_QUOTED(w, l, line, state) {
- _cleanup_free_ char *word = NULL;
-
- word = strndup(w, l);
- if (!word)
- return log_oom();
-
- if (startswith(word, "luks=")) {
- r = parse_boolean(word + 5);
- if (r < 0)
- log_warning("Failed to parse luks switch %s. Ignoring.", word + 5);
- else
- arg_enabled = r;
-
- } else if (startswith(word, "rd.luks=")) {
-
- if (in_initrd()) {
- r = parse_boolean(word + 8);
- if (r < 0)
- log_warning("Failed to parse luks switch %s. Ignoring.", word + 8);
- else
- arg_enabled = r;
- }
-
- } else if (startswith(word, "luks.crypttab=")) {
- r = parse_boolean(word + 14);
- if (r < 0)
- log_warning("Failed to parse luks crypttab switch %s. Ignoring.", word + 14);
- else
- arg_read_crypttab = r;
-
- } else if (startswith(word, "rd.luks.crypttab=")) {
-
- if (in_initrd()) {
- r = parse_boolean(word + 17);
- if (r < 0)
- log_warning("Failed to parse luks crypttab switch %s. Ignoring.", word + 17);
- else
- arg_read_crypttab = r;
- }