All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix prefix problem with LVM on RAID
@ 2008-02-23 20:54 Michael Guntsche
  2008-02-24 16:37 ` Michael Guntsche
  2008-04-13 15:04 ` Robert Millan
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Guntsche @ 2008-02-23 20:54 UTC (permalink / raw)
  To: The GRUB 2 development of


[-- Attachment #1.1: Type: text/plain, Size: 604 bytes --]

Hello,

While testing a soon to be deployed setup here I noticed that grub- 
setup is setting the prefix wrong if you run
LVM on Software RAID

grub-setup -v /dev/md0
...
grub-setup: info: dos partition is -2, bsd partition is -2, prefix is  
(md0)(fatoftheland-main)/boot/grub
...

As you can see the there is also (md0) in the prefix which does not  
work.
Attached a small patch that fixes this problem for me. I am not sure  
if it is the best way to fix it so please take a look.
If the root device is on LVM only add the LVM part if it is on RAID  
only add the RAID part.

Kind regards,
Michael



[-- Attachment #1.2: lvm-on-raid.patch --]
[-- Type: application/octet-stream, Size: 928 bytes --]

Index: util/i386/pc/grub-setup.c
===================================================================
RCS file: /sources/grub/grub2/util/i386/pc/grub-setup.c,v
retrieving revision 1.34
diff -u -r1.34 grub-setup.c
--- util/i386/pc/grub-setup.c	19 Feb 2008 14:00:11 -0000	1.34
+++ util/i386/pc/grub-setup.c	23 Feb 2008 19:10:34 -0000
@@ -610,6 +610,7 @@
   char *prefix;
   char *dest_dev;
   int must_embed = 0;
+  int is_lvm = 0;
   
   progname = "grub-setup";
 
@@ -742,6 +743,7 @@
     {
       char *newprefix;
       must_embed = 1;
+      is_lvm = 1;
 
       newprefix = xmalloc (1 + strlen (root_dev) + 1 + strlen (prefix) + 1);
       sprintf (newprefix, "(%s)%s", root_dev, prefix);
@@ -764,7 +766,7 @@
 
       for (i = 0; devicelist[i]; i++)
 	{
-	  setup (raid_prefix,
+	  setup (is_lvm ? prefix : raid_prefix,
 		 dir ? : DEFAULT_DIRECTORY,
 		 boot_file ? : DEFAULT_BOOT_FILE,
 		 core_file ? : DEFAULT_CORE_FILE,

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2417 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-04-13 17:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-23 20:54 [PATCH] Fix prefix problem with LVM on RAID Michael Guntsche
2008-02-24 16:37 ` Michael Guntsche
2008-04-13 15:04 ` Robert Millan
2008-04-13 16:07   ` Guntsche Michael
2008-04-13 16:40     ` Robert Millan
2008-04-13 17:03       ` Guntsche Michael

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.