diff options
authorFurquan Shaikh <>2015-05-09 01:48:12 (GMT)
committerChromeOS Commit Bot <>2015-05-11 20:45:38 (GMT)
commitf9b76e16dbe02808164a4855245f84a12bc014b8 (patch)
parentbe6706c39ed0babbc27973351e9eb5ce2068373e (diff)
fit: Select default config if there is no compat match.stabilize-7060.Bstabilize-7059.B
FIT config selection is expected to work in the following way: 1. Check if there is a config with compat string match. 2. If there is no compat string match, then the default config should be selected. However, the config selection logic in depthcharge currently selects the first config even if compat string does not match. This prevents the default config from being selected in cases where there is no config with matching compat string. This patch fixes the issue by checking if compat_rank for a config is not -1 when there is no compat_config selected and only then updates the compat_config. BUG=chrome-os-partner:40007 BRANCH=None TEST=Compiles successfully and selects default config in case of no compat match. Change-Id: I239224c760f96ee94bab771ee2e812eaf28ddabe Signed-off-by: Furquan Shaikh <> Reviewed-on: Trybot-Ready: Furquan Shaikh <> Tested-by: Furquan Shaikh <> Reviewed-by: Gwendal Grignou <> Commit-Queue: Furquan Shaikh <>
1 files changed, 4 insertions, 3 deletions
diff --git a/src/boot/fit.c b/src/boot/fit.c
index 722067a..254adbf 100644
--- a/src/boot/fit.c
+++ b/src/boot/fit.c
@@ -428,10 +428,11 @@ int fit_load(void *fit, char *cmd_line, void **kernel, uint32_t *kernel_size,
compat_str += len;
bytes -= len;
- if (!compat_config ||
- config->compat_rank > compat_config->compat_rank) {
+ if ((compat_config && (config->compat_rank >
+ compat_config->compat_rank)) ||
+ (!compat_config && (config->compat_rank != -1)))
compat_config = config;
- }