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

This commit is contained in:
mintsuki 2022-04-15 19:59:58 +02:00
parent 0d0d2a00fc
commit ac01423e58

View File

@ -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]; char hintc[64];
device_read(hintc, 4, 8); device_read(hintc, 4, 8);
if (memcmp(hintc, "_ECH_FS_", 8) == 0) { if (memcmp(hintc, "_ECH_FS_", 8) == 0) {
@ -500,6 +493,13 @@ int main(int argc, char *argv[]) {
device_write(&hint16, 1080, sizeof(uint16_t)); 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) { if (gpt == 0 && mbr == 0) {