This is useful for dual-boot setups where the loader sets variables depending
on the flash boot partition.
For example the Linksys E8450 sets mtdparts=master for the first partition
and mtdparts=slave for the second one.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
const struct mtd_partition **pparts,
struct mtd_part_parser_data *data)
{
+ struct device_node *np = mtd_get_of_node(mtd);
+ const char *cmdline_match = NULL;
struct fdt_header hdr;
size_t hdr_len, retlen;
size_t offset;
struct mtd_partition *parts;
int ret;
+ of_property_read_string(np, "openwrt,cmdline-match", &cmdline_match);
+ if (cmdline_match && !strstr(saved_command_line, cmdline_match))
+ return -ENODEV;
+
hdr_len = sizeof(struct fdt_header);
/* Parse the MTD device & search for the FIT image location */