Added a bit of logic to possibly fall back to a fixed 512 block MBR in case
certain conditions indicate that we might deal with a fixed 512 bytes MBR on a non 512 byte block size medium. One condition is that at least one partition had to be shrunk to fit the available size (which usually happens with larger block sizes). We retry with a fixed 512 block size once and compare the result if it didn't improve the situation it is reverted again. This is mostly a preparation for the upcoming "anyboot" hybrid MBR/ISO images. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35664 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -399,7 +399,7 @@ Partition::CheckLocation(off_t sessionSize) const
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
bool
|
||||
Partition::FitSizeToSession(off_t sessionSize)
|
||||
{
|
||||
// To work around buggy (or older) BIOS, we shrink the partition size to
|
||||
@@ -408,8 +408,12 @@ Partition::FitSizeToSession(off_t sessionSize)
|
||||
// Also, the drive size is obviously reported differently sometimes; this
|
||||
// should let us read problematic drives - let the file system figure out
|
||||
// if something is wrong.
|
||||
if (sessionSize < fOffset + fSize && sessionSize > fOffset)
|
||||
if (sessionSize < fOffset + fSize && sessionSize > fOffset) {
|
||||
fSize = sessionSize - fOffset;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user