:: commit ac01423e5859860a9af72e1006cd7395fca5728f

mintsuki <mintsuki@protonmail.com> — 2022-04-15 17:59

parents: 0d0d2a00fc

limine-deploy: Move code to activate partition to after MBR detection

diff --git a/limine-install/limine-install.c b/limine-install/limine-install.c
index b5f28cbb..cdfd9c79 100644
--- a/limine-install/limine-install.c
+++ b/limine-install/limine-install.c
@@ -463,13 +463,6 @@ int main(int argc, char *argv[]) {
             }
         }
 
-        if (!any_active) {
-            fprintf(stderr, "No active partition found, some systems may not boot.\n");
-            fprintf(stderr, "Setting partition 1 as active to work around the issue...\n");
-            hint8 = 0x80;
-            device_write(&hint8, 446, sizeof(uint8_t));
-        }
-
         char hintc[64];
         device_read(hintc, 4, 8);
         if (memcmp(hintc, "_ECH_FS_", 8) == 0) {
@@ -500,6 +493,13 @@ int main(int argc, char *argv[]) {
                 device_write(&hint16, 1080, sizeof(uint16_t));
             }
         }
+
+        if (mbr && !any_active) {
+            fprintf(stderr, "No active partition found, some systems may not boot.\n");
+            fprintf(stderr, "Setting partition 1 as active to work around the issue...\n");
+            hint8 = 0x80;
+            device_write(&hint8, 446, sizeof(uint8_t));
+        }
     }
 
     if (gpt == 0 && mbr == 0) {
tab: 248 wrap: offon