From eb1892df164fe021a2a4578bf1ec9aa5d7bdcb7b Mon Sep 17 00:00:00 2001 From: Ji Luo Date: Wed, 21 Nov 2018 09:44:17 +0800 Subject: MA-13480-1 [Auto] Fix XEN hang with wrong keymaster service Pass "androidboot.keystore=trusty" for trusty backed keymaster service, pass "androidboot.keystore=software" for software keymaster service. Test: boot pass on imx8qm_mek. Change-Id: I9fa38c15a7c10aef09ab29b0e9859b690e3e7a41 Signed-off-by: Ji Luo --- common/image-android.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/image-android.c b/common/image-android.c index bd47a6fcd4..67cb86f0fe 100644 --- a/common/image-android.c +++ b/common/image-android.c @@ -211,14 +211,16 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify, strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline)); #endif -#ifdef CONFIG_IMX_TRUSTY_OS char *keystore = env_get("keystore"); - if (!strncpy(keystore, "software", sizeof("software"))) { + if ((keystore == NULL) || strncmp(keystore, "trusty", sizeof("trusty"))) { + char *bootargs_trusty = "androidboot.keystore=software"; + strncat(commandline, " ", sizeof(commandline) - strlen(commandline)); + strncat(commandline, bootargs_trusty, sizeof(commandline) - strlen(commandline)); + } else { char *bootargs_trusty = "androidboot.keystore=trusty"; strncat(commandline, " ", sizeof(commandline) - strlen(commandline)); strncat(commandline, bootargs_trusty, sizeof(commandline) - strlen(commandline)); } -#endif /* Add 'append_bootargs' to hold some paramemters which need to be appended * to bootargs */ -- cgit v1.2.3