diff options
-rw-r--r-- | src/gpt-auto-generator/gpt-auto-generator.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index 5f27edc9ee..99b5da17f5 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -13,6 +13,7 @@ #include "device-util.h" #include "dirent-util.h" #include "dissect-image.h" +#include "dropin.h" #include "efi-loader.h" #include "fd-util.h" #include "fileio.h" @@ -166,28 +167,25 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, bool requir if (r < 0) return r; - if (require) { - const char *dmname; + const char *dmname; + dmname = strjoina("dev-mapper-", e, ".device"); + if (require) { r = generator_add_symlink(arg_dest, "cryptsetup.target", "requires", n); if (r < 0) return r; - dmname = strjoina("dev-mapper-", e, ".device"); r = generator_add_symlink(arg_dest, dmname, "requires", n); if (r < 0) return r; } - p = strjoina(arg_dest, "/dev-mapper-", e, ".device.d/50-job-timeout-sec-0.conf"); - mkdir_parents_label(p, 0755); - r = write_string_file(p, - "# Automatically generated by systemd-gpt-auto-generator\n\n" - "[Unit]\n" - "JobTimeoutSec=0\n", - WRITE_STRING_FILE_CREATE); /* the binary handles timeouts anyway */ + r = write_drop_in_format(arg_dest, dmname, 50, "job-timeout", + "# Automatically generated by systemd-gpt-auto-generator\n\n" + "[Unit]\n" + "JobTimeoutSec=0"); /* the binary handles timeouts anyway */ if (r < 0) - return log_error_errno(r, "Failed to write device drop-in: %m"); + log_warning_errno(r, "Failed to write device timeout drop-in, ignoring: %m"); if (device) { char *ret; |