From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LhYEG-0003A8-KH for mharc-grub-devel@gnu.org; Wed, 11 Mar 2009 19:52:52 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhYEF-00037U-Hs for grub-devel@gnu.org; Wed, 11 Mar 2009 19:52:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhYEE-00034L-5p for grub-devel@gnu.org; Wed, 11 Mar 2009 19:52:50 -0400 Received: from [199.232.76.173] (port=33610 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhYEE-000344-1u for grub-devel@gnu.org; Wed, 11 Mar 2009 19:52:50 -0400 Received: from ironport-smtp02.maxnet.net.nz ([123.100.71.102]:20192) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LhYED-0006OF-Gp for grub-devel@gnu.org; Wed, 11 Mar 2009 19:52:49 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALzrt0nAqAJa/2dsb2JhbADRb4QNBmE X-IronPort-AV: E=Sophos;i="4.38,346,1233486000"; d="scan'208";a="117382319" Received: from smtp01.maxnet.net.nz ([123.100.71.110]) by ironport-smtp02.maxnet.net.nz with ESMTP; 12 Mar 2009 12:52:40 +1300 Received: from [192.168.2.90] (121-73-135-210.cable.telstraclear.net [121.73.135.210]) by smtp01.maxnet.net.nz (Postfix) with ESMTPA id 8ABD1A3B87 for ; Thu, 12 Mar 2009 12:52:40 +1300 (NZDT) From: "Centurion Computer Technology (2005) Ltd" To: The development of GRUB 2 In-Reply-To: <1236744273.27368.7.camel@mj> References: <1236731686.9908.22.camel@localhost.localdomain> <1236744273.27368.7.camel@mj> Content-Type: text/plain Organization: Centurion Computer Technology (2005) Ltd Date: Thu, 12 Mar 2009 12:52:40 +1300 Message-Id: <1236815560.8320.78.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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: Wed, 11 Mar 2009 23:52:51 -0000 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. -- Daniel Reurich Centurion Computer Technology (2005) Limited. Ph: 021 797 722