From 21108f77e0af9bda2e94a779e06e5d17245732c9 Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 17 Jul 2012 11:35:03 -0400 Subject: [PATCH 013/123] 420-redboot_space Import of the above patch from openwrt trunk, as of this commit: ---------- commit c1d79f64eed0a7ac36b5b9bca52275b397bec424 Author: nbd Date: Mon Jul 16 16:26:51 2012 +0000 uboot-ar71xx: fix compile on recent mac os x versions git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32750 3c298f89-4303-0410-b956-a3cf2f4a3e73 ---------- Path to patch in the repo is: target/linux/generic/patches-3.3 Repo is: git://nbd.name/openwrt.git Signed-off-by: Paul Gortmaker --- drivers/mtd/redboot.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c index 580035c..8ff130b 100644 --- a/drivers/mtd/redboot.c +++ b/drivers/mtd/redboot.c @@ -265,14 +265,21 @@ static int parse_redboot_partitions(struct mtd_info *master, #endif names += strlen(names)+1; -#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED if(fl->next && fl->img->flash_base + fl->img->size + master->erasesize <= fl->next->img->flash_base) { - i++; - parts[i].offset = parts[i-1].size + parts[i-1].offset; - parts[i].size = fl->next->img->flash_base - parts[i].offset; - parts[i].name = nullname; - } + if (!strcmp(parts[i].name, "rootfs")) { + parts[i].size = fl->next->img->flash_base; + parts[i].size &= ~(master->erasesize - 1); + parts[i].size -= parts[i].offset; +#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED + nrparts--; + } else { + i++; + parts[i].offset = parts[i-1].size + parts[i-1].offset; + parts[i].size = fl->next->img->flash_base - parts[i].offset; + parts[i].name = nullname; #endif + } + } tmp_fl = fl; fl = fl->next; kfree(tmp_fl); -- 1.7.9.7