Add support for building vendor_ramdisk.img

Allow BoardConfig.mk to set:
BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true

to build:
out/target/product/<name>/vendor_ramdisk.img

This is done to support GKI device kernel development.

Kernel developers build vmlinux + DTB + GKI kernel modules locally
and then use kernel build tools to output:

* vmlinux + ramdisk.img => boot.img
* GKI kernel modules + DTB + vendor_ramdisk.img => vendor_boot.img

In other words, kernel developers use ramdisk.img and vendor_ramdisk.img
as prebuilts for building flashable boot.img and vendor_boot.img
directly from the kernel development environment.

Test: make vendorramdisk with BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true
Test: make vendorramdisk with BOARD_BUILD_VENDOR_RAMDISK_IMAGE omitted
Change-Id: Id67839887b6bf608f4a5f13384c551c12ee9fdbd
This commit is contained in:
Petri Gynther 2021-03-04 11:04:03 -08:00
parent b579ef2cf9
commit 828828ba07
2 changed files with 11 additions and 0 deletions

View File

@ -990,6 +990,13 @@ endif
$(INTERNAL_VENDOR_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_VENDOR_RAMDISK_FILES) | $(COMPRESSION_COMMAND_DEPS)
$(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_VENDOR_RAMDISK_OUT) $(PRIVATE_ADDITIONAL_DIR) | $(COMPRESSION_COMMAND) > $@
ifeq (true,$(BOARD_BUILD_VENDOR_RAMDISK_IMAGE))
INSTALLED_VENDOR_RAMDISK_TARGET := $(PRODUCT_OUT)/vendor_ramdisk.img
$(INSTALLED_VENDOR_RAMDISK_TARGET): $(INTERNAL_VENDOR_RAMDISK_TARGET)
$(call pretty,"Target vendor ram disk: $@")
$(copy-file-to-target)
endif
INSTALLED_FILES_FILE_VENDOR_RAMDISK := $(PRODUCT_OUT)/installed-files-vendor-ramdisk.txt
INSTALLED_FILES_JSON_VENDOR_RAMDISK := $(INSTALLED_FILES_FILE_VENDOR_RAMDISK:.txt=.json)
$(INSTALLED_FILES_FILE_VENDOR_RAMDISK): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_VENDOR_RAMDISK)

View File

@ -1487,6 +1487,9 @@ vendorbootimage: $(INSTALLED_VENDOR_BOOTIMAGE_TARGET)
.PHONY: vendorbootimage_debug
vendorbootimage_debug: $(INSTALLED_VENDOR_DEBUG_BOOTIMAGE_TARGET)
.PHONY: vendorramdisk
vendorramdisk: $(INSTALLED_VENDOR_RAMDISK_TARGET)
.PHONY: productimage
productimage: $(INSTALLED_PRODUCTIMAGE_TARGET)
@ -1545,6 +1548,7 @@ droidcore: $(filter $(HOST_OUT_ROOT)/%,$(modules_to_install)) \
$(INSTALLED_VENDORIMAGE_TARGET) \
$(INSTALLED_VENDOR_BOOTIMAGE_TARGET) \
$(INSTALLED_VENDOR_DEBUG_BOOTIMAGE_TARGET) \
$(INSTALLED_VENDOR_RAMDISK_TARGET) \
$(INSTALLED_ODMIMAGE_TARGET) \
$(INSTALLED_VENDOR_DLKMIMAGE_TARGET) \
$(INSTALLED_ODM_DLKMIMAGE_TARGET) \