From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LhZ90-00063O-0J for mharc-grub-devel@gnu.org; Wed, 11 Mar 2009 20:51:30 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhZ8w-00062k-Oc for grub-devel@gnu.org; Wed, 11 Mar 2009 20:51:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhZ8u-00062O-NH for grub-devel@gnu.org; Wed, 11 Mar 2009 20:51:25 -0400 Received: from [199.232.76.173] (port=50957 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhZ8u-00062L-Df for grub-devel@gnu.org; Wed, 11 Mar 2009 20:51:24 -0400 Received: from mail-fx0-f176.google.com ([209.85.220.176]:43429) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LhZ8t-00025A-Ug for grub-devel@gnu.org; Wed, 11 Mar 2009 20:51:24 -0400 Received: by fxm24 with SMTP id 24so223674fxm.42 for ; Wed, 11 Mar 2009 17:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=fILf6IjWY2EM9Aywkoma20zRmSeHeeZlkZd4lkmLG38=; b=MyWM8FC23fEJj4S8ri7LX8M+bRD99vY6lhxLsnhWfPg0IOPiIctzRtA+9oZ859Urml Gc3pukdghEHEYhEPMa6yVzeZmwGYHTvJoCnCBFfkyf60HvYRzY+n2BxvY3zwT3QQ0CO2 gpHcLSPegZhvuOJFnL9xY5zkqC+tgwBthEjyU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=UrA8P3Ikz/RM+An0ftuSfh7NQaKPm6pWiDm0VWuaVNi0Yg9BhdGISpx+ZZ/V9R5W2R y1K7uqNFqg2ysm+HIwR+4fB61FrsHOxfxqYqICuRAik+ppc06cqgloUHVSXGHM4u0VsL Wt9Cr0Ylnco+YS+f8WWG0GKbxQHQ98/1Es/2E= Received: by 10.86.65.9 with SMTP id n9mr6332001fga.61.1236819082407; Wed, 11 Mar 2009 17:51:22 -0700 (PDT) Received: from ?192.168.1.2? (44-46.3-85.cust.bluewin.ch [85.3.46.44]) by mx.google.com with ESMTPS id 3sm1264727fge.48.2009.03.11.17.51.21 (version=SSLv3 cipher=RC4-MD5); Wed, 11 Mar 2009 17:51:22 -0700 (PDT) Message-ID: <49B85C8A.2090202@gmail.com> Date: Thu, 12 Mar 2009 01:51:22 +0100 From: phcoder User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: The development of GRUB 2 References: <1236731686.9908.22.camel@localhost.localdomain> <1236744273.27368.7.camel@mj> <1236815560.8320.78.camel@localhost.localdomain> <1236816744.8320.85.camel@localhost.localdomain> In-Reply-To: <1236816744.8320.85.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: Search command. X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2009 00:51:27 -0000 Centurion Computer Technology (2005) Ltd wrote: > On Thu, 2009-03-12 at 12:52 +1300, Centurion Computer Technology (2005) > Ltd wrote: >> On Wed, 2009-03-11 at 00:04 -0400, Pavel Roskin wrote: >>> On Wed, 2009-03-11 at 13:34 +1300, Centurion Computer Technology (2005) >>> Ltd wrote: >>>> Hi, >>>> >>>> I am playing with the search command in grub2 from debian experimental >>>> and have noticed some oddness >>>> >>>> The search command currently returns the device as hdX,X rather than >>>> (hdX,X). This means that the variable created using -s can't be used as >>>> a replacement for the device string. >>> Actually, you can assign it to the root variable and use relative path. >>> You don't need parentheses in the root variable. >>> >>>> For Example I'd like to be able to >>>> do this: >>>> >>>> # Set our root device >>>> search -f /grub/grub.cfg -s root >>>> # Set our prefix >>>> set prefix=${root}/grub/ # I think broken variable handling means this >>>> doesn't work. >>> True. Variable expansion is broken. But you can use >>> >>> set prefix=/grub/ >> but this means as soon as root is set to the new device, that we can't >> load anymore modules which breaks chainloader, linux, intrd, boot etc >> >> and it appears preloading boot doesn't work anyway, as it tries to find >> it. This problem doesn't occur if I manually set prefix=(hdX,X)/grub >>> That would allow you to load more modules as long as $root is >>> unchanged. >>> >>>> menuentry "My Linux OS" { >>>> search -s LINUX_ROOT -u XXXX-YYYY-ZZZZ-AAAA-BBBB >>>> set root=$LINUX_ROOT >>> This is broken for the same reason. But this would work: >>> >>> search -s root -u XXXX-YYYY-ZZZZ-AAAA-BBBB >> Nope, as above, because we cannot set Prefix to include the device >> programmatically, as soon as you've changed your root, you can no longer >> load modules or use commands. > > An easy fix would be for search to return the device with parentheses > > This would solve most of the problems, and allow for: > search -s OSdevice -u XXXX-YYYY-ZZZZ-AAAA-BBBB > chainloader ${OSdevice}+1 > > search -s OSdevice -u XXXX-YYYY-ZZZZ-AAAA-BBBB chainloader (${OSdevice})+1 -- Regards Vladimir 'phcoder' Serbinenko