limine-deploy: Fix bug where any_active is not properly set

This commit is contained in:
mintsuki 2022-05-28 04:58:00 +02:00
parent 0d07b9db15
commit dd0790a5e0

View File

@ -432,7 +432,6 @@ int main(int argc, char *argv[]) {
device_read(&hint8, 446, sizeof(uint8_t)); device_read(&hint8, 446, sizeof(uint8_t));
if (hint8 != 0x00 && hint8 != 0x80) { if (hint8 != 0x00 && hint8 != 0x80) {
any_active = any_active ? any_active : (hint8 & 0x80) != 0;
if (!force_mbr) { if (!force_mbr) {
mbr = 0; mbr = 0;
} else { } else {
@ -440,9 +439,9 @@ int main(int argc, char *argv[]) {
device_write(&hint8, 446, sizeof(uint8_t)); device_write(&hint8, 446, sizeof(uint8_t));
} }
} }
any_active = any_active ? any_active : (hint8 & 0x80) != 0;
device_read(&hint8, 462, sizeof(uint8_t)); device_read(&hint8, 462, sizeof(uint8_t));
if (hint8 != 0x00 && hint8 != 0x80) { if (hint8 != 0x00 && hint8 != 0x80) {
any_active = any_active ? any_active : (hint8 & 0x80) != 0;
if (!force_mbr) { if (!force_mbr) {
mbr = 0; mbr = 0;
} else { } else {
@ -450,9 +449,9 @@ int main(int argc, char *argv[]) {
device_write(&hint8, 462, sizeof(uint8_t)); device_write(&hint8, 462, sizeof(uint8_t));
} }
} }
any_active = any_active ? any_active : (hint8 & 0x80) != 0;
device_read(&hint8, 478, sizeof(uint8_t)); device_read(&hint8, 478, sizeof(uint8_t));
if (hint8 != 0x00 && hint8 != 0x80) { if (hint8 != 0x00 && hint8 != 0x80) {
any_active = any_active ? any_active : (hint8 & 0x80) != 0;
if (!force_mbr) { if (!force_mbr) {
mbr = 0; mbr = 0;
} else { } else {
@ -460,9 +459,9 @@ int main(int argc, char *argv[]) {
device_write(&hint8, 478, sizeof(uint8_t)); device_write(&hint8, 478, sizeof(uint8_t));
} }
} }
any_active = any_active ? any_active : (hint8 & 0x80) != 0;
device_read(&hint8, 494, sizeof(uint8_t)); device_read(&hint8, 494, sizeof(uint8_t));
if (hint8 != 0x00 && hint8 != 0x80) { if (hint8 != 0x00 && hint8 != 0x80) {
any_active = any_active ? any_active : (hint8 & 0x80) != 0;
if (!force_mbr) { if (!force_mbr) {
mbr = 0; mbr = 0;
} else { } else {
@ -470,6 +469,7 @@ int main(int argc, char *argv[]) {
device_write(&hint8, 494, sizeof(uint8_t)); device_write(&hint8, 494, sizeof(uint8_t));
} }
} }
any_active = any_active ? any_active : (hint8 & 0x80) != 0;
char hintc[64]; char hintc[64];
device_read(hintc, 4, 8); device_read(hintc, 4, 8);