);
#endif
-#ifdef CONFIG_SYSTEM_RAMDISK_SUPPORT
+#if defined CONFIG_SYSTEM_RAMDISK_SUPPORT && defined CONFIG_ANDROID_AUTO_SUPPORT
/* Setup booargs for taking the system parition as ramdisk */
static void fastboot_setup_system_boot_args(const char *slot, bool append_root)
{
}
strcat(bootargs_3rd, "rootwait");
- /* for standard android, recovery ramdisk will be used anyway, to
- * boot up Android, "androidboot.force_normal_boot=1" is needed */
-#ifndef CONFIG_ANDROID_AUTO_SUPPORT
- strcat(bootargs_3rd, " androidboot.force_normal_boot=1");
-#endif
-
env_set("bootargs_3rd", bootargs_3rd);
} else {
printf("Can't find partition: %s\n", system_part_name);
ret = -1;
goto fail;
}
+
/* Calculate VBH2 */
if (sha256_concatenation(hash_buf, vbh, image_hash)) {
ret = -1;
"androidboot.verifiedbootstate=orange androidboot.flash.locked=0 androidboot.slot_suffix=%s ",
avb_out_data->ab_suffix);
}
-#ifdef CONFIG_ANDROID_AUTO_SUPPORT
strcat(bootargs_sec, avb_out_data->cmdline);
-#else
- strcat(bootargs_sec, strstr(avb_out_data->cmdline, "androidboot"));
+#ifndef CONFIG_ANDROID_AUTO_SUPPORT
+ /* for standard android, recovery ramdisk will be used anyway, to
+ * boot up Android, "androidboot.force_normal_boot=1" is needed */
+ if(!is_recovery_mode) {
+ strcat(bootargs_sec, " androidboot.force_normal_boot=1");
+ }
#endif
env_set("bootargs_sec", bootargs_sec);
-#ifdef CONFIG_SYSTEM_RAMDISK_SUPPORT
+#if defined CONFIG_SYSTEM_RAMDISK_SUPPORT && defined CONFIG_ANDROID_AUTO_SUPPORT
if(!is_recovery_mode) {
if(avb_out_data->cmdline != NULL && strstr(avb_out_data->cmdline, "root="))
fastboot_setup_system_boot_args(avb_out_data->ab_suffix, false);
#include <log.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
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;
* 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 */