summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorfaqiang.zhu <faqiang.zhu@nxp.com>2020-05-08 22:29:57 +0800
committerJi Luo <ji.luo@nxp.com>2020-05-15 17:34:45 +0800
commit8d1c194a18ce2c33af39f2c28ef13e778e3f984a (patch)
tree8e3e4118e99aa15670c3bd645614a522c2f2cfec /lib
parent9a268a2a73424b17cf5588a57b54f44e8a385e17 (diff)
MA-16457-3 allow automotive to access system partition info
dynamic partition feature is not enabled on automotive, so there is system partition in GPT, uboot for automotive need to get the info of this partition to generate the correct bootargs. And also, there is no commandline descriptor as "dm=***" in vbmeta image for standard Android after dynamic partition feature is enabled, so there is no need to use "strstr" to eleminate this from the bootargs. Change-Id: I51b3b92f5a22550602335cfc212831b263526f42 Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libavb/avb_cmdline.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/libavb/avb_cmdline.c b/lib/libavb/avb_cmdline.c
index 7158a1b385..bddcc2f627 100644
--- a/lib/libavb/avb_cmdline.c
+++ b/lib/libavb/avb_cmdline.c
@@ -9,7 +9,11 @@
#include "avb_version.h"
#include <malloc.h>
+#ifdef CONFIG_ANDROID_AUTO_SUPPORT
+#define NUM_GUIDS 3
+#else
#define NUM_GUIDS 2
+#endif
/* Substitutes all variables (e.g. $(ANDROID_SYSTEM_PARTUUID)) with
* values. Returns NULL on OOM, otherwise the cmdline with values
@@ -20,9 +24,16 @@ char* avb_sub_cmdline(AvbOps* ops,
const char* ab_suffix,
bool using_boot_for_vbmeta,
const AvbCmdlineSubstList* additional_substitutions) {
+#ifdef CONFIG_ANDROID_AUTO_SUPPORT
+ const char* part_name_str[NUM_GUIDS] = {"system", "boot", "vbmeta"};
+ const char* replace_str[NUM_GUIDS] = {"$(ANDROID_SYSTEM_PARTUUID)",
+ "$(ANDROID_BOOT_PARTUUID)",
+ "$(ANDROID_VBMETA_PARTUUID)"};
+#else
const char* part_name_str[NUM_GUIDS] = {"boot", "vbmeta"};
const char* replace_str[NUM_GUIDS] = {"$(ANDROID_BOOT_PARTUUID)",
"$(ANDROID_VBMETA_PARTUUID)"};
+#endif
char* ret = NULL;
AvbIOResult io_ret;
size_t n;
@@ -31,7 +42,11 @@ char* avb_sub_cmdline(AvbOps* ops,
* partition.
*/
if (using_boot_for_vbmeta) {
+#ifdef CONFIG_ANDROID_AUTO_SUPPORT
+ part_name_str[2] = "boot";
+#else
part_name_str[1] = "boot";
+#endif
}
/* Replace unique partition GUIDs */