:: commit d3c4262cbf3b589586db1370d61f846f0ea4fa28

mintsuki <mintsuki@protonmail.com> — 2022-07-28 20:48

parents: 42d7dfe5dc

mbr: Make detection more lax. Addresses #185

diff --git a/common/lib/part.s2.c b/common/lib/part.s2.c
index d901c175..63ef7603 100644
--- a/common/lib/part.s2.c
+++ b/common/lib/part.s2.c
@@ -248,10 +248,6 @@ bool is_valid_mbr(struct volume *volume) {
     // Check if actually valid mbr
     uint16_t hint = 0;
 
-    volume_read(volume, &hint, 510, sizeof(uint16_t));
-    if (hint != 0xaa55)
-        return false;
-
     volume_read(volume, &hint, 446, sizeof(uint8_t));
     if ((uint8_t)hint != 0x00 && (uint8_t)hint != 0x80)
         return false;
diff --git a/host/limine-deploy.c b/host/limine-deploy.c
index 7b37619f..f874280c 100644
--- a/host/limine-deploy.c
+++ b/host/limine-deploy.c
@@ -616,18 +616,6 @@ int main(int argc, char *argv[]) {
         uint8_t hint8 = 0;
         uint16_t hint16 = 0;
 
-        device_read(&hint16, 510, sizeof(uint16_t));
-        hint16 = ENDSWAP(hint16);
-        if (hint16 != 0xaa55) {
-            if (!force_mbr) {
-                mbr = 0;
-            } else {
-                hint16 = 0xaa55;
-                hint16 = ENDSWAP(hint16);
-                device_write(&hint16, 510, sizeof(uint16_t));
-            }
-        }
-
         bool any_active = false;
 
         device_read(&hint8, 446, sizeof(uint8_t));
tab: 248 wrap: offon