Compare commits

...

2 Commits

Author SHA1 Message Date
Luca Boccassi ee23e73ce4
Merge eb9691bd05 into 0566bd9643 2024-11-26 17:13:27 +01:00
Luca Boccassi eb9691bd05 generator: order cryptsetup/veritysetup after confext unit in initrd if provided
Allow customizing cryptsetup/veritysetup (crypttab/veritytab) in the initrd,
by ordering generated units after the systemd-confext service, if images
were loaded from the ESP.
2024-11-25 22:45:46 +00:00
1 changed files with 8 additions and 0 deletions

View File

@ -833,6 +833,10 @@ int generator_write_cryptsetup_unit_section(
"Wants=blockdev@dev-mapper-%%i.target\n" "Wants=blockdev@dev-mapper-%%i.target\n"
"IgnoreOnIsolate=true\n"); "IgnoreOnIsolate=true\n");
/* Ensure confexts can be used to customize unlocking disks */
if (in_initrd() && !dir_is_empty("/.extra/confext/", /* ignore_hidden_or_backup= */ true))
fprintf(f, "After=systemd-confext.service\n");
return 0; return 0;
} }
@ -907,6 +911,10 @@ int generator_write_veritysetup_unit_section(
"Before=blockdev@dev-mapper-%%i.target\n" "Before=blockdev@dev-mapper-%%i.target\n"
"Wants=blockdev@dev-mapper-%%i.target\n"); "Wants=blockdev@dev-mapper-%%i.target\n");
/* Ensure confexts can be used to customize setting up disks */
if (in_initrd() && !dir_is_empty("/.extra/confext/", /* ignore_hidden_or_backup= */ true))
fprintf(f, "After=systemd-confext.service\n");
return 0; return 0;
} }