nemo: Remove oppo logical partitions when necessary

Usually when building full OTAs for dynamic partition devices the whole partition table is removed and recreated, but in vendorless cases lineageos (and basically any other custom rom) has a patch to disable that functionality and
instead just resize the partitions. This, however, breaks the flashing if a new partition is added, because that partition is tried to be resized and, since it doesn't exist, the assert fails. This patch adds another dynamic patch
list to remove Oppo partitions or gracefully fail if it already removed (no assert).

Signed-off-by: Kuba Wojciechowski <nullbytepl@gmail.com>
Change-Id: I1f316c9f16b20324674b55b29f69dfc8c0d642a5
This commit is contained in:
Kuba Wojciechowski
2022-05-03 18:19:47 +01:00
committed by Ansh
parent 85832ecb49
commit 7ccd7cd4ad
3 changed files with 34 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ LOCAL_PATH := $(call my-dir)
ifeq ($(TARGET_DEVICE),nemo)
subdir_makefiles=$(call first-makefiles-under,$(LOCAL_PATH))
$(call add-radio-file,dynamic-remove-oppo)
$(foreach mk,$(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk)))
include $(CLEAR_VARS)

27
dynamic-remove-oppo Normal file
View File

@@ -0,0 +1,27 @@
# Remove my_product since it might be there and we're not building super or rewriting it
remove my_product
# Remove my_engineering since it might be there and we're not building super or rewriting it
remove my_engineering
# Remove my_company since it might be there and we're not building super or rewriting it
remove my_company
# Remove my_carrier since it might be there and we're not building super or rewriting it
remove my_carrier
# Remove my_region since it might be there and we're not building super or rewriting it
remove my_region
# Remove my_heytap since it might be there and we're not building super or rewriting it
remove my_heytap
# Remove my_stock since it might be there and we're not building super or rewriting it
remove my_stock
# Remove my_preload since it might be there and we're not building super or rewriting it
remove my_preload
# Remove my_manifest since it might be there and we're not building super or rewriting it
remove my_manifest

View File

@@ -6,6 +6,12 @@
import common
def FullOTA_InstallBegin(info):
data = info.input_zip.read("RADIO/dynamic-remove-oppo")
common.ZipWriteStr(info.output_zip, "dynamic-remove-oppo", data)
info.script.AppendExtra('update_dynamic_partitions(package_extract_file("dynamic-remove-oppo"));')
return
def FullOTA_InstallEnd(info):
OTA_InstallEnd(info, False)