From 756b6749a26d1b31289e197c02e05c7e5954c8ae Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sun, 8 Dec 2024 20:50:27 +0100 Subject: [PATCH] gpt-auto: define loader partition timeout as macro --- src/gpt-auto-generator/gpt-auto-generator.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index 8bb32afb27..150417626c 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -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) {