mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-27 01:29:27 +00:00
* include/grub/partition.h (grub_partition_map): Change prototype of
embed to take a maximum value for nsectors. * include/grub/emu/hostdisk.h (grub_util_ldm_embed): Likewise. * include/grub/fs.h (grub_fs): Likewise. * grub-core/partmap/msdos.c (embed_signatures): New array. (pc_partition_map_embed): Check for and avoid sectors matching any of the signatures in embed_signatures, up to max_nsectors. * grub-core/partmap/gpt.c (gpt_partition_map_embed): Restrict returned sector map to max_nsectors. * grub-core/disk/ldm.c (grub_util_ldm_embed): Likewise. * grub-core/fs/btrfs.c (grub_btrfs_embed): Likewise. * grub-core/fs/zfs/zfs.c (grub_zfs_embed): Likewise. * util/grub-setup.c (setup): Allow for the embedding area being split into multiple blocklists. Tell dest_partmap->embed the maximum number of sectors we care about.
This commit is contained in:
commit
e3c78337c3
10 files changed
+175
-17
No files matched your search
@@ -128,6 +128,7 @@ grub_gpt_partition_map_iterate (grub_disk_t disk,
|
||||
#ifdef GRUB_UTIL
|
||||
static grub_err_t
|
||||
gpt_partition_map_embed (struct grub_disk *disk_, unsigned int *nsectors,
|
||||
unsigned int max_nsectors,
|
||||
grub_embed_type_t embed_type,
|
||||
grub_disk_addr_t **sectors)
|
||||
{
|
||||
@@ -183,6 +184,8 @@ gpt_partition_map_embed (struct grub_disk *disk_, unsigned int *nsectors,
|
||||
" embedding won't be possible"));
|
||||
|
||||
*nsectors = len;
|
||||
if (*nsectors > max_nsectors)
|
||||
*nsectors = max_nsectors;
|
||||
*sectors = grub_malloc (*nsectors * sizeof (**sectors));
|
||||
if (!*sectors)
|
||||
return grub_errno;
|
||||
|
||||
Reference in new issue
Block a user