Re: [PATCH] grub-probe support for NetBSD

2010-01-03 Thread Grégoire Sutre
Hi, This the new version of the patch adding grub-probe (and grub-setup) support for NetBSD. The main changes are: - in function grub_util_biosdisk_get_grub_dev(), merge of the new NetBSD code with the original Linux code. - re-enabled disk size detection for floppy. This is done as for t

Re: [PATCH] grub-probe support for NetBSD

2010-01-03 Thread Robert Millan
On Sat, Jan 02, 2010 at 12:35:44PM +0100, Grégoire Sutre wrote: >> Can you avoid code duplication here? Something like: >> >> #ifdef __NetBSD__ >> const char *template = "%s/r%s"; >> #else >> const char *template = "%s/%s"; >> #endif > > Indeed, it's better. But we also need a variable for th

Re: [PATCH] grub-probe support for NetBSD

2010-01-02 Thread Grégoire Sutre
Vladimir 'φ-coder/phcoder' Serbinenko wrote: One byte is cheap. No need for gimmicks just to save one byte. You can always allocate with +3 Ok :-) Grégoire ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-d

Re: [PATCH] grub-probe support for NetBSD

2010-01-02 Thread Vladimir 'φ-coder/phcoder' Serbinenko
Grégoire Sutre wrote: > Robert Millan wrote: >> On Tue, Dec 29, 2009 at 02:31:46AM +0100, Grégoire Sutre wrote: >>> +#if defined(__NetBSD__) >>> + /* Convert this block device to its character (raw) device */ >>> + res = xmalloc (strlen (cwd) + strlen (ent->d_name) + 3); >>> + sprint

Re: [PATCH] grub-probe support for NetBSD

2010-01-02 Thread Grégoire Sutre
Robert Millan wrote: On Tue, Dec 29, 2009 at 02:31:46AM +0100, Grégoire Sutre wrote: +#if defined(__NetBSD__) + /* Convert this block device to its character (raw) device */ + res = xmalloc (strlen (cwd) + strlen (ent->d_name) + 3); + sprintf (res, "%s/r%s", cwd, ent->d_n

Re: [PATCH] grub-probe support for NetBSD

2010-01-01 Thread Robert Millan
On Tue, Dec 29, 2009 at 02:31:46AM +0100, Grégoire Sutre wrote: > +#if defined(__NetBSD__) > + /* Convert this block device to its character (raw) device */ > + res = xmalloc (strlen (cwd) + strlen (ent->d_name) + 3); > + sprintf (res, "%s/r%s", cwd, ent->d_name); > +#else >

Re: [PATCH] grub-probe support for NetBSD

2009-12-28 Thread Grégoire Sutre
Hi, Here is a new version of the patch (the change log remains the same as in the original email). The new version does not attempt to read from a floppy device in grub_util_biosdisk_open. Indeed, on NetBSD, reading from the floppy device (e.g. cat /dev/fd0a) takes a _long_ time to abort wh

[PATCH] grub-probe support for NetBSD

2009-12-27 Thread Grégoire Sutre
Hi, I finished adding NetBSD specific code for grub-probe. A patch and a changelog entry are attached. A few notes: - devices are required to be character (raw) devices. In NetBSD, those are of the form "/dev/r[wsc]d[0-9]+[a-z]" for hard disk drives and CD-ROM drives, as far as I know. -