gpt-auto-generator: Pass cryptsetup credentials to cryptsetup

cryptsetup reads a bunch of credentials now but we don't pass import
those in any service units yet. Let's pass through all cryptsetup
prefixed credentials to the systemd-cryptsetup@root instance.
This commit is contained in:
Daan De Meyer
2023-12-06 23:37:32 +01:00
committed by Lennart Poettering
parent d50bf46f19
commit b952663cd1
2 changed files with 54 additions and 1 deletions
+1
View File
@@ -790,6 +790,7 @@ int generator_write_cryptsetup_service_section(
"TimeoutSec=infinity\n" /* The binary handles timeouts on its own */
"KeyringMode=shared\n" /* Make sure we can share cached keys among instances */
"OOMScoreAdjust=500\n" /* Unlocking can allocate a lot of memory if Argon2 is used */
"ImportCredential=cryptsetup.*\n"
"ExecStart=" SYSTEMD_CRYPTSETUP_PATH " attach '%s' '%s' '%s' '%s'\n"
"ExecStop=" SYSTEMD_CRYPTSETUP_PATH " detach '%s'\n",
name_escaped, what_escaped, strempty(key_file_escaped), strempty(options_escaped),