From ddf248aaf8c6b38d2c602b99a0c419f2e42225ea Mon Sep 17 00:00:00 2001 From: mintsuki Date: Fri, 15 Apr 2022 19:59:58 +0200 Subject: [PATCH] limine-deploy: Move code to activate partition to after MBR detection --- limine-deploy/limine-deploy.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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) {