aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/mtd
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2016-06-20 07:58:29 +0200
committerRafał Miłecki <zajec5@gmail.com>2016-06-20 07:58:29 +0200
commit1aca2912145f0a4539698580e5e6195b4fc3d5c5 (patch)
treefcf80e014329d40de2f3412efa95b57f36db4410 /target/linux/generic/files/drivers/mtd
parentfac7ba1abcb781237ba0d5d9683d5738cdb50307 (diff)
downloadupstream-1aca2912145f0a4539698580e5e6195b4fc3d5c5.tar.gz
upstream-1aca2912145f0a4539698580e5e6195b4fc3d5c5.tar.bz2
upstream-1aca2912145f0a4539698580e5e6195b4fc3d5c5.zip
kernel: mtdsplit: calculate kernel partition precisely for Seama
So far "kernel" partition didn't contain just a kernel. It also included Seama header and meta data. This was making kernel update complex and it wasn't trivial to read kernel size. Fix it by making "kernel" parition contain just a kernel image. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Diffstat (limited to 'target/linux/generic/files/drivers/mtd')
-rw-r--r--target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c
index ee0444a43e..9fe1311018 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c
@@ -79,8 +79,8 @@ static int mtdsplit_parse_seama(struct mtd_info *master,
return -ENOMEM;
parts[0].name = KERNEL_PART_NAME;
- parts[0].offset = 0;
- parts[0].size = rootfs_offset;
+ parts[0].offset = sizeof hdr + be16_to_cpu(hdr.metasize);
+ parts[0].size = rootfs_offset - parts[0].offset;
if (type == MTDSPLIT_PART_TYPE_UBI)
parts[1].name = UBI_PART_NAME;