From 5dee109852236e0d5382bebc691284354e198d8d Mon Sep 17 00:00:00 2001 From: Jan Altensen Date: Mon, 24 Aug 2020 13:30:57 +0200 Subject: [PATCH 1/4] 2e: Adopt to new DTBO generation method Change-Id: I90b3c1c8c3e8ee19d0f99ad8a3d9ba8bdb2be55a --- BoardConfig.mk | 5 ++++- configs/dtbo/dtbo.mk | 12 ------------ configs/dtboimg.cfg | 2 ++ 3 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 configs/dtbo/dtbo.mk create mode 100644 configs/dtboimg.cfg diff --git a/BoardConfig.mk b/BoardConfig.mk index 6099a19..f171280 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -78,14 +78,18 @@ BOARD_DTB_OFFSET := 0x07880000 BOARD_KERNEL_PAGESIZE := 2048 BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb BOARD_BOOTIMG_HEADER_VERSION := 2 + TARGET_KERNEL_ARCH := arm64 TARGET_KERNEL_HEADER_ARCH := arm64 TARGET_KERNEL_SOURCE := kernel/teracube/2e TARGET_KERNEL_CONFIG := 2e_defconfig TARGET_KERNEL_VERSION := 4.9 TARGET_KERNEL_CLANG_COMPILE := true + +BOARD_DTBO_CFG := $(DEVICE_PATH)/configs/dtboimg.cfg BOARD_INCLUDE_DTB_IN_BOOTIMG := true BOARD_KERNEL_SEPARATED_DTBO := true + BOARD_MKBOOTIMG_ARGS += --base $(BOARD_KERNEL_BASE) BOARD_MKBOOTIMG_ARGS += --dtb_offset $(BOARD_DTB_OFFSET) BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOTIMG_HEADER_VERSION) @@ -93,7 +97,6 @@ BOARD_MKBOOTIMG_ARGS += --kernel_offset $(BOARD_KERNEL_OFFSET) BOARD_MKBOOTIMG_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE) BOARD_MKBOOTIMG_ARGS += --ramdisk_offset $(BOARD_RAMDISK_OFFSET) BOARD_MKBOOTIMG_ARGS += --tags_offset $(BOARD_KERNEL_TAGS_OFFSET) -BOARD_CUSTOM_DTBOIMG_MK := $(DEVICE_PATH)/configs/dtbo/dtbo.mk # Avb BOARD_AVB_ENABLE := true diff --git a/configs/dtbo/dtbo.mk b/configs/dtbo/dtbo.mk deleted file mode 100644 index 4d8024f..0000000 --- a/configs/dtbo/dtbo.mk +++ /dev/null @@ -1,12 +0,0 @@ -BOARD_KERNEL_DTBO_CFG := dtboimg.cfg -MKDTBOIMG := system/libufdt/utils/src/mkdtboimg.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 - -$(BOARD_PREBUILT_DTBOIMAGE): $(MKDTBOIMG) $(INSTALLED_KERNEL_TARGET) - $(build-dtboimage-target-from-cfg) diff --git a/configs/dtboimg.cfg b/configs/dtboimg.cfg new file mode 100644 index 0000000..9ad1106 --- /dev/null +++ b/configs/dtboimg.cfg @@ -0,0 +1,2 @@ +arch/arm64/boot/dts/mediatek/yk673v6_lwg62_64.dtb + id=0 -- GitLab From b4e86a934668c234a4e7106c948585462758226f Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Mon, 5 Aug 2019 20:07:03 +0530 Subject: [PATCH 2/4] 2e: releasetools: be more clear about firmware image patching This looks very odd on most of the devices using this tree because nothing is being patched. Just mention which image is being flashed and only when it actually is. Change-Id: Ib6c35e08aee0f1c102da28ca37434093a92f7045 Signed-off-by: Akhil Narang --- releasetools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releasetools.py b/releasetools.py index d493fa5..139e687 100644 --- a/releasetools.py +++ b/releasetools.py @@ -29,10 +29,10 @@ def AddImage(info, basename, dest): name = basename data = info.input_zip.read("IMAGES/" + basename) common.ZipWriteStr(info.output_zip, name, data) + info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1])) info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest)) def OTA_InstallEnd(info): - info.script.Print("Patching device-tree and verity images...") AddImage(info, "dtbo.img", "/dev/block/platform/bootdevice/by-name/dtbo") AddImage(info, "vbmeta.img", "/dev/block/platform/bootdevice/by-name/vbmeta") AddImage(info, "vbmeta_system.img", "/dev/block/platform/bootdevice/by-name/vbmeta_system") -- GitLab From 6466b18c2a014cb00fb652c8cf31e6a0f0a04539 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Sat, 6 Jun 2020 06:49:02 +0600 Subject: [PATCH 3/4] 2e: releasetools: Fix Incremental OTA Gen Change-Id: Iea0cc9cafe72ffd33c7617447bd2765251fc5e75 Signed-off-by: Zinadin Zidan --- releasetools.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/releasetools.py b/releasetools.py index 139e687..5f059a9 100644 --- a/releasetools.py +++ b/releasetools.py @@ -18,23 +18,25 @@ import common import re def FullOTA_InstallEnd(info): - OTA_InstallEnd(info) - return + OTA_InstallEnd(info, False) def IncrementalOTA_InstallEnd(info): - OTA_InstallEnd(info) - return + OTA_InstallEnd(info, True) -def AddImage(info, basename, dest): +def AddImage(info, basename, dest, incremental): name = basename - data = info.input_zip.read("IMAGES/" + basename) + if incremental: + input_zip = info.source_zip + else: + input_zip = info.input_zip + data = input_zip.read("IMAGES/" + basename) common.ZipWriteStr(info.output_zip, name, data) info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1])) info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest)) -def OTA_InstallEnd(info): - AddImage(info, "dtbo.img", "/dev/block/platform/bootdevice/by-name/dtbo") - AddImage(info, "vbmeta.img", "/dev/block/platform/bootdevice/by-name/vbmeta") - AddImage(info, "vbmeta_system.img", "/dev/block/platform/bootdevice/by-name/vbmeta_system") - AddImage(info, "vbmeta_vendor.img", "/dev/block/platform/bootdevice/by-name/vbmeta_vendor") +def OTA_InstallEnd(info, incremental): + AddImage(info, "dtbo.img", "/dev/block/platform/bootdevice/by-name/dtbo", incremental) + AddImage(info, "vbmeta.img", "/dev/block/platform/bootdevice/by-name/vbmeta", incremental) + AddImage(info, "vbmeta_system.img", "/dev/block/platform/bootdevice/by-name/vbmeta_system", incremental) + AddImage(info, "vbmeta_vendor.img", "/dev/block/platform/bootdevice/by-name/vbmeta_vendor", incremental) return -- GitLab From 306336df165e7a54d2990fb44ada633294e2f2b1 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Sat, 29 Aug 2020 08:32:07 +0000 Subject: [PATCH 4/4] 2e: releasetools: Address PEP8 warnings - Dropped unused 're' import - Addred required blank lines - Fixed indentation References: [0]: https://www.python.org/dev/peps/pep-0008/#blank-lines [1]: https://www.python.org/dev/peps/pep-0008/#indentation Signed-off-by: Aayush Gupta Change-Id: I0316386ffee860a9859968df1cea30d049adf68c --- releasetools.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/releasetools.py b/releasetools.py index 5f059a9..d9eebe3 100644 --- a/releasetools.py +++ b/releasetools.py @@ -1,6 +1,6 @@ # Copyright (C) 2009 The Android Open Source Project # Copyright (C) 2019 The Mokee Open Source Project -# Copyright (C) 2019 The LineageOS Open Source Project +# Copyright (C) 2019-2020 The LineageOS Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,28 +15,30 @@ # limitations under the License. import common -import re + def FullOTA_InstallEnd(info): - OTA_InstallEnd(info, False) + OTA_InstallEnd(info, False) + def IncrementalOTA_InstallEnd(info): - OTA_InstallEnd(info, True) + OTA_InstallEnd(info, True) + def AddImage(info, basename, dest, incremental): - name = basename - if incremental: - input_zip = info.source_zip - else: - input_zip = info.input_zip - data = input_zip.read("IMAGES/" + basename) - common.ZipWriteStr(info.output_zip, name, data) - info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1])) - info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest)) + name = basename + if incremental: + input_zip = info.source_zip + else: + input_zip = info.input_zip + data = input_zip.read("IMAGES/" + basename) + common.ZipWriteStr(info.output_zip, name, data) + info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1])) + info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest)) + def OTA_InstallEnd(info, incremental): - AddImage(info, "dtbo.img", "/dev/block/platform/bootdevice/by-name/dtbo", incremental) - AddImage(info, "vbmeta.img", "/dev/block/platform/bootdevice/by-name/vbmeta", incremental) - AddImage(info, "vbmeta_system.img", "/dev/block/platform/bootdevice/by-name/vbmeta_system", incremental) - AddImage(info, "vbmeta_vendor.img", "/dev/block/platform/bootdevice/by-name/vbmeta_vendor", incremental) - return + AddImage(info, "dtbo.img", "/dev/block/platform/bootdevice/by-name/dtbo", incremental) + AddImage(info, "vbmeta.img", "/dev/block/platform/bootdevice/by-name/vbmeta", incremental) + AddImage(info, "vbmeta_system.img", "/dev/block/platform/bootdevice/by-name/vbmeta_system", incremental) + AddImage(info, "vbmeta_vendor.img", "/dev/block/platform/bootdevice/by-name/vbmeta_vendor", incremental) -- GitLab