From 5ea1e20c01e549cfa6d956f8aed311937efddbd8 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Mon, 7 Jan 2019 16:41:39 -0800 Subject: [PATCH] program: Match xbl in a/b scenarios On devices implementing a/b updates the xbl partiiton will be named xbl_a and xbl_b, extend the match for finding the bootable partition to support this. Signed-off-by: Bjorn Andersson --- program.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/program.c b/program.c index 7d76c5e..dc74721 100644 --- a/program.c +++ b/program.c @@ -139,9 +139,9 @@ int program_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, * * Returns partition number, or negative errno on failure. * - * Scan program tags for a partition with the label "xbl" or "sbl1" and return - * the partition number for this. If more than one line matches we're assuming - * our logic is flawed and return an error. + * Scan program tags for a partition with the label "sbl1" or that starts with + * the string "xbl" and return the partition number for this. If more than one + * line matches we're assuming our logic is flawed and return an error. */ int program_find_bootable_partition(void) { @@ -152,7 +152,7 @@ int program_find_bootable_partition(void) for (program = programes; program; program = program->next) { label = program->label; - if (!strcmp(label, "xbl") || !strcmp(label, "sbl1")) { + if (!strncmp(label, "xbl", 3) || !strcmp(label, "sbl1")) { if (part != -ENOENT) return -EINVAL;