app: aboot: Added MDTP indication to the kernel cmd_line
If MDTP is activated the string 'mdtp' will be added to the cmd_line.
Change-Id: I56b10735f0c56a4aaa15fcebf9a5299d2334a2d8
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 78164e5..cd7a91c 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -135,6 +135,7 @@
static const char *battchg_pause = " androidboot.mode=charger";
static const char *auth_kernel = " androidboot.authorized_kernel=true";
static const char *secondary_gpt_enable = " gpt";
+static const char *mdtp_activated_flag = " mdtp";
static const char *baseband_apq = " androidboot.baseband=apq";
static const char *baseband_msm = " androidboot.baseband=msm";
@@ -239,6 +240,10 @@
bool gpt_exists = partition_gpt_exists();
int have_target_boot_params = 0;
char *boot_dev_buf = NULL;
+ bool is_mdtp_activated = 0;
+#ifdef MDTP_SUPPORT
+ mdtp_activated(&is_mdtp_activated);
+#endif /* MDTP_SUPPORT */
if (cmdline && cmdline[0]) {
cmdline_len = strlen(cmdline);
@@ -260,6 +265,9 @@
if (boot_into_recovery && gpt_exists)
cmdline_len += strlen(secondary_gpt_enable);
+ if(is_mdtp_activated)
+ cmdline_len += strlen(mdtp_activated_flag);
+
if (boot_into_ffbm) {
cmdline_len += strlen(androidboot_mode);
cmdline_len += strlen(ffbm_mode_string);
@@ -388,6 +396,12 @@
while ((*dst++ = *src++));
}
+ if (is_mdtp_activated) {
+ src = mdtp_activated_flag;
+ if (have_cmdline) --dst;
+ while ((*dst++ = *src++));
+ }
+
if (boot_into_ffbm) {
src = androidboot_mode;
if (have_cmdline) --dst;