return err_msg("LEB should be multiple of min. I/O units");
if (c->leb_size % 8)
return err_msg("LEB size has to be multiple of 8");
- if (c->leb_size > 1024*1024)
+ if (c->leb_size > UBIFS_MAX_LEB_SZ)
return err_msg("too large LEB size %d", c->leb_size);
if (c->max_leb_cnt < UBIFS_MIN_LEB_CNT)
return err_msg("too low max. count of LEBs, minimum is %d",
#ifndef __UBIFS_H__
#define __UBIFS_H__
+/* Maximum logical eraseblock size in bytes */
+#define UBIFS_MAX_LEB_SZ (2*1024*1024)
+
/* Minimum amount of data UBIFS writes to the flash */
#define MIN_WRITE_SZ (UBIFS_DATA_NODE_SZ + 8)
/* UBI version libubi is made for */
#define LIBUBI_UBI_VERSION 1
+/* Maximum physical eraseblock size in bytes */
+#define UBI_MAX_PEB_SZ (2*1024*1024)
+
/* UBI library descriptor */
typedef void * libubi_t;
#include <mtd/ubi-media.h>
#include <libubigen.h>
#include <libiniparser.h>
+#include <libubi.h>
#include "common.h"
#include "ubiutils-common.h"
if (args.peb_size < 0)
return errmsg("physical eraseblock size was not specified (use -h for help)");
- if (args.peb_size > 1024*1024)
+ if (args.peb_size > UBI_MAX_PEB_SZ)
return errmsg("too high physical eraseblock size %d", args.peb_size);
if (args.min_io_size < 0)