[kernel] update to 2.6.25.1 and refresh patches
[openwrt-10.03/.git] / target / linux / generic-2.6 / patches-2.6.25 / 070-redboot_space.patch
1 Index: linux-2.6.25.1/drivers/mtd/redboot.c
2 ===================================================================
3 --- linux-2.6.25.1.orig/drivers/mtd/redboot.c
4 +++ linux-2.6.25.1/drivers/mtd/redboot.c
5 @@ -251,14 +251,21 @@ static int parse_redboot_partitions(stru
6  #endif
7                 names += strlen(names)+1;
8  
9 -#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
10                 if(fl->next && fl->img->flash_base + fl->img->size + master->erasesize <= fl->next->img->flash_base) {
11 -                       i++;
12 -                       parts[i].offset = parts[i-1].size + parts[i-1].offset;
13 -                       parts[i].size = fl->next->img->flash_base - parts[i].offset;
14 -                       parts[i].name = nullname;
15 -               }
16 +                       if (!strcmp(parts[i].name, "rootfs")) {
17 +                               parts[i].size = fl->next->img->flash_base;
18 +                               parts[i].size &= ~(master->erasesize - 1);
19 +                               parts[i].size -= parts[i].offset;
20 +                       }
21 +#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
22 +                       else {
23 +                               i++;
24 +                               parts[i].offset = parts[i-1].size + parts[i-1].offset;
25 +                               parts[i].size = fl->next->img->flash_base - parts[i].offset;
26 +                               parts[i].name = nullname;
27 +                       }
28  #endif
29 +               }
30                 tmp_fl = fl;
31                 fl = fl->next;
32                 kfree(tmp_fl);