From: Ian Campbell <ijc@hellion.org.uk>
To: grub-devel@gnu.org
Cc: 456777@bugs.debian.org, Robert Millan <rmh@aybabtu.com>
Subject: Please support installation on Xen virtual block devices
Date: Thu, 24 Apr 2008 20:28:41 +0100 [thread overview]
Message-ID: <1209065321.2063.8.camel@localhost.localdomain> (raw)
[-- 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 --]
next reply other threads:[~2008-04-24 19:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-24 19:28 Ian Campbell [this message]
2008-05-06 15:29 ` Please support installation on Xen virtual block devices 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
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=1209065321.2063.8.camel@localhost.localdomain \
--to=ijc@hellion.org.uk \
--cc=456777@bugs.debian.org \
--cc=grub-devel@gnu.org \
--cc=rmh@aybabtu.com \
/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 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.