grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: [PATCH] fix partition module names when /boot is on diskfilter
Date: Sat,  7 Dec 2013 14:46:01 +0400	[thread overview]
Message-ID: <1386413161-15520-1-git-send-email-arvidjaar@gmail.com> (raw)

/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;
     }
 
-- 
tg: (5ffdfb2..) u/fix-part-modules-for-diskfilter (depends on: master u/fix-grub-install-on-hdX)


             reply	other threads:[~2013-12-07 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-07 10:46 Andrey Borzenkov [this message]
2013-12-07 10:53 ` [PATCH] fix partition module names when /boot is on diskfilter Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386413161-15520-1-git-send-email-arvidjaar@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).