static int verbose = 0;
-static unsigned int blksize; /* settable via -b option */
+static unsigned int blksize = 0; /* settable via -b option, default page size */
static long total_blocks = 0, total_nodes = 1; /* pre-count the root node */
static int image_length = 0;
static int cramfs_is_big_endian = 0; /* target is big endian */
int c;
cramfs_is_big_endian = HOST_IS_BIG_ENDIAN; /* default is to use host order */
- blksize = getpagesize();
total_blocks = 0;
setlocale(LC_ALL, "");
dirname = argv[optind];
outfile = argv[optind + 1];
+ if (blksize == 0)
+ blksize = getpagesize();
+
if (stat(dirname, &st) < 0)
err(MKFS_EX_USAGE, _("stat failed %s"), dirname);
fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666);