grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fix partition module names when /boot is on diskfilter


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [PATCH] fix partition module names when /boot is on diskfilter
Date: Sat, 07 Dec 2013 11:53:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9

Go ahead.
On 07.12.2013 11:46, Andrey Borzenkov wrote:
> /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.
> 
> ---
>  util/grub-install.c | 29 +++++++++++++++++------------
>  1 file changed, 17 insertions(+), 12 deletions(-)
> 
> diff --git a/util/grub-install.c b/util/grub-install.c
> index e0d942f..4cc557e 100644
> --- a/util/grub-install.c
> +++ b/util/grub-install.c
> @@ -323,6 +323,21 @@ probe_raid_level (grub_disk_t disk)
>  }
>  
>  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)
>  {
>    grub_partition_t part;
> @@ -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;
>      }
>  
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]