* partmap/msdos.c (embed_signatures): New array.
(pc_partition_map_embed): Check for and avoid sectors matching any of the signatures in embed_signatures. * util/grub-setup.c (setup): Allow for the embedding area being split into multiple blocklists.
This commit is contained in:
parent
03df09c7c8
commit
1e44c52a69
3 changed files with 97 additions and 7 deletions
|
@ -442,6 +442,13 @@ setup (const char *dir,
|
|||
save_blocklists (sectors[i] + grub_partition_get_start (container),
|
||||
0, GRUB_DISK_SECTOR_SIZE);
|
||||
|
||||
/* Make sure that the last blocklist is a terminator. */
|
||||
if (block == first_block)
|
||||
block--;
|
||||
block->start = 0;
|
||||
block->len = 0;
|
||||
block->segment = 0;
|
||||
|
||||
write_rootdev (core_img, root_dev, boot_img, first_sector);
|
||||
|
||||
core_img = realloc (core_img, nsec * GRUB_DISK_SECTOR_SIZE);
|
||||
|
@ -458,12 +465,6 @@ setup (const char *dir,
|
|||
nsec * GRUB_DISK_SECTOR_SIZE
|
||||
- core_size);
|
||||
|
||||
/* Make sure that the second blocklist is a terminator. */
|
||||
block = first_block - 1;
|
||||
block->start = 0;
|
||||
block->len = 0;
|
||||
block->segment = 0;
|
||||
|
||||
/* Write the core image onto the disk. */
|
||||
for (i = 0; i < nsec; i++)
|
||||
grub_disk_write (dest_dev->disk, sectors[i], 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue