:: commit 06458888dd8b6146d7b49c374f5c99bd96f3e4cd

Mintsuki <mintsuki@protonmail.com> — 2025-08-16 06:16

parents: f8068f7e3e

host/limine: Ensure GPT BIOS partition is at least 32KiB

diff --git a/host/limine.c b/host/limine.c
index 94900051..36fd97db 100644
--- a/host/limine.c
+++ b/host/limine.c
@@ -1088,6 +1088,11 @@ part_too_low:
                 goto cleanup;
             }
 
+            if (((ENDSWAP(gpt_entry.ending_lba) - ENDSWAP(gpt_entry.starting_lba)) + 1) * lb_size < 32768) {
+                fprintf(stderr, "%s: error: Partition with index `%s` is smaller than 32KiB.\n", program_name, part_ndx);
+                goto cleanup;
+            }
+
             if (!quiet) {
                 fprintf(stderr, "GPT partition specified. Installing there instead of embedding.\n");
             }
tab: 248 wrap: offon