All of lore.kernel.org
 help / color / mirror / Atom feed
* Please support installation on Xen virtual block devices
@ 2008-04-24 19:28 Ian Campbell
  2008-05-06 15:29 ` Ian Campbell
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Campbell @ 2008-04-24 19:28 UTC (permalink / raw)
  To: grub-devel; +Cc: 456777, Robert Millan


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

I filed this patch against the Debian grub2 package and the maintainer
asked me to bring it to grub-devel@gnu.org. Took me an age but here I
am ;-) [resending now I'm subscribed].

Back then I said:
> The grub package does not currently support installation in a Xen
> guest domain because it does not understand the Xen virtual block
> devices (/dev/xvd[a-z]).
> 
> This support is mainly useful because it allows the Debian installer to
> work in a Xen guest without Xen specific workarounds.
> 
> It might also be useful for someone who wanted to switch between
> a guest between para-virtual and fully-virtualised (HVM) operation.

Patch is attached.

Ian.
-- 
Ian Campbell
Current Noise: Strapping Young Lad - Antiproduct

The Public is merely a multiplied "me."
		-- Mark Twain

[-- Attachment #1.2: 04_support-xvd.diff --]
[-- Type: text/x-patch, Size: 1692 bytes --]

Index: grub2-1.95+20071101/util/biosdisk.c
===================================================================
--- grub2-1.95+20071101.orig/util/biosdisk.c	2007-12-16 16:41:43.000000000 +0000
+++ grub2-1.95+20071101/util/biosdisk.c	2007-12-16 16:42:29.000000000 +0000
@@ -640,6 +640,13 @@
 	  return path;
 	}
       
+      if ((strncmp ("xvd", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z')
+        {
+	  /* /dev/xvd[a-z][0-9]* */
+	  p[4] = '\0';
+	  return path;
+	}
+
       /* If this is an IDE disk or a SCSI disk.  */
       if ((strncmp ("hd", p, 2) == 0
 	   || strncmp ("sd", p, 2) == 0)
Index: grub2-1.95+20071101/util/grub-mkdevicemap.c
===================================================================
--- grub2-1.95+20071101.orig/util/grub-mkdevicemap.c	2007-12-16 16:41:43.000000000 +0000
+++ grub2-1.95+20071101/util/grub-mkdevicemap.c	2007-12-16 16:49:22.000000000 +0000
@@ -273,6 +273,13 @@
 {
   sprintf (name, "/dev/i2o/hd%c", unit);
 }
+
+static void
+get_xvd_disk_name (char *name, int unit)
+{
+  sprintf (name, "/dev/xvd%c", unit + 'a');
+}
+
 #endif
 
 /* Check if DEVICE can be read. If an error occurs, return zero,
@@ -515,6 +522,24 @@
   }
 #endif /* __linux__ */
 
+#ifdef __linux__
+  /* Xen Virtual Disks. */
+  for (i = 0; i < 16; i++)
+    {
+      char name[16];
+
+      get_xvd_disk_name (name, i);
+      if (check_device (name))
+        {
+            char *p;
+            p = grub_util_get_disk_name (num_hd, name);
+            fprintf (fp, "(%s)\t%s\n", p, name);
+            free (p);
+            num_hd++;
+        }
+    }
+#endif
+
  finish:
   if (fp != stdout)
     fclose (fp);

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2008-05-12 15:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-24 19:28 Please support installation on Xen virtual block devices Ian Campbell
2008-05-06 15:29 ` Ian Campbell
2008-05-06 21:33   ` Pavel Roskin
2008-05-07 12:43     ` Robert Millan
2008-05-07 17:33       ` Pavel Roskin
2008-05-07 18:51         ` Ian Campbell
2008-05-07 20:49           ` Pavel Roskin
2008-05-07 21:07             ` Ian Campbell
2008-05-09 12:53               ` Robert Millan
2008-05-10 12:03                 ` Ian Campbell
2008-05-11  5:35                   ` Pavel Roskin
2008-05-12 15:33                   ` Robert Millan

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.