summaryrefslogtreecommitdiff
authorXindong Xu <xindong.xu@amlogic.com>2019-11-14 03:21:10 (GMT)
committer Xindong Xu <xindong.xu@amlogic.com>2019-11-28 02:29:11 (GMT)
commite151775ee4926916bfdd2ea4db0047b516b91e64 (patch)
treef79ddb1afedf06679d86328d413c356d3d947d24
parent9ae5ae4e5b65aea00117fe7195bf6beac9d6d2c9 (diff)
downloaduboot-e151775ee4926916bfdd2ea4db0047b516b91e64.zip
uboot-e151775ee4926916bfdd2ea4db0047b516b91e64.tar.gz
uboot-e151775ee4926916bfdd2ea4db0047b516b91e64.tar.bz2
lcd: change partition name when ab update enabled [1/1]
PD#TV-12072 Problem: can not find tvconfig files when enable ab update Solution: change partition name when ab update enabled Verify: x301,marconi Change-Id: I027e7fba4b4ab3627cceb579e6a8de99c81e9aba Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
Diffstat
-rw-r--r--common/ini/ini_platform.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/ini/ini_platform.c b/common/ini/ini_platform.c
index 095a622..1a49a53 100644
--- a/common/ini/ini_platform.c
+++ b/common/ini/ini_platform.c
@@ -28,6 +28,7 @@ Description:
#include "ini_handler.h"
#include "ini_platform.h"
+#include <partition_table.h>
//c basic lib
char* plat_strtok_r(char *str, const char *delim, char **saveptr) {
@@ -44,6 +45,7 @@ static int splitFilePath(const char *file_path, char part_name[], char file_name
int i = 0;
char *tmp_start_ptr = NULL;
char *tmp_end_ptr = NULL;
+ char *slot_name;
if (file_path == NULL) {
ALOGE("%s, file_path is NULL!!!\n", __FUNCTION__);
@@ -66,6 +68,18 @@ static int splitFilePath(const char *file_path, char part_name[], char file_name
part_name[tmp_end_ptr - tmp_start_ptr - 1] = '\0';
//ALOGD("%s, partition name is %s\n", __FUNCTION__, part_name);
+ if (has_boot_slot == 1) {
+ run_command("get_valid_slot", 0);
+ slot_name = getenv("slot-suffixes");
+ printf("slot-suffixes: %s\n", slot_name);
+ if (strcmp(slot_name, "0") == 0) {
+ strcat(part_name, "_a");
+ } else if (strcmp(slot_name, "1") == 0) {
+ strcat(part_name, "_b");
+ }
+ ALOGD("%s, partition name is %s\n", __FUNCTION__, part_name);
+ }
+
tmp_start_ptr = tmp_end_ptr;
i = 0;