Avoid consuming lots of space and time if the first partition is not near the start of the disk (Debian bug #619458, Ubuntu bug #691569).

This commit is contained in:
Colin Watson 2011-03-25 17:22:12 +00:00
parent 7bdeb3987a
commit 58ed62d221
5 changed files with 27 additions and 7 deletions

View file

@ -426,10 +426,8 @@ setup (const char *dir,
}
nsec = core_sectors;
err = dest_partmap->embed (dest_dev->disk, &nsec,
err = dest_partmap->embed (dest_dev->disk, &nsec, 2 * core_sectors,
GRUB_EMBED_PCBIOS, &sectors);
if (nsec > 2 * core_sectors)
nsec = 2 * core_sectors;
if (err)
{