Get sector size from disk label for NetBSD.

This commit is contained in:
Grégoire Sutre 2011-09-17 23:01:48 +02:00
parent 2221ab6c62
commit 1a7d7db97f
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2011-09-17 Grégoire Sutre <gregoire.sutre@gmail.com>
* grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors) [__NetBSD__]:
Get sector size from disk label.
2011-09-05 Colin Watson <cjwatson@ubuntu.com>
* util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Return 1 for

View File

@ -265,10 +265,13 @@ grub_util_get_fd_sectors (int fd, unsigned *log_secsize)
# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
if (ioctl (fd, DIOCGSECTORSIZE, &sector_size))
goto fail;
# elif defined(__NetBSD__)
sector_size = label.d_secsize;
# else
if (ioctl (fd, BLKSSZGET, &sector_size))
# endif
goto fail;
# endif
if (sector_size & (sector_size - 1) || !sector_size)
goto fail;