From f5bc53eb7f3caf1782833cf3433e4b4f06a89275 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Sat, 15 Aug 2009 21:58:25 +0200 Subject: [PATCH] Patched grub for vitio blockdevice --- lfs/grub | 1 + .../grub-0.97_grub-install_virtio.patch | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/patches/grub-0.97_grub-install_virtio.patch diff --git a/lfs/grub b/lfs/grub index 979dbe9d2c..ed801f8e8a 100644 --- a/lfs/grub +++ b/lfs/grub @@ -81,6 +81,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-0.93-special-device-names.patch cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-0.95-moreraid.patch cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-0.94-i2o.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-0.97_grub-install_virtio.patch cd $(DIR_APP) && perl -pi -e 's,/usr/lib/grub/i386-pc,/usr/share/grub/i386-pc,' docs/grub.texi cd $(DIR_APP) && sed -i 's/AM_INIT_AUTOMAKE/&\nAM_PROG_AS/' configure.ac diff --git a/src/patches/grub-0.97_grub-install_virtio.patch b/src/patches/grub-0.97_grub-install_virtio.patch new file mode 100644 index 0000000000..432e0f145a --- /dev/null +++ b/src/patches/grub-0.97_grub-install_virtio.patch @@ -0,0 +1,41 @@ +diff -Naur grub-0.97.org/util/grub-install.in grub-0.97/util/grub-install.in +--- grub-0.97.org/util/grub-install.in 2004-07-24 20:57:31.000000000 +0200 ++++ grub-0.97/util/grub-install.in 2009-08-14 20:01:20.000000000 +0200 +@@ -96,12 +96,12 @@ + # Break the device name into the disk part and the partition part. + case "$host_os" in + linux*) +- tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \ ++ tmp_disk=`echo "$1" | sed -e 's%\([vsh]d[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%' \ ++ tmp_part=`echo "$1" | sed -e 's%.*/[vsh]d[a-z]\([0-9]*\)$%\1%' \ + -e 's%.*d[0-9]*p%%' \ + -e 's%.*/fd[0-9]*$%%' \ + -e 's%.*/floppy/[0-9]*$%%' \ +@@ -333,6 +333,10 @@ + if test -f "$device_map"; then + : + else ++ ++ tmp_disk=`echo "$1" | grep "/dev/vd"` ++ if test "x$tmp_disk" = x; then ++ + # Create a safe temporary file. + test -n "$mklog" && log_file=`$mklog` + +@@ -345,6 +349,11 @@ + fi + + rm -f $log_file ++ ++ else ++ echo "Create fake device.map for vitio device $1" 1>&2 ++ echo "(hd0) $1" > $device_map ++ fi + fi + + # Make sure that there is no duplicated entry. -- 2.39.2