Skip to contentSkip to conversation

Sector size on NetBSD

PATCH In review Grégoire Sutre 2 participants 2 messages Jul 3, 2011 – Jul 21, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Sector size on NetBSD

Hi,

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

Grégoire

=== modified file 'ChangeLog'

ChangeLog +5 -0
@@ -1,3 +1,8 @@
+2011-07-03  Grégoire Sutre  <[email protected]>
+
+	* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open) [__NetBSD__]:
+	Get sector size from disk label.
+
 2011-07-02  Grégoire Sutre  <[email protected]>
 
 	* util/grub-mkconfig.in: Use @PACKAGE@ instead of hardcoded name when

=== modified file 'grub-core/kern/emu/hostdisk.c'

kern/emu/hostdisk.c +4 -0
@@ -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);