include $(top_srcdir)/config/include-Makefile.am
+utils_common = ../lib/linux_version.c ../lib/blkdev.c
+
man_MANS = blockdev.8 isosize.8 mkfs.8 mkswap.8 \
fsck.minix.8 mkfs.minix.8 mkfs.bfs.8
sbin_PROGRAMS = mkfs mkswap blockdev fsck.minix mkfs.minix mkfs.bfs
fsck_minix_SOURCES = fsck.minix.c bitops.h minix.h
-mkfs_minix_SOURCES = mkfs.minix.c bitops.h minix.h
+mkfs_minix_SOURCES = mkfs.minix.c bitops.h minix.h $(utils_common)
mkfs_bfs_SOURCES = mkfs.bfs.c
mkswap_SOURCES = mkswap.c swapheader.h ../lib/linux_version.c ../lib/blkdev.c
blockdev_SOURCES = blockdev.c ../lib/linux_version.c ../lib/blkdev.c
#include <mntent.h>
#include <getopt.h>
+#include "blkdev.h"
#include "minix.h"
#include "nls.h"
DEV = open(device_name,O_RDWR);
if (DEV<0)
die(_("unable to open %s"));
- if (!S_ISBLK(statbuf.st_mode))
+ if (S_ISBLK(statbuf.st_mode)) {
+ int sectorsize;
+
+ if (blkdev_get_sector_size(DEV, §orsize) == -1)
+ die(_("cannot determine sector size for %s"));
+ if (BLOCK_SIZE < sectorsize)
+ die(_("block size smaller than physical sector size of %s"));
+ } else if (!S_ISBLK(statbuf.st_mode)) {
check=0;
- else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
+ } else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
die(_("will not try to make filesystem on '%s'"));
setup_tables();
if (check)