summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlistair Strachan2018-09-28 14:36:36 -0500
committerAlistair Strachan2018-09-28 14:47:33 -0500
commit351e67763631286964f41e000f6bfc95bbd3c49d (patch)
tree8ea5f8908e8f85d2432d244519ea32a328159828
parent2e0876f56d5f1828732002da289f8580e6fc0edb (diff)
downloaddevice-ti-beagle-x15-351e67763631286964f41e000f6bfc95bbd3c49d.tar.gz
device-ti-beagle-x15-351e67763631286964f41e000f6bfc95bbd3c49d.tar.xz
device-ti-beagle-x15-351e67763631286964f41e000f6bfc95bbd3c49d.zip
Fix a race in BOOTIMG_FIT Makefile
The rules for BOOTIMG_FIT depended on INSTALLED_KERNEL_TARGET and INSTALLED_RAMDISK_TARGET, but these variables may not have been defined at the point the Makefile was parsed and simply-expanded, so the rules to build BOOTIMG_FIT could race with the creation of the installed kernel and ramdisk targets. Fix this problem by locally defining BOOTIMG_FIT_INSTALLED_KERNEL_TARGET and BOOTIMG_FIT_INSTALLED_RAMDISK_TARGET to sensible defaults and copy them to PRIVATE_ variants in the recipe. Bug: 110964307 Test: local build with m -j128 Change-Id: I49a107c08a3e010035260c21258a7c7dade6c7e7 Signed-off-by: Alistair Strachan <astrachan@google.com>
-rw-r--r--boot_fit/Android.mk11
1 files changed, 8 insertions, 3 deletions
diff --git a/boot_fit/Android.mk b/boot_fit/Android.mk
index 2cf6ef0..c16ccfe 100644
--- a/boot_fit/Android.mk
+++ b/boot_fit/Android.mk
@@ -6,17 +6,22 @@ DTC := $(HOST_OUT_EXECUTABLES)/dtc
6BOARD_DIR := device/ti/beagle_x15 6BOARD_DIR := device/ti/beagle_x15
7ITS := beagle_x15.its 7ITS := beagle_x15.its
8BOOTIMG_FIT := $(PRODUCT_OUT)/boot_fit.img 8BOOTIMG_FIT := $(PRODUCT_OUT)/boot_fit.img
9BOOTIMG_FIT_INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel
10BOOTIMG_FIT_INSTALLED_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img
9 11
10$(BOOTIMG_FIT): PRIVATE_DTC_FLAGS_MKIMAGE = -I dts -O dtb -p 500 -Wno-unit_address_vs_reg 12$(BOOTIMG_FIT): PRIVATE_DTC_FLAGS_MKIMAGE = -I dts -O dtb -p 500 -Wno-unit_address_vs_reg
11$(BOOTIMG_FIT): PRIVATE_INTERMEDIATES := $(call intermediates-dir-for,PACKAGING,fit) 13$(BOOTIMG_FIT): PRIVATE_INTERMEDIATES := $(call intermediates-dir-for,PACKAGING,fit)
12$(BOOTIMG_FIT): PRIVATE_ITS := $(ITS) 14$(BOOTIMG_FIT): PRIVATE_ITS := $(ITS)
13$(BOOTIMG_FIT): PRIVATE_MKIMAGE := $(MKIMAGE) 15$(BOOTIMG_FIT): PRIVATE_MKIMAGE := $(MKIMAGE)
14$(BOOTIMG_FIT): PRIVATE_BOARD_DIR := $(BOARD_DIR) 16$(BOOTIMG_FIT): PRIVATE_BOARD_DIR := $(BOARD_DIR)
15$(BOOTIMG_FIT): $(INSTALLED_KERNEL_TARGET) $(INSTALLED_RAMDISK_TARGET) $(BOARD_DIR)/$(ITS) $(MKIMAGE) $(DTC) $(wildcard $(LOCAL_KERNEL)/*.dtb) 17$(BOOTIMG_FIT): PRIVATE_INSTALLED_KERNEL_TARGET := $(BOOTIMG_FIT_INSTALLED_KERNEL_TARGET)
18$(BOOTIMG_FIT): PRIVATE_INSTALLED_RAMDISK_TARGET := $(BOOTIMG_FIT_INSTALLED_RAMDISK_TARGET)
19$(BOOTIMG_FIT): $(BOOTIMG_FIT_INSTALLED_KERNEL_TARGET) $(BOOTIMG_FIT_INSTALLED_RAMDISK_TARGET)
20$(BOOTIMG_FIT): $(BOARD_DIR)/$(ITS) $(MKIMAGE) $(DTC) $(wildcard $(LOCAL_KERNEL)/*.dtb)
16 mkdir -p $(PRIVATE_INTERMEDIATES) 21 mkdir -p $(PRIVATE_INTERMEDIATES)
17 cp $(PRIVATE_BOARD_DIR)/$(PRIVATE_ITS) $(PRIVATE_INTERMEDIATES)/ 22 cp $(PRIVATE_BOARD_DIR)/$(PRIVATE_ITS) $(PRIVATE_INTERMEDIATES)/
18 cp $(INSTALLED_RAMDISK_TARGET) $(PRIVATE_INTERMEDIATES)/ 23 cp $(PRIVATE_INSTALLED_RAMDISK_TARGET) $(PRIVATE_INTERMEDIATES)/
19 cp $(INSTALLED_KERNEL_TARGET) $(PRIVATE_INTERMEDIATES)/zImage 24 cp $(PRIVATE_INSTALLED_KERNEL_TARGET) $(PRIVATE_INTERMEDIATES)/zImage
20 cp $(LOCAL_KERNEL)/*.dtb $(PRIVATE_INTERMEDIATES)/ 25 cp $(LOCAL_KERNEL)/*.dtb $(PRIVATE_INTERMEDIATES)/
21 PATH=$(HOST_OUT_EXECUTABLES):$$PATH $(PRIVATE_MKIMAGE) -D "$(PRIVATE_DTC_FLAGS_MKIMAGE)" -f $(PRIVATE_INTERMEDIATES)/$(PRIVATE_ITS) $@ 26 PATH=$(HOST_OUT_EXECUTABLES):$$PATH $(PRIVATE_MKIMAGE) -D "$(PRIVATE_DTC_FLAGS_MKIMAGE)" -f $(PRIVATE_INTERMEDIATES)/$(PRIVATE_ITS) $@
22 27