summaryrefslogtreecommitdiff
path: root/ubi-utils/new-utils/src
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-04-16 20:47:13 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-04-16 20:48:59 +0300
commitbcc87aa2d908389534394caa8659fd613817584f (patch)
tree4d9a7717f84c2d7a07fef7a2698ad5ae014720b4 /ubi-utils/new-utils/src
parent2817a67cf902aa2e07dbf18b82b8123dc05102a0 (diff)
ubinize: correctly calculate VID offset when min I/O unit is 1
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/new-utils/src')
-rw-r--r--ubi-utils/new-utils/src/libubigen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ubi-utils/new-utils/src/libubigen.c b/ubi-utils/new-utils/src/libubigen.c
index 8d71fde..34e2c0b 100644
--- a/ubi-utils/new-utils/src/libubigen.c
+++ b/ubi-utils/new-utils/src/libubigen.c
@@ -52,8 +52,11 @@ void ubigen_info_init(struct ubigen_info *ui, int peb_size, int min_io_size,
int subpage_size, int vid_hdr_offs, int ubi_ver,
long long ec)
{
- if (!vid_hdr_offs)
- vid_hdr_offs = subpage_size;
+ if (!vid_hdr_offs) {
+ vid_hdr_offs = UBI_EC_HDR_SIZE + subpage_size - 1;
+ vid_hdr_offs /= subpage_size;
+ vid_hdr_offs *= subpage_size;
+ }
ui->peb_size = peb_size;
ui->min_io_size = min_io_size;