From 4d6f4f6c9ef8dc770cbf91483a859f4a3a097b43 Mon Sep 17 00:00:00 2001 From: Bo Hu Date: Mon, 6 Apr 2020 20:44:36 +0000 Subject: [PATCH] emulator: enable vendor boot image BUG: 149826779 Test: Build x86, x86_64, armv7 and arm64 make sure x86/64 boot to home screen; armv7/arm64 can pass disk mounting stage Change-Id: I258b69bd0cdc4fb0a99b1a04567051e8d32c389a Merged-In: I258b69bd0cdc4fb0a99b1a04567051e8d32c389a --- core/Makefile | 15 +++++++++++++++ core/tasks/sdk-addon.mk | 2 +- target/board/BoardConfigEmuCommon.mk | 7 +++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index 154ed5338..e2d096db1 100644 --- a/core/Makefile +++ b/core/Makefile @@ -5156,6 +5156,20 @@ $(INSTALLED_QEMU_VENDORIMAGE): $(INSTALLED_VENDORIMAGE_TARGET) $(MK_QEMU_IMAGE_S vendorimage: $(INSTALLED_QEMU_VENDORIMAGE) droidcore: $(INSTALLED_QEMU_VENDORIMAGE) endif + +ifdef INSTALLED_RAMDISK_TARGET +ifdef INSTALLED_VENDOR_BOOTIMAGE_TARGET +ifdef INTERNAL_VENDOR_RAMDISK_TARGET +INSTALLED_QEMU_RAMDISKIMAGE := $(PRODUCT_OUT)/ramdisk-qemu.img +$(INSTALLED_QEMU_RAMDISKIMAGE): $(INTERNAL_VENDOR_RAMDISK_TARGET) $(INSTALLED_RAMDISK_TARGET) + @echo Create ramdisk-qemu.img + (cat $(INSTALLED_RAMDISK_TARGET) $(INTERNAL_VENDOR_RAMDISK_TARGET) > $(INSTALLED_QEMU_RAMDISKIMAGE)) + +droidcore: $(INSTALLED_QEMU_RAMDISKIMAGE) +endif +endif +endif + ifdef INSTALLED_PRODUCTIMAGE_TARGET INSTALLED_QEMU_PRODUCTIMAGE := $(PRODUCT_OUT)/product-qemu.img $(INSTALLED_QEMU_PRODUCTIMAGE): $(INSTALLED_PRODUCTIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG) @@ -5293,6 +5307,7 @@ deps := \ $(APPCOMPAT_ZIP) \ $(INSTALLED_SYSTEMIMAGE_TARGET) \ $(INSTALLED_QEMU_SYSTEMIMAGE) \ + $(INSTALLED_QEMU_RAMDISKIMAGE) \ $(INSTALLED_QEMU_VENDORIMAGE) \ $(QEMU_VERIFIED_BOOT_PARAMS) \ $(INSTALLED_USERDATAIMAGE_TARGET) \ diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk index 7f777a549..5097f1266 100644 --- a/core/tasks/sdk-addon.mk +++ b/core/tasks/sdk-addon.mk @@ -66,7 +66,7 @@ endif files_to_copy += \ $(addon_dir_img):$(INSTALLED_QEMU_SYSTEMIMAGE):images/$(TARGET_CPU_ABI)/system.img \ $(addon_dir_img):$(INSTALLED_QEMU_VENDORIMAGE):images/$(TARGET_CPU_ABI)/vendor.img \ - $(addon_dir_img):$(BUILT_RAMDISK_TARGET):images/$(TARGET_CPU_ABI)/ramdisk.img \ + $(addon_dir_img):$(INSTALLED_QEMU_RAMDISKIMAGE):images/$(TARGET_CPU_ABI)/ramdisk.img \ $(addon_dir_img):$(PRODUCT_OUT)/system/build.prop:images/$(TARGET_CPU_ABI)/build.prop \ $(addon_dir_img):device/generic/goldfish/data/etc/userdata.img:images/$(TARGET_CPU_ABI)/userdata.img \ $(addon_dir_img):$(target_notice_file_txt):images/$(TARGET_CPU_ABI)/NOTICE.txt \ diff --git a/target/board/BoardConfigEmuCommon.mk b/target/board/BoardConfigEmuCommon.mk index d11f9d2ff..a2e5518d3 100644 --- a/target/board/BoardConfigEmuCommon.mk +++ b/target/board/BoardConfigEmuCommon.mk @@ -74,6 +74,13 @@ else BOARD_VENDORIMAGE_PARTITION_SIZE := 146800640 endif +#vendor boot +TARGET_NO_VENDOR_BOOT := false +BOARD_INCLUDE_DTB_IN_BOOTIMG := false +BOARD_BOOT_HEADER_VERSION := 3 +BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION) +BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 0x06000000 + # Enable chain partition for system. BOARD_AVB_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem BOARD_AVB_SYSTEM_ALGORITHM := SHA256_RSA2048