This repository has been archived by the owner on Mar 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
begonia: Rewrite dtbo makefile & append_certs script
Reflect the upstream logic rewrite in dtbo generation as needed. Also clean and reorganize script a bit Reference: [0]: LineageOS/android_vendor_lineage@fe00ea9 Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
- Loading branch information
1 parent
3c42ae5
commit cf684eb
Showing
2 changed files
with
24 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,12 @@ | ||
BOARD_PREBUILT_DTBOIMAGE := $(PRODUCT_OUT)/dtbo-pre.img | ||
BOARD_KERNEL_DTBO_CFG := dtboimg.cfg | ||
MKDTBOIMG := system/libufdt/utils/src/mkdtboimg.py | ||
APPEND_CERTS := $(DEVICE_PATH)/dtbo/append_certs.py | ||
|
||
# BUG: mkdtboimg.py doesn't support absolute paths yet. Fix this later. | ||
define build-dtboimage-target-from-cfg | ||
$(call pretty,"Target dtbo image from cfg: $(BOARD_PREBUILT_DTBOIMAGE)") | ||
$(hide) $(MKDTBOIMG) cfg_create $@ $(KERNEL_OUT)/$(BOARD_KERNEL_DTBO_CFG) -d / | ||
$(hide) chmod a+r $@ | ||
endef | ||
|
||
define append-dtboimage-certs | ||
$(call pretty,"Target signed dtbo image: $(BOARD_PREBUILT_DTBOIMAGE)") | ||
$(hide) mv $(BOARD_PREBUILT_DTBOIMAGE) $(BOARD_PREBUILT_DTBOIMAGE).tmp | ||
$(hide) $(APPEND_CERTS) --image $(BOARD_PREBUILT_DTBOIMAGE).tmp --cert1 \ | ||
$(DEVICE_PATH)/dtbo/cert1.der --cert2 $(DEVICE_PATH)/dtbo/cert2.der --output $(BOARD_PREBUILT_DTBOIMAGE) | ||
$(hide) chmod a+r $@ | ||
endef | ||
|
||
|
||
$(BOARD_PREBUILT_DTBOIMAGE): $(MKDTBOIMG) $(INSTALLED_KERNEL_TARGET) | ||
$(build-dtboimage-target-from-cfg) | ||
$(append-dtboimage-certs) | ||
BOARD_DTBO_CFG := $(DTBO_OUT)/dtboimg.cfg | ||
MKDTIMG := $(HOST_OUT_EXECUTABLES)/mkdtimg$(HOST_EXECUTABLE_SUFFIX) | ||
MKDTBOIMG := $(HOST_OUT_EXECUTABLES)/mkdtboimg.py$(HOST_EXECUTABLE_SUFFIX) | ||
|
||
$(BOARD_PREBUILT_DTBOIMAGE): $(DTC) $(MKDTIMG) $(MKDTBOIMG) | ||
$(BOARD_PREBUILT_DTBOIMAGE): | ||
@echo "Building dtbo.img" | ||
$(call make-dtbo-target,$(KERNEL_DEFCONFIG)) | ||
$(call make-dtbo-target,dtbs) | ||
$(MKDTBOIMG) cfg_create $@ $(BOARD_DTBO_CFG) -d $(DTBO_OUT)/arch/$(KERNEL_ARCH)/boot/dts | ||
$(APPEND_CERTS) --alignment 16 --cert1 $(DEVICE_PATH)/dtbo/cert1.der --cert2 $(DEVICE_PATH)/dtbo/cert2.der --dtbo $(BOARD_PREBUILT_DTBOIMAGE) |