mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 00:29:23 +00:00
* grub/asmstub.c (biosdisk): Work around a bug in linux's ez
remapping. Problem reported by Ben Byer <bbyer@rice.edu>.
This commit is contained in:
1 parent
9e3e10d2c1
commit
68c2bd1e7b
2 files changed
+18
No files matched your search
@@ -872,6 +872,19 @@ biosdisk (int subfunc, int drive, struct geometry *geometry,
|
||||
switch (subfunc)
|
||||
{
|
||||
case BIOSDISK_READ:
|
||||
#ifdef __linux__
|
||||
if (sector == 0 && nsec > 1)
|
||||
{
|
||||
/* Work around a bug in linux's ez remapping. Linux remaps all
|
||||
sectors that are read together with the MBR in one read. It
|
||||
should only remap the MBR, so we split the read in two
|
||||
parts. -jochen */
|
||||
if (nread (fd, buf, SECTOR_SIZE) != SECTOR_SIZE)
|
||||
return -1;
|
||||
buf += SECTOR_SIZE;
|
||||
nsec--;
|
||||
}
|
||||
#endif
|
||||
if (nread (fd, buf, nsec * SECTOR_SIZE) != nsec * SECTOR_SIZE)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user