mbr: Make detection more lax. Addresses #185

This commit is contained in:
mintsuki 2022-07-28 22:48:04 +02:00
parent ff7d9502e5
commit c23eac8018
2 changed files with 0 additions and 16 deletions

View File

@ -248,10 +248,6 @@ bool is_valid_mbr(struct volume *volume) {
// Check if actually valid mbr // Check if actually valid mbr
uint16_t hint = 0; 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)); volume_read(volume, &hint, 446, sizeof(uint8_t));
if ((uint8_t)hint != 0x00 && (uint8_t)hint != 0x80) if ((uint8_t)hint != 0x00 && (uint8_t)hint != 0x80)
return false; return false;

View File

@ -616,18 +616,6 @@ int main(int argc, char *argv[]) {
uint8_t hint8 = 0; uint8_t hint8 = 0;
uint16_t hint16 = 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; bool any_active = false;
device_read(&hint8, 446, sizeof(uint8_t)); device_read(&hint8, 446, sizeof(uint8_t));