Merge pull request #10293 from poettering/cryptsetup-fixes
two tiny cryptsetup-generator fixes
This commit is contained in:
commit
dcf0b8a5be
|
@ -152,8 +152,10 @@ static int create_disk(
|
|||
return log_oom();
|
||||
}
|
||||
|
||||
if (keydev && !password)
|
||||
return log_error_errno(-EINVAL, "Keydev is specified, but path to the password file is missing: %m");
|
||||
if (keydev && !password) {
|
||||
log_error("Key device is specified, but path to the password file is missing.");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = generator_open_unit_file(arg_dest, NULL, n, &f);
|
||||
if (r < 0)
|
||||
|
@ -190,7 +192,7 @@ static int create_disk(
|
|||
netdev ? "remote-cryptsetup.target" : "cryptsetup.target");
|
||||
|
||||
if (password) {
|
||||
if (STR_IN_SET(password, "/dev/urandom", "/dev/random", "/dev/hw_random"))
|
||||
if (PATH_IN_SET(password, "/dev/urandom", "/dev/random", "/dev/hw_random"))
|
||||
fputs("After=systemd-random-seed.service\n", f);
|
||||
else if (!STR_IN_SET(password, "-", "none")) {
|
||||
_cleanup_free_ char *uu;
|
||||
|
|
Loading…
Reference in a new issue