There are two patches needed in grub2 to support multi-device btrfs volumes.

This first patch (previously submitted) involves the parameters passed to grub2-probe. If not correctly passed, grub2-probe issues an error message. The related problem report is:
  https://bugzilla.redhat.com/show_bug.cgi?id=890955

The second problem involves having a multi-device btrfs volume with /boot being on the btrfs volume either as part of the root subvolume or as a separate subvolume. The result is an error messare at boot time:
    error: no such device: root.
    hit any key to continue

The solution is to modify grub-probe.c so that " " is issued rather than "\n" for a hint. The related problem report is:
  https://bugzilla.redhat.com/show_bug.cgi?id=1023161

To minimize problems, the two patches have been attached rather than provided inline.

Peter, I cc'ed you so you would be aware of these bug reports. It would be nice if this was applied to both Fedora 20 and 19.

Gene

From b9ed3e49354f5159d962c083b68cf06723a4aff5 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <grub2-ow...@fedoraproject.org>
Date: Mon, 14 Oct 2013 16:11:00 -0400
Subject: [PATCH] support for multi-device btrfs volume

The current code produces error messages if passed a device
list with multiple devices for a btrfs volume.  It worked OK
for single device btrfs volume.

This has been regression tested with root/boot on a regular
partition, single device VG logical volume, and single
device btrfs volume.

The name was change from device to devices to indicate that it
could be a device list plus the comments were added.
---
 util/grub-mkconfig_lib.in | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index b48e2af..d4d6ba0 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -270,10 +270,13 @@ gettext_printf () {
   printf "$(gettext "$gettext_printf_format")" "$@"
 }
 
+# $1 may be a list of devices separated by blanks.  grub_probe accepts
+# multiple arguments after --device but each device must be in a separate
+# argument.  Hence ${devices} rather than "${devices}".
 uses_abstraction () {
-  device="$1"
+  devices="$1"
 
-  abstraction="`"${grub_probe}" --device "${device}" --target=abstraction`"
+  abstraction="`"${grub_probe}" --device ${devices} --target=abstraction`"
   for module in ${abstraction}; do
     if test "x${module}" = "x$2"; then
       return 0
-- 
1.8.3.1
From 4be122b0d3a8f961eaba08d67656b0afbd77f5a5 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <grub2-ow...@fedoraproject.org>
Date: Sat, 26 Oct 2013 06:37:28 -0400
Subject: [PATCH] fix for hint problem with multi device btrfs
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

A btrfs volume can consist of more than one device.  Having
the output on different lines screws up the scripts which,
for the most part, expect only a single device.
---
 util/grub-probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/grub-probe.c b/util/grub-probe.c
index a46f0b1..dd5de00 100644
--- a/util/grub-probe.c
+++ b/util/grub-probe.c
@@ -543,7 +543,7 @@ probe (const char *path, char **device_names, char delim)
 	      print_full_name (map, dev);
 	      printf ("' ");
 	    }
-	  printf ("\n");
+	  printf (" "); /* new-line causes problems for multi-device btrfs volumes */
 
 	  grub_device_close (dev);
 	  continue;
-- 
1.8.3.1

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to