Commit ceca9501 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Zbigniew Jędrzejewski-Szmek

cryptsetup: add RequiresMountsFor for keyfile

This ensures that the keyfile is available during the opening of the encrypted
device.

Also dropped the explicit ordering Before=local-fs.target, as the containers
are ordered implicitly by their content.
parent 9ece938a
......@@ -118,12 +118,17 @@ static int create_disk(
fprintf(f,
"Before=cryptsetup.target\n");
if (password && (streq(password, "/dev/urandom") ||
streq(password, "/dev/random") ||
streq(password, "/dev/hw_random")))
fputs("After=systemd-random-seed-load.service\n", f);
else
fputs("Before=local-fs.target\n", f);
if (password) {
if (streq(password, "/dev/urandom") ||
streq(password, "/dev/random") ||
streq(password, "/dev/hw_random"))
fputs("After=systemd-random-seed-load.service\n", f);
else if (!streq(password, "-") &&
!streq(password, "none"))
fprintf(f,
"RequiresMountsFor=%s\n",
password);
}
if (is_device_path(u))
fprintf(f,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment