:: commit ddf248aaf8c6b38d2c602b99a0c419f2e42225ea

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

parents: e5f2b2c085

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

diff --git a/limine-deploy/limine-deploy.c b/limine-deploy/limine-deploy.c
index e32c00d7..b01eb6bd 100644
--- a/limine-deploy/limine-deploy.c
+++ b/limine-deploy/limine-deploy.c
@@ -471,13 +471,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) {
@@ -508,6 +501,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