Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MWpTF-0006Ze-Fq for mharc-grub-devel@gnu.org; Fri, 31 Jul 2009 06:36:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWpTD-0006YK-8C for grub-devel@gnu.org; Fri, 31 Jul 2009 06:36:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWpT7-0006Wr-Ev for grub-devel@gnu.org; Fri, 31 Jul 2009 06:36:13 -0400 Received: from [199.232.76.173] (port=59940 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWpT7-0006Wo-7F for grub-devel@gnu.org; Fri, 31 Jul 2009 06:36:09 -0400 Received: from smarthost03.mail.zen.net.uk ([212.23.3.142]:56274) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MWpT6-0006Mg-OB for grub-devel@gnu.org; Fri, 31 Jul 2009 06:36:09 -0400 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MWpT4-0008Mx-HO for grub-devel@gnu.org; Fri, 31 Jul 2009 10:36:07 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1MWpT0-0000fv-00; Fri, 31 Jul 2009 11:36:02 +0100 Date: Fri, 31 Jul 2009 11:36:02 +0100 From: Colin Watson To: The development of GRUB 2 Message-ID: <20090731103602.GQ11691@riva.ucam.org> References: <20090729183547.GP11691@riva.ucam.org> <1248901424.4253.2.camel@mj> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1248901424.4253.2.camel@mj> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost03-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: grub-probe, but in reverse? 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: Fri, 31 Jul 2009 10:36:15 -0000 On Wed, Jul 29, 2009 at 05:03:44PM -0400, Pavel Roskin wrote: > On Wed, 2009-07-29 at 19:35 +0100, Colin Watson wrote: > > $ sudo grub-probe -d /dev/sda1 -t drive > > (hd0,1) > > > > I have a reason to want to do the reverse of this: I have a > > libparted-based program that ensures that at least one partition on a > > disk is marked active (needed for some BIOSes), and would like to call > > it on the disk selected for installation of GRUB in d-i. Of course > > libparted is only going to understand OS device names. If possible I'd > > rather avoid reading device.map by hand to figure out how to map (hd0,1) > > back to /dev/sda1. Is there any way to do this with the code as it > > stands, and if not would it make sense to make it possible to pass GRUB > > device names to grub-probe? > > I think device.map is fundamentally unreliable and should be obsoleted. > I don't know where you are getting the GRUB device names, but I suggest > that you use UUID instead. They're entered by users choosing where to install GRUB, whom we can hardly expect to enter UUIDs by hand. Perhaps we can figure out how to give them a select list of available choices, which could then include UUIDs behind the scenes ... -- Colin Watson [cjwatson@ubuntu.com]