grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: [PATCH 2/2 v2] second attempt to fix using grub device name as install device
Date: Sat,  7 Dec 2013 14:19:45 +0400	[thread overview]
Message-ID: <1386411585-31020-1-git-send-email-arvidjaar@gmail.com> (raw)
In-Reply-To: <52A2EDA1.7020303@gmail.com>

grub-install already resolved passed install device to grub device. So do the
same as grub-setup and strip parenthesis if we get legacy (hdX).

---
 ChangeLog           | 4 ++--
 util/grub-install.c | 8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b93db5e..161c568 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
 2013-11-29  Andrey Borzenkov <arvidjaar@gmail.com>
 
-	Revert commit 69ca97c820, it cause failures in using OS device name
-	in grub-install.
+	Revert commit 69ca97c820, it caused failures when using OS device name
+	in grub-install. Instead just strip off parenthesis in grub-install		if (hdX) was passed.
 
 2013-12-06  Vladimir Serbinenko  <phcoder@gmail.com>
 
diff --git a/util/grub-install.c b/util/grub-install.c
index 7a1db42..0a9790a 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -1098,7 +1098,13 @@ main (int argc, char *argv[])
     {
       if (install_device[0] == '('
 	  && install_device[grub_strlen (install_device) - 1] == ')')
-	install_drive = xstrdup (install_device);
+        {
+	  
+	  size_t len = grub_strlen (install_device) - 2;
+	  install_drive = xmalloc (len + 1);
+	  memcpy (install_drive, install_device + 1, len);
+	  install_drive[len] = '\0';
+        }
       else
 	{
 	  grub_util_pull_device (install_device);
-- 
tg: (074285e..) u/fix-grub-install-on-hdX (depends on: u/revert-69ca97c820)


  reply	other threads:[~2013-12-07 10:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-04 21:39 [PATCH] Fix grub-install with OS device name Colin Watson
2013-12-04 21:54 ` Jonathan McCune
2013-12-04 22:15   ` Colin Watson
2013-12-05  5:56     ` arvidjaar
2013-12-05  7:08       ` Andrey Borzenkov
2013-12-07  8:44         ` [PATCH 1/2] revert 69ca97c820, it broke using OS device name as install device Andrey Borzenkov
2013-12-07  8:44           ` [PATCH 2/2] second attempt to fix using grub " Andrey Borzenkov
2013-12-07  8:47             ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-07  9:40               ` Andrey Borzenkov
2013-12-07  9:42                 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-07 10:19                   ` Andrey Borzenkov [this message]
2013-12-07 13:50                     ` [PATCH 2/2 v2] " Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-07 13:59                       ` Andrey Borzenkov
2013-12-07 14:14                         ` Vladimir 'φ-coder/phcoder' Serbinenko

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=1386411585-31020-1-git-send-email-arvidjaar@gmail.com \
    --to=arvidjaar@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 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).