From 8b0776d1ca59b81b27e5d52a23fc52187cf9e422 Mon Sep 17 00:00:00 2001 From: Yi-Yo Chiang Date: Thu, 30 Jun 2022 17:33:29 +0800 Subject: [PATCH] Fix init_boot.img build rule with TARGET_NO_KERNEL:=true If TARGET_NO_KERNEL is true (device has prebuilt boot.img), then the init_boot.img build arguments wouldn't be propagated correctly. This is because INTERNAL_INIT_BOOT_IMAGE_ARGS is misplaced within a `ifneq ($(strip $(TARGET_NO_KERNEL)),true)` conditional block. Fix this by moving INTERNAL_INIT_BOOT_IMAGE_ARGS initialization into the `ifeq ($(BUILDING_INIT_BOOT_IMAGE),true)` block, which is closer to its first use. Bug: 237630862 Test: m initbootimage Change-Id: I6c0ee2c4b5d0be77a93311eba714e0ed555ffd25 --- core/Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/Makefile b/core/Makefile index a96cfd5e59..dcf5912d0c 100644 --- a/core/Makefile +++ b/core/Makefile @@ -967,15 +967,11 @@ ifneq ($(strip $(TARGET_NO_KERNEL)),true) INTERNAL_BOOTIMAGE_ARGS := \ $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) -INTERNAL_INIT_BOOT_IMAGE_ARGS := - # TODO(b/229701033): clean up BOARD_BUILD_GKI_BOOT_IMAGE_WITHOUT_RAMDISK. ifneq ($(BOARD_BUILD_GKI_BOOT_IMAGE_WITHOUT_RAMDISK),true) ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) ifneq ($(BUILDING_INIT_BOOT_IMAGE),true) INTERNAL_BOOTIMAGE_ARGS += --ramdisk $(INSTALLED_RAMDISK_TARGET) - else - INTERNAL_INIT_BOOT_IMAGE_ARGS += --ramdisk $(INSTALLED_RAMDISK_TARGET) endif endif endif @@ -1222,6 +1218,8 @@ ifeq ($(BUILDING_INIT_BOOT_IMAGE),true) INSTALLED_INIT_BOOT_IMAGE_TARGET := $(PRODUCT_OUT)/init_boot.img $(INSTALLED_INIT_BOOT_IMAGE_TARGET): $(MKBOOTIMG) $(INSTALLED_RAMDISK_TARGET) +INTERNAL_INIT_BOOT_IMAGE_ARGS := --ramdisk $(INSTALLED_RAMDISK_TARGET) + ifdef BOARD_KERNEL_PAGESIZE INTERNAL_INIT_BOOT_IMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE) endif