From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NSy8X-00083a-Th for mharc-grub-devel@gnu.org; Thu, 07 Jan 2010 14:35:13 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSy8V-00081f-Ne for grub-devel@gnu.org; Thu, 07 Jan 2010 14:35:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSy8R-0007xa-Sg for grub-devel@gnu.org; Thu, 07 Jan 2010 14:35:11 -0500 Received: from [199.232.76.173] (port=53953 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSy8R-0007xI-KB for grub-devel@gnu.org; Thu, 07 Jan 2010 14:35:07 -0500 Received: from xvm-190-8.ghst.net ([217.70.190.8]:47854 helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NSy8R-000657-5b for grub-devel@gnu.org; Thu, 07 Jan 2010 14:35:07 -0500 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1NSy8M-00012z-2n for grub-devel@gnu.org; Thu, 07 Jan 2010 20:35:02 +0100 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1NSy8L-0003QP-FP for grub-devel@gnu.org; Thu, 07 Jan 2010 20:35:01 +0100 Date: Thu, 7 Jan 2010 20:35:01 +0100 From: Robert Millan To: The development of GNU GRUB Message-ID: <20100107193501.GM12029@thorin> References: <4B4006F9.30402@labri.fr> <20100103165219.GH27698@thorin> <4B461A56.3020506@labri.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4B461A56.3020506@labri.fr> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: Check for device type (block/character) in grub-setup? X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 19:35:12 -0000 On Thu, Jan 07, 2010 at 06:31:02PM +0100, Grégoire Sutre wrote: > Robert Millan wrote: >> On Sun, Jan 03, 2010 at 03:54:49AM +0100, Grégoire Sutre wrote: >>> Hi, >>> >>> I'm wondering why there is no check for device type (block/character) >>> in grub-setup.c whereas the function probe() in grub-probe.c exits >>> with error if the device is not of the expected type. Shouldn't >>> there be a similar check in grub-setup? >> >> Yes. >> >>> I guess that a similar behavior could be observed on FreeBSD, but I >>> can't actually test this. >> >> Please make the code generic if possible (i.e. accept both character and >> block devices). > > I don't understand what you mean here. I assumed that it's better to > use character devices when accessing disks in GRUB utils, isn't it so? > Moreover, at least on NetBSD, when a block device is mounted, it cannot > be opened (device busy), and this would be a problem with grub-probe. I don't think it matters to us whether a device is character or block based, other than to perform sanity checks in it. Tools like grub-setup are supposed to be happy with either. (I find it a bit odd that disks are represented by NetBSD as character devices, but, whatever...) > However, from a user view-point, it could be nice on NetBSD to accept > stripped device names (e.g. only `wd0d' or even `wd0') and automatically > get the associated device file (with opendisk(3)). This is what system > tools do, e.g. `disklabel wd0' or `fdisk wd0' actually opens > `/dev/rwd0d' (on i386). I find this a bit confusing TBH. It seems unpredictable and would make GRUB inconsistent across platforms. BUT I think it's fine if you patch this up in the NetBSD version of GRUB, if you want it to be consistent with the other utilities. -- Robert Millan "Be the change you want to see in the world" -- Gandhi