From: Robert Millan <rmh@aybabtu.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: Check for device type (block/character) in grub-setup?
Date: Thu, 7 Jan 2010 20:35:01 +0100 [thread overview]
Message-ID: <20100107193501.GM12029@thorin> (raw)
In-Reply-To: <4B461A56.3020506@labri.fr>
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
prev parent reply other threads:[~2010-01-07 19:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-03 2:54 Check for device type (block/character) in grub-setup? Grégoire Sutre
2010-01-03 16:52 ` Robert Millan
2010-01-07 17:31 ` Grégoire Sutre
2010-01-07 19:35 ` Robert Millan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100107193501.GM12029@thorin \
--to=rmh@aybabtu.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.