mirror of https://github.com/hak5/openwrt.git
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> SVN-Revision: 38197lede-17.01
parent
261fc738cc
commit
fc79d210e0
|
@ -89,8 +89,12 @@ static int myloader_parse_partitions(struct mtd_info *master,
|
||||||
goto out_free_buf;
|
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 */
|
/* Detect number of used partitions */
|
||||||
for (i = 0; i < MYLO_MAX_PARTITIONS; i++) {
|
for (i = 0; i < MYLO_MAX_PARTITIONS; i++) {
|
||||||
|
@ -121,6 +125,13 @@ static int myloader_parse_partitions(struct mtd_info *master,
|
||||||
mtd_part++;
|
mtd_part++;
|
||||||
names += PART_NAME_LEN;
|
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);
|
strncpy(names, "partition_table", PART_NAME_LEN);
|
||||||
mtd_part->name = names;
|
mtd_part->name = names;
|
||||||
mtd_part->offset = offset;
|
mtd_part->offset = offset;
|
||||||
|
|
Loading…
Reference in New Issue