[LEDE-DEV] [PATCH] kernel: mtdsplit: calculate kernel partition precisely for Seama

John Crispin john at phrozen.org
Fri Jun 17 02:07:48 PDT 2016



On 11/06/2016 01:36, Rafał Miłecki wrote:
> 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 at gmail.com>

looks good. i just had a look and all the ralink targets using the
header use the firmware partition for sysupgrade so it wont break that
process.

> ---
>  target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c | 4 ++--
>  1 file 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 ee0444a..9fe1311 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;
> 



More information about the Lede-dev mailing list