All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gene Czarcinski <gene@czarc.net>
To: grub-devel@gnu.org
Cc: Chris Murphy <bugzilla@colorremedies.com>,
	Gene Czarcinski <gczarcinski@gmail.com>
Subject: BUGS: btrfs multi-device support fixes
Date: Sat, 26 Oct 2013 11:36:30 -0400	[thread overview]
Message-ID: <526BE17E.1060802@czarc.net> (raw)

[-- 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


             reply	other threads:[~2013-10-26 15:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-26 15:36 Gene Czarcinski [this message]
2013-10-26 16:27 ` BUGS: btrfs multi-device support fixes 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

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=526BE17E.1060802@czarc.net \
    --to=gene@czarc.net \
    --cc=bugzilla@colorremedies.com \
    --cc=gczarcinski@gmail.com \
    --cc=grub-devel@gnu.org \
    /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.