:: commit 7e81f5a8526ed65c475c3b5222c46d280dfbbcf9

mintsuki <mintsuki@protonmail.com> — 2022-07-16 15:32

parents: 3a7172abf7

mbr: Relax MBR validation requirements. Closes #195

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);
tab: 248 wrap: offon