aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-09-25 20:13:12 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-09-25 20:13:12 +0000
commit63d8d86449c5b4e64d6bb71b8bacd768e356dbf2 (patch)
treecc6f6d4539454d2921e3ee0ba02e3b6ba47cef34 /target
parente51a6a6d99af6765816bf2d1e8b6be8bd0ef0377 (diff)
downloadupstream-63d8d86449c5b4e64d6bb71b8bacd768e356dbf2.tar.gz
upstream-63d8d86449c5b4e64d6bb71b8bacd768e356dbf2.tar.bz2
upstream-63d8d86449c5b4e64d6bb71b8bacd768e356dbf2.zip
kernel: create firmware partition from MyLoader partition parser
This is in preparation for sysupgrade support for Compex devices. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38197 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/files/drivers/mtd/myloader.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/target/linux/generic/files/drivers/mtd/myloader.c b/target/linux/generic/files/drivers/mtd/myloader.c
index 72956cdc1c..93b4a9b286 100644
--- a/target/linux/generic/files/drivers/mtd/myloader.c
+++ b/target/linux/generic/files/drivers/mtd/myloader.c
@@ -89,8 +89,12 @@ static int myloader_parse_partitions(struct mtd_info *master,
goto out_free_buf;
}
- /* The MyLoader and the Partition Table is always present */
- num_parts = 2;
+ /*
+ * The MyLoader and the Partition Table is always present.
+ * Additionally, an extra partition is generated to cover
+ * everything after the bootloader.
+ */
+ num_parts = 3;
/* Detect number of used partitions */
for (i = 0; i < MYLO_MAX_PARTITIONS; i++) {
@@ -121,6 +125,13 @@ static int myloader_parse_partitions(struct mtd_info *master,
mtd_part++;
names += PART_NAME_LEN;
+ strncpy(names, "firmware", PART_NAME_LEN);
+ mtd_part->name = names;
+ mtd_part->offset = offset;
+ mtd_part->size = master->size - offset;
+ mtd_part++;
+ names += PART_NAME_LEN;
+
strncpy(names, "partition_table", PART_NAME_LEN);
mtd_part->name = names;
mtd_part->offset = offset;