FS#30241 - [grub] grub-install doesn't understand Xen virtual block devices

Attached to Project: Arch Linux
Opened by Steven Noonan (neunon) - Monday, 11 June 2012, 01:04 GMT
Last edited by Ronald van Haren (pressh) - Monday, 25 June 2012, 08:17 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Ronald van Haren (pressh)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Here's an example of trying to install grub on a Xen VBD:

# grub-install /dev/xvdg
expr: non-integer argument
/dev/xvda1 does not have any corresponding BIOS drive.
#

The problem is a goofy regular expression in grub-install, which accounts for 'sd*', 'hd*', and several other block device types, but doesn't handle 'xvd*'.

This change resolves the issue:

diff -ur grub-0.97/util/grub-install.in grub-0.97/util/grub-install.in
--- grub-0.97/util/grub-install.in 2004-07-24 18:57:31.000000000 +0000
+++ grub-0.97/util/grub-install.in 2012-06-10 13:51:18.771960189 +0000
@@ -97,11 +97,13 @@
case "$host_os" in
linux*)
tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \
+ -e 's%\(xvd[a-z]\)[0-9]*$%\1%' \
-e 's%\(d[0-9]*\)p[0-9]*$%\1%' \
-e 's%\(fd[0-9]*\)$%\1%' \
-e 's%/part[0-9]*$%/disc%' \
-e 's%\(c[0-7]d[0-9]*\).*$%\1%'`
tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \
+ -e 's%.*/xvd[a-z]\([0-9]*\)$%\1%' \
-e 's%.*d[0-9]*p%%' \
-e 's%.*/fd[0-9]*$%%' \
-e 's%.*/floppy/[0-9]*$%%' \


# grub-install /dev/xvdg
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0) /dev/xvda
(hd1) /dev/xvdf
(hd2) /dev/xvdg
#
This task depends upon

Closed by  Ronald van Haren (pressh)
Monday, 25 June 2012, 08:17 GMT
Reason for closing:  Won't fix
Additional comments about closing:  We'll probably drop support for grub1 soon when grub2 reaches 2.00. For sure I won't add any new features to grub1 anymore.

Loading...