grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* BUGS: btrfs multi-device support fixes
@ 2013-10-26 15:36 Gene Czarcinski
  2013-10-26 16:27 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 16+ messages in thread
From: Gene Czarcinski @ 2013-10-26 15:36 UTC (permalink / raw)
  To: grub-devel; +Cc: Chris Murphy, Gene Czarcinski

[-- Attachment #1: Type: text/plain, Size: 997 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-support-for-multi-device-btrfs-volume.patch --]
[-- Type: text/x-patch; name="0001-support-for-multi-device-btrfs-volume.patch", Size: 1495 bytes --]

From b9ed3e49354f5159d962c083b68cf06723a4aff5 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <grub2-owner@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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-fix-for-hint-problem-with-multi-device-btrfs.patch --]
[-- Type: text/x-patch; name="0001-fix-for-hint-problem-with-multi-device-btrfs.patch", Size: 974 bytes --]

From 4be122b0d3a8f961eaba08d67656b0afbd77f5a5 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <grub2-owner@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


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

end of thread, other threads:[~2013-10-27 17:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-26 15:36 BUGS: btrfs multi-device support fixes Gene Czarcinski
2013-10-26 16:27 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-26 20:16   ` Gene Czarcinski
2013-10-27  6:54     ` Andrey Borzenkov
2013-10-27 14:47       ` Gene Czarcinski
2013-10-27 15:24         ` Andrey Borzenkov
2013-10-27 15:46           ` [PATCH] update grub web page with reference to GIT instead of bzr Andrey Borzenkov
2013-10-27 16:02             ` Bruce Dubbs
2013-10-27 16:11               ` Andrey Borzenkov
2013-10-27 16:23                 ` Bruce Dubbs
2013-10-27 16:58                   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-27 17:17                     ` Bruce Dubbs
2013-10-27 16:55             ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-27 15:51           ` BUGS: btrfs multi-device support fixes Bruce Dubbs
2013-10-27 16:00             ` Andrey Borzenkov
2013-10-27 17:51           ` Gene Czarcinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).