diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/linux/linux-magicbox-2.6.19.2/050-mtdpart_redboot_partition_truncate.patch | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/linux/linux-magicbox-2.6.19.2/050-mtdpart_redboot_partition_truncate.patch')
-rw-r--r-- | recipes/linux/linux-magicbox-2.6.19.2/050-mtdpart_redboot_partition_truncate.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/recipes/linux/linux-magicbox-2.6.19.2/050-mtdpart_redboot_partition_truncate.patch b/recipes/linux/linux-magicbox-2.6.19.2/050-mtdpart_redboot_partition_truncate.patch new file mode 100644 index 0000000000..2e2cde0f43 --- /dev/null +++ b/recipes/linux/linux-magicbox-2.6.19.2/050-mtdpart_redboot_partition_truncate.patch @@ -0,0 +1,61 @@ +Redboot supports storing the FIS directory and the RedBoot +configuration information in the same block of flash memory. This is +not the most common RedBoot configuration, but it is used on +commercially available boards supported by the kernel. + +A recent patch to mtd/redboot.c (http://lkml.org/lkml/2006/3/20/410) +which corrected the skipping of deleted table entries has exposed the +latent problem of the kernel redboot parser running off the end of the +FIS directory and interpreting the RedBoot configuration information +as table entries. + +This patch terminates the table parsing when the first truly empty +entry is found (table entry deletion only clears the first byte of the +name, so two cleared bytes in a row indicates the end of the table), +thereby supporting the combined redboot FIS directory and RedBoot +configuration information flash layout scenario. + +Signed-off-by: Rod Whitby <rod@whitby.id.au> +-- + +Index: linux-2.6.19/drivers/mtd/redboot.c +=================================================================== +--- linux-2.6.19.orig/drivers/mtd/redboot.c ++++ linux-2.6.19/drivers/mtd/redboot.c +@@ -96,7 +96,19 @@ static int parse_redboot_partitions(stru + */ + if (swab32(buf[i].size) == master->erasesize) { + int j; +- for (j = 0; j < numslots && buf[j].name[0] != 0xff; ++j) { ++ for (j = 0; j < numslots; ++j) { ++ ++ /* A single 0xff denotes a deleted entry. ++ * Two of them in a row is the end of the table. ++ */ ++ if (buf[j].name[0] == 0xff) { ++ if (buf[j].name[1] == 0xff) { ++ break; ++ } else { ++ continue; ++ } ++ } ++ + /* The unsigned long fields were written with the + * wrong byte sex, name and pad have no byte sex. + */ +@@ -123,8 +135,13 @@ static int parse_redboot_partitions(stru + for (i = 0; i < numslots; i++) { + struct fis_list *new_fl, **prev; + +- if (buf[i].name[0] == 0xff) +- continue; ++ if (buf[i].name[0] == 0xff) { ++ if (buf[i].name[1] == 0xff) { ++ break; ++ } else { ++ continue; ++ } ++ } + if (!redboot_checksum(&buf[i])) + break; + |