From ffb4ba6f55105702a05d040b990febd3524e6802 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sat, 16 Jul 2022 17:32:27 +0200 Subject: [PATCH] mbr: Relax MBR validation requirements. Closes #195 --- common/lib/part.s2.c | 7 ------- host/limine-deploy.c | 23 ----------------------- 2 files changed, 30 deletions(-) diff --git a/common/lib/part.s2.c b/common/lib/part.s2.c index eadd53e9..d901c175 100644 --- a/common/lib/part.s2.c +++ b/common/lib/part.s2.c @@ -247,13 +247,6 @@ struct mbr_entry { bool is_valid_mbr(struct volume *volume) { // Check if actually valid mbr uint16_t hint = 0; - volume_read(volume, &hint, 218, sizeof(uint16_t)); - if (hint != 0) - return false; - - volume_read(volume, &hint, 444, sizeof(uint16_t)); - if (hint != 0 && hint != 0x5a5a) - return false; volume_read(volume, &hint, 510, sizeof(uint16_t)); if (hint != 0xaa55) diff --git a/host/limine-deploy.c b/host/limine-deploy.c index 2d425b81..7b37619f 100644 --- a/host/limine-deploy.c +++ b/host/limine-deploy.c @@ -615,29 +615,6 @@ int main(int argc, char *argv[]) { uint8_t hint8 = 0; uint16_t hint16 = 0; - device_read(&hint16, 218, sizeof(uint16_t)); - hint16 = ENDSWAP(hint16); - if (hint16 != 0) { - if (!force_mbr) { - mbr = 0; - } else { - hint16 = 0; - hint16 = ENDSWAP(hint16); - device_write(&hint16, 218, sizeof(uint16_t)); - } - } - - device_read(&hint16, 444, sizeof(uint16_t)); - hint16 = ENDSWAP(hint16); - if (hint16 != 0 && hint16 != 0x5a5a) { - if (!force_mbr) { - mbr = 0; - } else { - hint16 = 0; - hint16 = ENDSWAP(hint16); - device_write(&hint16, 444, sizeof(uint16_t)); - } - } device_read(&hint16, 510, sizeof(uint16_t)); hint16 = ENDSWAP(hint16);