fix partition module names when /boot is on diskfilter
/usr/local/grub2/sbin/grub-install: info: grub-mkimage --directory '/usr/local/grub2/lib/grub/i386-pc' --prefix '(mduuid/e6d1dcf06cea72140bafae74a8677f36)/grub' --output '/boot/grub/i386-pc/core.img' --format 'i386-pc' --compression 'auto' 'ext2' 'msdos' 'msdos' 'diskfilter' 'mdraid1x' 'biosdisk' . /usr/local/grub2/sbin/grub-install: error: cannot open `/usr/local/grub2/lib/grub/i386-pc/msdos.mod': No such file or directory. Introduce common helper for both diskfilter and non-diskfilter case that converts partition map names into module names.
This commit is contained in:
parent
5ff249072d
commit
f585c90505
4 changed files with 71 additions and 39 deletions
|
@ -322,6 +322,21 @@ probe_raid_level (grub_disk_t disk)
|
|||
return ((struct grub_diskfilter_lv *) disk->data)->segments->type;
|
||||
}
|
||||
|
||||
static void
|
||||
push_partmap_module (const char *map)
|
||||
{
|
||||
char buf[50];
|
||||
|
||||
if (strcmp (map, "openbsd") == 0 || strcmp (map, "netbsd") == 0)
|
||||
{
|
||||
grub_install_push_module ("part_bsd");
|
||||
return;
|
||||
}
|
||||
|
||||
snprintf (buf, sizeof (buf), "part_%s", map);
|
||||
grub_install_push_module (buf);
|
||||
}
|
||||
|
||||
static void
|
||||
probe_mods (grub_disk_t disk)
|
||||
{
|
||||
|
@ -333,21 +348,11 @@ probe_mods (grub_disk_t disk)
|
|||
grub_util_info ("no partition map found for %s", disk->name);
|
||||
|
||||
for (part = disk->partition; part; part = part->parent)
|
||||
{
|
||||
char buf[50];
|
||||
if (strcmp (part->partmap->name, "openbsd") == 0
|
||||
|| strcmp (part->partmap->name, "netbsd") == 0)
|
||||
{
|
||||
grub_install_push_module ("part_bsd");
|
||||
continue;
|
||||
}
|
||||
snprintf (buf, sizeof (buf), "part_%s", part->partmap->name);
|
||||
grub_install_push_module (buf);
|
||||
}
|
||||
push_partmap_module (part->partmap->name);
|
||||
|
||||
if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID)
|
||||
{
|
||||
grub_diskfilter_get_partmap (disk, grub_install_push_module);
|
||||
grub_diskfilter_get_partmap (disk, push_partmap_module);
|
||||
have_abstractions = 1;
|
||||
}
|
||||
|
||||
|
@ -1098,7 +1103,13 @@ main (int argc, char *argv[])
|
|||
{
|
||||
if (install_device[0] == '('
|
||||
&& install_device[grub_strlen (install_device) - 1] == ')')
|
||||
install_drive = xstrdup (install_device);
|
||||
{
|
||||
|
||||
size_t len = grub_strlen (install_device) - 2;
|
||||
install_drive = xmalloc (len + 1);
|
||||
memcpy (install_drive, install_device + 1, len);
|
||||
install_drive[len] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_util_pull_device (install_device);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue