From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VpEzb-0002Un-0P for mharc-grub-devel@gnu.org; Sat, 07 Dec 2013 05:20:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpEzQ-0002Or-Ql for grub-devel@gnu.org; Sat, 07 Dec 2013 05:20:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VpEzI-0003zn-ES for grub-devel@gnu.org; Sat, 07 Dec 2013 05:20:00 -0500 Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]:56713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpEzI-0003zh-5m for grub-devel@gnu.org; Sat, 07 Dec 2013 05:19:52 -0500 Received: by mail-la0-f50.google.com with SMTP id el20so672161lab.9 for ; Sat, 07 Dec 2013 02:19:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=PcBb+nldJJbmdlIboqA8fSuHyyEPFwK9/KMtlKYvkT8=; b=oLqbQhYnQ4dfIvJ7waJoXNKDtuyF1MV1U4BH6ckpbhXzO8YEPMRZawoR4r9XgnScVD pkJZC+AELbGTGgQL5SjPfTFF4TxgSo083DDh2f/azhsKy4WYPu2NKonUHddP3/w98Jt2 KCFF/ANfiVzQ8R6D8d7MnP6+2IBPp1QJ5P0BHfVCVnjPBgVoQOvNzeg5+v063t7cz8Jy CERLQEt8bADPk6JvhVU7MaxJ73XKXWxxC/L0NLkrRiw/OGlp/OSVPsO6TUEXI1W9W3mk 8s7j3IqVPPnsZP3GIwgetLSpH+nUlXXa22qRKaYvGVbnp8mJFLrNIxA8BMkXbaC4y2hK b+cQ== X-Received: by 10.152.2.197 with SMTP id 5mr2080848law.17.1386411590782; Sat, 07 Dec 2013 02:19:50 -0800 (PST) Received: from localhost.localdomain (ppp91-76-134-134.pppoe.mtu-net.ru. [91.76.134.134]) by mx.google.com with ESMTPSA id c15sm1550037lbq.11.2013.12.07.02.19.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Dec 2013 02:19:50 -0800 (PST) From: Andrey Borzenkov 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 Message-Id: <1386411585-31020-1-git-send-email-arvidjaar@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <52A2EDA1.7020303@gmail.com> References: <52A2EDA1.7020303@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::232 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Dec 2013 10:20:09 -0000 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 - 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 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)