diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 62c1bf1..d2c5a73 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -365,6 +365,15 @@ setup (const char *dir, /* The core image must be put on a filesystem unfortunately. */ grub_util_info ("will leave the core image on the filesystem"); + /* Write the second sector of the core image onto the disk. */ + grub_util_info ("opening the core image `%s'", core_path); + fp = fopen (core_path, "r+b"); + if (! fp) + grub_util_error ("Cannot open `%s'", core_path); + grub_util_write_image_at (core_img + GRUB_DISK_SECTOR_SIZE, + GRUB_DISK_SECTOR_SIZE, GRUB_DISK_SECTOR_SIZE, fp); + fclose (fp); + /* Make sure that GRUB reads the identical image as the OS. */ tmp_img = xmalloc (core_size); core_path_dev = grub_util_get_path (DEFAULT_DIRECTORY, core_file); @@ -485,13 +494,13 @@ setup (const char *dir, the boot device. */ *root_drive = 0xFF; - /* Write the first two sectors of the core image onto the disk. */ + /* Write the first sector of the core image onto the disk. */ grub_util_info ("opening the core image `%s'", core_path); fp = fopen (core_path, "r+b"); if (! fp) grub_util_error ("Cannot open `%s'", core_path); - grub_util_write_image (core_img, GRUB_DISK_SECTOR_SIZE * 2, fp); + grub_util_write_image (core_img, GRUB_DISK_SECTOR_SIZE, fp); fclose (fp); /* Write the boot image onto the disk. */