TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/init-files/fstab.amlogic
TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
+## Releasetools
+TARGET_RELEASETOOLS_EXTENSIONS := $(COMMON_PATH)/releasetools
+
## Vendor SPL
VENDOR_SECURITY_PATCH := 2020-10-05
DTBTMP := $(PRODUCT_OUT)/tmp_dt
DTBDIR := $(PRODUCT_OUT)/obj/KERNEL_OBJ/arch/arm64/boot/dts/amlogic
DTCDIR := $(PRODUCT_OUT)/obj/KERNEL_OBJ/scripts/dtc/
+TARGET_FLASH_DTB_PARTITION ?= true
TARGET_DTBO_NAME ?= android_p_overlay_dt
$(INSTALLED_2NDBOOTLOADER_TARGET): $(INSTALLED_KERNEL_TARGET) $(DTBTOOL) | $(ACP) $(MINIGZIP)
ifeq ($(words $(TARGET_DTB_NAME)),1)
- $(hide) $(ACP) $(DTBDIR)/$(TARGET_DTB_NAME).dtb $(DTBTARGET);
- $(hide) $(call aml-compress-dtb, $(DTBTARGET))
- $(hide) $(ACP) $(DTBTARGET) $@;
+ $(hide) $(ACP) $(DTBDIR)/$(TARGET_DTB_NAME).dtb $(DTBTARGET)
else
- $(hide) mkdir -p $(DTBTMP);
+ $(hide) mkdir -p $(DTBTMP)
$(foreach aDts, $(TARGET_DTB_NAME), \
$(ACP) $(DTBDIR)/$(strip $(aDts)).dtb $(DTBTMP)/$(strip $(aDts)).dtb; \
)
$(hide) $(DTBTOOL) -o $(DTBTARGET) -p $(DTCDIR) $(DTBTMP)
+ $(hide) rm -rf $(DTBTMP)
+endif
$(hide) $(call aml-compress-dtb, $(DTBTARGET))
- $(hide) $(ACP) $(DTBTARGET) $@;
- $(hide) rm -rf $(DTBTMP);
+ifeq ($(TARGET_FLASH_DTB_PARTITION),true)
+ $(hide) $(call add-radio-file,$(DTBTARGET))
endif
+ $(hide) $(ACP) $(DTBTARGET) $@
$(BOARD_PREBUILT_DTBOIMAGE): $(INSTALLED_KERNEL_TARGET) $(MKDTBOIMG)
$(MKDTBOIMG) create $@ $(foreach dtbo, $(TARGET_DTBO_NAME), \
--- /dev/null
+#!/bin/env python3
+#
+# Copyright (C) 2020-2021 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+import common
+import re
+
+def FullOTA_InstallEnd(info):
+ OTA_InstallEnd(info)
+ return
+
+def IncrementalOTA_InstallEnd(info):
+ OTA_InstallEnd(info)
+ return
+
+def AddImage(info, folder, basename, dest):
+ name = basename
+ data = info.input_zip.read(folder + basename)
+ common.ZipWriteStr(info.output_zip, name, data)
+ info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest))
+
+def PrintInfo(info, dest):
+ info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1]))
+
+def OTA_InstallEnd(info):
+ PrintInfo(info, "/dev/block/by-name/dtbo")
+ AddImage(info, "IMAGES/", "dtbo.img", "/dev/block/by-name/dtbo")
+ PrintInfo(info, "/dev/block/by-name/vbmeta")
+ AddImage(info, "IMAGES/", "vbmeta.img", "/dev/block/by-name/vbmeta")
+ if 'RADIO/dtb.img' in info.input_zip.namelist():
+ PrintInfo(info, "/dev/dtb")
+ AddImage(info, "RADIO/", "dtb.img", "/dev/dtb")
+ return