Skip to content

Commit

Permalink
raphael: Drop supper dummy image inclusion
Browse files Browse the repository at this point in the history
Seams to be sei broken and can cause issues in adaptation to new ROM
  • Loading branch information
kondors1995 committed Jan 6, 2024
1 parent f605fb3 commit b1419ed
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 282 deletions.
14 changes: 0 additions & 14 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@ ifeq ($(TARGET_DEVICE),raphael)

include $(call all-makefiles-under,$(LOCAL_PATH))

LPFLASH := $(HOST_OUT_EXECUTABLES)/lpflash$(HOST_EXECUTABLE_SUFFIX)
INSTALLED_SUPERIMAGE_DUMMY_TARGET := $(PRODUCT_OUT)/super_dummy.img

$(INSTALLED_SUPERIMAGE_DUMMY_TARGET): $(PRODUCT_OUT)/super_empty.img $(LPFLASH)
$(call pretty,"Target dummy super image: $@")
$(hide) touch $@
$(hide) echo $(CURDIR)
$(hide) $(LPFLASH) $(CURDIR)/$@ $(CURDIR)/$(PRODUCT_OUT)/super_empty.img

.PHONY: super_dummyimage
super_dummyimage: $(INSTALLED_SUPERIMAGE_DUMMY_TARGET)

INSTALLED_RADIOIMAGE_TARGET += $(INSTALLED_SUPERIMAGE_DUMMY_TARGET)

include $(CLEAR_VARS)

# A/B builds require us to create the mount points at compile time.
Expand Down
4 changes: 0 additions & 4 deletions device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,6 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
fastbootd

# Superimage flash script
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/flash_super_dummy.sh:install/bin/flash_super_dummy.sh

# Fingerprint
PRODUCT_PACKAGES += \
[email protected]_raphael
Expand Down
20 changes: 0 additions & 20 deletions flash_super_dummy.sh

This file was deleted.

11 changes: 0 additions & 11 deletions recovery/Android.bp

This file was deleted.

193 changes: 0 additions & 193 deletions recovery/recovery_updater.cpp

This file was deleted.

48 changes: 8 additions & 40 deletions releasetools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright (C) 2009 The Android Open Source Project
# Copyright (c) 2011, The Linux Foundation. All rights reserved.
# Copyright (C) 2017-2020 The LineageOS Project
# Copyright (C) 2019 The MoKee 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.
Expand All @@ -14,9 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import hashlib
import common
import re

def FullOTA_InstallEnd(info):
OTA_InstallEnd(info)
Expand All @@ -26,43 +23,14 @@ def IncrementalOTA_InstallEnd(info):
OTA_InstallEnd(info)
return

def FullOTA_Assertions(info):
AddTrustZoneAssertion(info, info.input_zip)
return

def IncrementalOTA_Assertions(info):
AddTrustZoneAssertion(info, info.target_zip)
return

def AddImage(info, dir, basename, dest):
path = dir + "/" + basename
if path not in info.input_zip.namelist():
return

data = info.input_zip.read(path)
common.ZipWriteStr(info.output_zip, basename, data)
info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1]))
info.script.AppendExtra('package_extract_file("%s", "%s");' % (basename, dest))

def FullOTA_InstallBegin(info):
AddImage(info, "RADIO", "super_dummy.img", "/tmp/super_dummy.img");
info.script.AppendExtra('package_extract_file("install/bin/flash_super_dummy.sh", "/tmp/flash_super_dummy.sh");')
info.script.AppendExtra('set_metadata("/tmp/flash_super_dummy.sh", "uid", 0, "gid", 0, "mode", 0755);')
info.script.AppendExtra('run_program("/tmp/flash_super_dummy.sh");')
return
def AddImage(info, basename, dest):
name = basename
data = info.input_zip.read("IMAGES/" + basename)
common.ZipWriteStr(info.output_zip, name, data)
info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest))

def OTA_InstallEnd(info):
info.script.Print("Patching dtbo and vbmeta images...")
AddImage(info, "IMAGES", "dtbo.img", "/dev/block/bootdevice/by-name/dtbo")
AddImage(info, "IMAGES", "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta")
AddImage(info, "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta")
AddImage(info, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo")
return

def AddTrustZoneAssertion(info, input_zip):
android_info = info.input_zip.read("OTA/android-info.txt")
m = re.search(r'require\s+version-trustzone\s*=\s*(\S+)'.encode('utf-8'), android_info)
if m:
versions = m.group(1).split('|')
if len(versions) and '*' not in versions:
cmd = 'assert(xiaomi.verify_trustzone(' + ','.join(['"%s"' % tz for tz in versions]) + ') == "1" || abort("ERROR: This package requires firmware from an Android 10 based MIUI build. Please upgrade firmware and retry!"););'
info.script.AppendExtra(cmd)
return

0 comments on commit b1419ed

Please sign in to comment.