All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Grégoire Sutre" <gregoire.sutre@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: [PATCH] Sector size on NetBSD
Date: Mon, 04 Jul 2011 01:31:05 +0200	[thread overview]
Message-ID: <4E10FBB9.5000008@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 133 bytes --]

Hi,

NetBSD does not know about BLKSSZGET.  The attached patch retrieves
the sector size from the disk label (for NetBSD).

Grégoire

[-- Attachment #2: patch-sector-size-from-disklabel --]
[-- Type: text/plain, Size: 846 bytes --]

=== modified file 'ChangeLog'
--- ChangeLog	2011-07-02 19:22:19 +0000
+++ ChangeLog	2011-07-03 22:52:47 +0000
@@ -1,3 +1,8 @@
+2011-07-03  Grégoire Sutre  <gregoire.sutre@gmail.com>
+
+	* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open) [__NetBSD__]:
+	Get sector size from disk label.
+
 2011-07-02  Grégoire Sutre  <gregoire.sutre@gmail.com>
 
 	* util/grub-mkconfig.in: Use @PACKAGE@ instead of hardcoded name when

=== modified file 'grub-core/kern/emu/hostdisk.c'
--- grub-core/kern/emu/hostdisk.c	2011-06-23 20:02:05 +0000
+++ grub-core/kern/emu/hostdisk.c	2011-07-03 22:49:26 +0000
@@ -301,11 +301,15 @@
 	goto fail;
       }
 
+# if defined(__NetBSD__)
+    sector_size = label.d_secsize;
+# else
     if (ioctl (fd, BLKSSZGET, &sector_size))
        {
          close (fd);
 	 goto fail;
        }
+# endif
 
     close (fd);
 

             reply	other threads:[~2011-07-03 23:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-03 23:31 Grégoire Sutre [this message]
2011-07-21 11:12 ` [PATCH] Sector size on NetBSD Vladimir 'φ-coder/phcoder' Serbinenko

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=4E10FBB9.5000008@gmail.com \
    --to=gregoire.sutre@gmail.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.