Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K11aF-0008MS-8m for mharc-grub-devel@gnu.org; Tue, 27 May 2008 11:59:31 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K11aD-0008Jb-Pg for grub-devel@gnu.org; Tue, 27 May 2008 11:59:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K11aC-0008Gf-Dp for grub-devel@gnu.org; Tue, 27 May 2008 11:59:29 -0400 Received: from [199.232.76.173] (port=53969 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K11aC-0008GT-6P for grub-devel@gnu.org; Tue, 27 May 2008 11:59:28 -0400 Received: from c60.cesmail.net ([216.154.195.49]:5499) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1K11aB-0005y0-So for grub-devel@gnu.org; Tue, 27 May 2008 11:59:28 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 27 May 2008 11:59:26 -0400 Received: from [192.168.1.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by relay.cesmail.net (Postfix) with ESMTP id 8AE12619058 for ; Tue, 27 May 2008 11:59:25 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: References: Content-Type: text/plain; charset=ISO-8859-1 Date: Tue, 27 May 2008 11:59:22 -0400 Message-Id: <1211903962.29738.21.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Content-Transfer-Encoding: 8bit X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: Replacing the legacy "map" 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: Tue, 27 May 2008 15:59:30 -0000 On Tue, 2008-05-27 at 03:36 +0200, Javier Martín wrote: > 1.- Given that only the chain OS loader makes use of such a switch, I > could add it as an option to the "chainloader" command. This is the > simplest path, as it would only require modifying > loader/i386/pc/chainloader* and kern/i386/pc/startup.S (where > grub_chainloader_real_boot resides). Such an option would most > probably be named something like "mapdrivefirst", as in "chainloader > --mapdrivefirst (hd1)+1". I suggest that you avoid excessively long option names. --mapdrive would mean the same unless you envision --mapdrivelater or something. Moreover, --map should be fine, unless you think that something else can be mapped, and users may want to map the drives, but not that other thing. And if the mapping is created by another command, then even "--map" would be excessive, because there is no point in creating a mapping if it's not used. Or maybe "first" means to remap the drive used in the chainloader command to appear the first drive? I don't like it, because the bootsector may reside on a different drive, perhaps in a file as a backup. And it doesn't provide an option to remap the original first drive. > 2.- The other option would be to add a new command that managed the > BIOS drive mappings (like, "biosdrivesmap", duh), with three main > options: "show", "map" and "reset". I'm still unsure of what files > should be modified for this change, and this might be overkill. > No matter how the UI (the commands) actually ends up, the mappings > would just be stored in a variable, and not applied until the "boot" > command is issued. Thus, actual functionality should probably be > implemented in grub_chainloader_real_boot, and the logic is pretty > simple, with most of it available in the GRUB Legacy code. I think it would be a cleaner solution. By the way, I can imagine that some kernels not loaded with "chainloader" may benefit from the remapping as well. Again, I'd like to see the command name shortened, perhaps to "drivemap" or "map". It's not like users will need to distinguish BIOS and non-BIOS mappings. -- Regards, Pavel Roskin