From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IqbcY-0003gX-7a for mharc-grub-devel@gnu.org; Fri, 09 Nov 2007 16:42:34 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IqbcW-0003gB-Ji for grub-devel@gnu.org; Fri, 09 Nov 2007 16:42:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IqbcV-0003fQ-0E for grub-devel@gnu.org; Fri, 09 Nov 2007 16:42:32 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IqbcU-0003fJ-Ny for grub-devel@gnu.org; Fri, 09 Nov 2007 16:42:30 -0500 Received: from mailout06.sul.t-online.de ([194.25.134.19] helo=mailout06.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IqbcU-0001lt-6a for grub-devel@gnu.org; Fri, 09 Nov 2007 16:42:30 -0500 Received: from fwd32.aul.t-online.de by mailout06.sul.t-online.com with smtp id 1IqbcT-0000cW-01; Fri, 09 Nov 2007 22:42:29 +0100 Received: from [10.3.2.2] (ZXSYbwZFZhld9RrU7ABe7wGkDZ7TjgrVUGEgq-gKuqAsSyRD8uvvVdZ1Lt120CSZGB@[217.235.206.191]) by fwd32.aul.t-online.de with esmtp id 1IqbcR-1UpNdA0; Fri, 9 Nov 2007 22:42:27 +0100 Message-ID: <4734D447.9030202@t-online.de> Date: Fri, 09 Nov 2007 22:42:31 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: The development of GRUB 2 References: <47264070.7060007@t-online.de> <20071109211302.GC23437@thorin> In-Reply-To: <20071109211302.GC23437@thorin> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: ZXSYbwZFZhld9RrU7ABe7wGkDZ7TjgrVUGEgq-gKuqAsSyRD8uvvVdZ1Lt120CSZGB X-TOI-MSGID: 5f03e36a-4762-4c05-afdf-a153893bee2f X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: [PATCH] grub-probe -t prefix, -t all 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, 09 Nov 2007 21:42:32 -0000 Robert Millan wrote: > On Mon, Oct 29, 2007 at 09:20:00PM +0100, Christian Franke wrote: > >> This patch adds '-t prefix', '-t all', and allows multiple -t options to >> be specified. >> >> '-t prefix' was initially added to test grub_get_prefix() on Cygwin, but >> may be useful in scripts. >> > > What does -t prefix do? Is it the same as > make_system_path_relative_to_its_root () ? Sounds like I screwed up then :-/ > > print_result_of_grub_get_grefix () or make_path_relative_to_its_mount_point_and_then_absolute () or please_tell_me_which_prefix_grub_setup_will_patch_into_kernel (:-) >> +#define PRINT_FS 0x01 >> +#define PRINT_DRIVE 0x02 >> +#define PRINT_PREFIX 0x04 >> +#define PRINT_DEVICE 0x08 >> +#define PRINT_PARTMAP 0x10 >> > > In general, GRUB bitmasks are declared as (1 << 0), (1 << 1), etc. It'd be > nice to keep this consistent. > OK. > > >> drive_name = grub_util_get_grub_dev (device_name); >> if (! drive_name) >> grub_util_error ("cannot find a GRUB drive for %s.\n", device_name); >> > > This check (and possibly others) is an abort condition. Before your change, > if we reached this point we knew we wanted to abort, but this may not be > true anymore. Did you check this? > > No. Yes, logic of grub-probe is subject to improve. >> + -t, --target=(fs|drive|prefix|device|partmap|all)\n\ >> + print filesystem module, GRUB drive, path prefix, system device\n\ >> + or partition map module [default=fs]\n\ >> > > Uhm what's the purpose of `-t all' ? grub-probe is only intended to be > called by scripts. > > Convenient testing all values for non-scripts (e.g. humans:-) Not really necessary, but with the bitmask approach it comes for free. Christian