From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NSwCZ-0004ut-FL for mharc-grub-devel@gnu.org; Thu, 07 Jan 2010 12:31:15 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSwCX-0004ti-IA for grub-devel@gnu.org; Thu, 07 Jan 2010 12:31:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSwCS-0004r4-Es for grub-devel@gnu.org; Thu, 07 Jan 2010 12:31:12 -0500 Received: from [199.232.76.173] (port=35633 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSwCS-0004qv-2G for grub-devel@gnu.org; Thu, 07 Jan 2010 12:31:08 -0500 Received: from iona.labri.fr ([147.210.8.143]:39292) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NSwCR-0005j6-Jb for grub-devel@gnu.org; Thu, 07 Jan 2010 12:31:07 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by iona.labri.fr (Postfix) with ESMTP id 18FB836B8A for ; Thu, 7 Jan 2010 18:31:03 +0100 (CET) X-Virus-Scanned: amavisd-new at labri.fr Received: from iona.labri.fr ([127.0.0.1]) by localhost (iona.labri.fr [127.0.0.1]) (amavisd-new, port 10027) with LMTP id pZRFAt-yfhvI for ; Thu, 7 Jan 2010 18:31:03 +0100 (CET) Received: from [147.210.129.1] (laptop-147-210-129-1.labri.fr [147.210.129.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by iona.labri.fr (Postfix) with ESMTP id 03FC736B6F for ; Thu, 7 Jan 2010 18:31:03 +0100 (CET) Message-ID: <4B461A56.3020506@labri.fr> Date: Thu, 07 Jan 2010 18:31:02 +0100 From: =?UTF-8?B?R3LDqWdvaXJlIFN1dHJl?= Organization: CNRS / LaBRI User-Agent: Thunderbird 2.0.0.23 (X11/20091027) MIME-Version: 1.0 To: The development of GNU GRUB References: <4B4006F9.30402@labri.fr> <20100103165219.GH27698@thorin> In-Reply-To: <20100103165219.GH27698@thorin> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 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 17:31:13 -0000 Robert Millan wrote: > On Sun, Jan 03, 2010 at 03:54:49AM +0100, Gr=C3=A9goire Sutre wrote: >> Hi, >> >> I'm wondering why there is no check for device type (block/character) = in =20 >> grub-setup.c whereas the function probe() in grub-probe.c exits with =20 >> error if the device is not of the expected type. Shouldn't there be a = =20 >> similar check in grub-setup? >=20 > Yes. >=20 >> I guess that a similar =20 >> behavior could be observed on FreeBSD, but I can't actually test this. >=20 > Please make the code generic if possible (i.e. accept both character an= d > block devices). I don't understand what you mean here. I assumed that it's better to=20 use character devices when accessing disks in GRUB utils, isn't it so?=20 Moreover, at least on NetBSD, when a block device is mounted, it cannot=20 be opened (device busy), and this would be a problem with grub-probe. However, from a user view-point, it could be nice on NetBSD to accept=20 stripped device names (e.g. only `wd0d' or even `wd0') and automatically=20 get the associated device file (with opendisk(3)). This is what system=20 tools do, e.g. `disklabel wd0' or `fdisk wd0' actually opens=20 `/dev/rwd0d' (on i386). Gr=C3=A9goire