]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
gpt-auto: define loader partition timeout as macro
authorMike Yuan <me@yhndnzj.com>
Sun, 8 Dec 2024 19:50:27 +0000 (20:50 +0100)
committerMike Yuan <me@yhndnzj.com>
Mon, 9 Dec 2024 18:25:59 +0000 (19:25 +0100)
src/gpt-auto-generator/gpt-auto-generator.c

index 8bb32afb279ad265d1047ce0ef6f9c06202183ed..150417626c15bd26fe678feb3c6bf2ce782f5de4 100644 (file)
@@ -51,6 +51,8 @@ STATIC_DESTRUCTOR_REGISTER(arg_image_policy, image_policy_freep);
 STATIC_DESTRUCTOR_REGISTER(arg_root_fstype, freep);
 STATIC_DESTRUCTOR_REGISTER(arg_root_options, freep);
 
+#define LOADER_PARTITION_IDLE_USEC (120 * USEC_PER_SEC)
+
 static int add_cryptsetup(
                 const char *id,
                 const char *what,
@@ -499,7 +501,7 @@ static int add_partition_xbootldr(DissectedPartition *p) {
                         /* growfs= */ false,
                         options,
                         "Boot Loader Partition",
-                        120 * USEC_PER_SEC);
+                        LOADER_PARTITION_IDLE_USEC);
 }
 
 #if ENABLE_EFI
@@ -566,7 +568,7 @@ static int add_partition_esp(DissectedPartition *p, bool has_xbootldr) {
                         /* growfs= */ false,
                         options,
                         "EFI System Partition Automount",
-                        120 * USEC_PER_SEC);
+                        LOADER_PARTITION_IDLE_USEC);
 }
 #else
 static int add_partition_esp(DissectedPartition *p, bool has_xbootldr) {