veritysetup-generator: treat '-' and '_' as equivalent
This commit is contained in:
committed by
Lennart Poettering
parent
606b0b64a7
commit
ad0cdb6b67
@@ -53,17 +53,17 @@ static int parse_item_given(const char *key, const char *value, void *data) {
|
||||
bool *strip = data;
|
||||
|
||||
log_info("%s: option <%s> = <%s>", __func__, key, strna(value));
|
||||
if (streq(key, "foo_bar"))
|
||||
if (proc_cmdline_key_streq(key, "foo_bar"))
|
||||
assert_se(streq(value, "quux"));
|
||||
else if (streq(key, "wuff-piep"))
|
||||
else if (proc_cmdline_key_streq(key, "wuff-piep"))
|
||||
assert_se(streq(value, "tuet "));
|
||||
else if (streq(key, "space"))
|
||||
else if (proc_cmdline_key_streq(key, "space"))
|
||||
assert_se(streq(value, "x y z"));
|
||||
else if (streq(key, "miepf"))
|
||||
else if (proc_cmdline_key_streq(key, "miepf"))
|
||||
assert_se(streq(value, "uuu"));
|
||||
else if (in_initrd() && *strip && streq(key, "zumm"))
|
||||
else if (in_initrd() && *strip && proc_cmdline_key_streq(key, "zumm"))
|
||||
assert_se(!value);
|
||||
else if (in_initrd() && !*strip && streq(key, "rd.zumm"))
|
||||
else if (in_initrd() && !*strip && proc_cmdline_key_streq(key, "rd.zumm"))
|
||||
assert_se(!value);
|
||||
else
|
||||
assert_not_reached("Bad key!");
|
||||
|
||||
@@ -118,7 +118,7 @@ static int create_device(void) {
|
||||
static int parse_proc_cmdline_item(const char *key, const char *value, void *data) {
|
||||
int r;
|
||||
|
||||
if (streq(key, "systemd.verity")) {
|
||||
if (proc_cmdline_key_streq(key, "systemd.verity")) {
|
||||
|
||||
r = value ? parse_boolean(value) : 1;
|
||||
if (r < 0)
|
||||
@@ -126,7 +126,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
else
|
||||
arg_enabled = r;
|
||||
|
||||
} else if (streq(key, "roothash")) {
|
||||
} else if (proc_cmdline_key_streq(key, "roothash")) {
|
||||
|
||||
if (proc_cmdline_value_missing(key, value))
|
||||
return 0;
|
||||
@@ -135,7 +135,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
|
||||
} else if (streq(key, "systemd.verity_root_data")) {
|
||||
} else if (proc_cmdline_key_streq(key, "systemd.verity_root_data")) {
|
||||
|
||||
if (proc_cmdline_value_missing(key, value))
|
||||
return 0;
|
||||
@@ -144,7 +144,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
|
||||
} else if (streq(key, "systemd.verity_root_hash")) {
|
||||
} else if (proc_cmdline_key_streq(key, "systemd.verity_root_hash")) {
|
||||
|
||||
if (proc_cmdline_value_missing(key, value))
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user