DivestOS/Patches/LineageOS-16.0/android_build/0001-rm_backuptool.patch
Tad 4292bcaa3e recovery: fix sideload with larger files
+ 16.0: add a disabled patch to remove backuptool
+ processRelease: add support for copying recovery image to archive
2020-02-23 16:06:47 -05:00

174 lines
6.2 KiB
Diff

From db5ded424e8deb8a2a75d86e35b9079992491e85 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Sat, 22 Feb 2020 20:20:24 -0500
Subject: [PATCH] Nuke backuptool
Change-Id: I58d3adf67e20d9c4e49df8cd70769d9304da00c1
---
core/Makefile | 14 ---------
tools/releasetools/edify_generator.py | 9 ------
tools/releasetools/ota_from_target_files.py | 35 +--------------------
3 files changed, 1 insertion(+), 57 deletions(-)
diff --git a/core/Makefile b/core/Makefile
index 404bb5413..48778bfc1 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2837,9 +2837,6 @@ ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_
$(hide) mkdir -p $(zip_root)/$(PRIVATE_RECOVERY_OUT)
$(hide) $(call package_files-copy-root, \
$(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/$(PRIVATE_RECOVERY_OUT)/RAMDISK)
- @# OTA install helpers
- $(hide) $(call package_files-copy-root, \
- $(PRODUCT_OUT)/install,$(zip_root)/INSTALL)
ifdef INSTALLED_KERNEL_TARGET
$(hide) cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel
endif
@@ -3195,16 +3192,6 @@ else
OTA_SCRIPT_OVERRIDE_DEVICE := $(TARGET_OTA_ASSERT_DEVICE)
endif
-ifeq ($(WITH_GMS),true)
- $(INTERNAL_OTA_PACKAGE_TARGET): backuptool := false
-else
-ifneq ($(LINEAGE_BUILD),)
- $(INTERNAL_OTA_PACKAGE_TARGET): backuptool := true
-else
- $(INTERNAL_OTA_PACKAGE_TARGET): backuptool := false
-endif
-endif
-
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) \
build/make/tools/releasetools/ota_from_target_files
@echo "Package OTA: $@"
@@ -3214,7 +3201,6 @@ $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) \
--extracted_input_target_files $(patsubst %.zip,%,$(BUILT_TARGET_FILES_PACKAGE)) \
-p $(HOST_OUT) \
-k $(KEY_CERT_PAIR) \
- --backup=$(backuptool) \
$(if $(OEM_OTA_CONFIG), -o $(OEM_OTA_CONFIG)) \
$(BUILT_TARGET_FILES_PACKAGE) $@
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py
index 59f9d8831..040a57b57 100644
--- a/tools/releasetools/edify_generator.py
+++ b/tools/releasetools/edify_generator.py
@@ -164,9 +164,6 @@ class EdifyGenerator(object):
");")
self.script.append(self.WordWrap(cmd))
- def RunBackup(self, command):
- self.script.append(('run_program("/tmp/install/bin/backuptool.sh", "%s");' % command))
-
def ShowProgress(self, frac, dur):
"""Update the progress bar, advancing it over 'frac' over the next
'dur' seconds. 'dur' may be zero to advance it via SetProgress
@@ -238,12 +235,6 @@ class EdifyGenerator(object):
p.mount_point, mount_flags))
self.mounts.add(p.mount_point)
- def Unmount(self, mount_point):
- """Unmount the partition with the given mount_point."""
- if mount_point in self.mounts:
- self.mounts.remove(mount_point)
- self.script.append('unmount("%s");' % (mount_point,))
-
def UnpackPackageDir(self, src, dst):
"""Unpack a given directory from the OTA package into the given
destination directory."""
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index 089e776fe..5bc022d0b 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -159,10 +159,6 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package
--override_device <device>
Override device-specific asserts. Can be a comma-separated list.
-
- --backup <boolean>
- Enable or disable the execution of backuptool.sh.
- Disabled by default.
"""
from __future__ import print_function
@@ -215,12 +211,11 @@ OPTIONS.extracted_input = None
OPTIONS.key_passwords = []
OPTIONS.skip_postinstall = False
OPTIONS.override_device = 'auto'
-OPTIONS.backuptool = False
METADATA_NAME = 'META-INF/com/android/metadata'
POSTINSTALL_CONFIG = 'META/postinstall_config.txt'
-UNZIP_PATTERN = ['IMAGES/*', 'META/*', 'INSTALL/*']
+UNZIP_PATTERN = ['IMAGES/*', 'META/*']
class BuildInfo(object):
@@ -721,15 +716,6 @@ def AddCompatibilityArchiveIfTrebleEnabled(target_zip, output_zip, target_info,
AddCompatibilityArchive(system_updated, vendor_updated)
-def CopyInstallTools(output_zip):
- install_path = os.path.join(OPTIONS.input_tmp, "INSTALL")
- for root, subdirs, files in os.walk(install_path):
- for f in files:
- install_source = os.path.join(root, f)
- install_target = os.path.join("install", os.path.relpath(root, install_path), f)
- output_zip.write(install_source, install_target)
-
-
def WriteFullOTAPackage(input_zip, output_file):
target_info = BuildInfo(OPTIONS.info_dict, OPTIONS.oem_dicts)
@@ -823,16 +809,6 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
script.AppendExtra("ifelse(is_mounted(\"/system\"), unmount(\"/system\"));")
device_specific.FullOTA_InstallBegin()
- CopyInstallTools(output_zip)
- script.UnpackPackageDir("install", "/tmp/install")
- script.SetPermissionsRecursive("/tmp/install", 0, 0, 0755, 0644, None, None)
- script.SetPermissionsRecursive("/tmp/install/bin", 0, 0, 0755, 0755, None, None)
-
- if OPTIONS.backuptool:
- script.Mount("/system")
- script.RunBackup("backup")
- script.Unmount("/system")
-
system_progress = 0.75
if OPTIONS.wipe_user_data:
@@ -874,12 +850,6 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
device_specific.FullOTA_PostValidate()
- if OPTIONS.backuptool:
- script.ShowProgress(0.02, 10)
- script.Mount("/system")
- script.RunBackup("restore")
- script.Unmount("/system")
-
script.ShowProgress(0.05, 5)
script.WriteRawImage("/boot", "boot.img")
@@ -1872,8 +1842,6 @@ def main(argv):
OPTIONS.skip_postinstall = True
elif o in ("--override_device"):
OPTIONS.override_device = a
- elif o in ("--backup"):
- OPTIONS.backuptool = bool(a.lower() == 'true')
else:
return False
return True
@@ -1905,7 +1873,6 @@ def main(argv):
"extracted_input_target_files=",
"skip_postinstall",
"override_device=",
- "backup=",
], extra_option_handler=option_handler)
if len(args) != 2:
--
2.24.1