Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert destructive commits. Shit goes away #1

Open
wants to merge 1 commit into
base: android-4.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ $(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(
TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
TARGET_AAPT_CHARACTERISTICS="$(TARGET_AAPT_CHARACTERISTICS)" \
TARGET_UNIFIED_DEVICE="$(TARGET_UNIFIED_DEVICE)" \
TARGET_SETS_FSTAB="$(TARGET_SETS_FSTAB)" \
$(PRODUCT_BUILD_PROP_OVERRIDES) \
bash $(BUILDINFO_SH) > $@
$(hide) $(foreach file,$(system_prop_file), \
Expand Down Expand Up @@ -1412,12 +1411,6 @@ else
$(INTERNAL_OTA_PACKAGE_TARGET): override_prop := true
endif

ifneq ($(TARGET_SETS_FSTAB),)
$(INTERNAL_OTA_PACKAGE_TARGET): mount_by_label := true
else
$(INTERNAL_OTA_PACKAGE_TARGET): mount_by_label := false
endif

$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
@echo -e ${PRT_HST}"Package OTA: $@"${CL_RST}
MKBOOTIMG=$(BOARD_CUSTOM_BOOTIMG_MK) \
Expand All @@ -1427,7 +1420,6 @@ $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
--backup=$(backuptool) \
--override_device=$(override_device) \
--override_prop=$(override_prop) \
--mount_by_label=$(mount_by_label) \
$(BUILT_TARGET_FILES_PACKAGE) $@

CUSTOM_TARGET_PACKAGE := $(PRODUCT_OUT)/omni-$(ROM_VERSION).zip
Expand Down
24 changes: 8 additions & 16 deletions tools/releasetools/edify_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,14 @@ def CacheFreeSpaceCheck(self, amount):
self.script.append(('apply_patch_space(%d) || abort("Not enough free space '
'on /system to apply patches.");') % (amount,))

def Mount(self, mount_point, mount_by_label = False):
def Mount(self, mount_point):
"""Mount the partition with the given mount_point."""
fstab = self.info.get("fstab", None)
if fstab:
p = fstab[mount_point]
if mount_by_label:
self.script.append('run_program("/sbin/mount", "%s");' % (mount_point,))
else:
self.script.append('mount("%s", "%s", "%s", "%s");' %
(p.fs_type, common.PARTITION_TYPES[p.fs_type],
p.device, p.mount_point))
self.script.append('mount("%s", "%s", "%s", "%s");' %
(p.fs_type, common.PARTITION_TYPES[p.fs_type],
p.device, p.mount_point))
self.mounts.add(p.mount_point)

def Unmount(self, mount_point):
Expand All @@ -187,22 +184,17 @@ def Print(self, message):
"""Log a message to the screen (if the logs are visible)."""
self.script.append('ui_print("%s");' % (message,))

def FormatPartition(self, partition, mount_by_label = False):
def FormatPartition(self, partition):
"""Format the given partition, specified by its mount point (eg,
"/system")."""

reserve_size = 0
fstab = self.info.get("fstab", None)
if fstab:
p = fstab[partition]
if mount_by_label:
if not p.mount_point in self.mounts:
self.script.mount(p.mount_point)
self.script.append('run_program("/sbin/rm", "-rf", "%s");' % (p.mount_point,))
else:
self.script.append('format("%s", "%s", "%s", "%s", "%s");' %
(p.fs_type, common.PARTITION_TYPES[p.fs_type],
p.device, p.length, p.mount_point))
self.script.append('format("%s", "%s", "%s", "%s", "%s");' %
(p.fs_type, common.PARTITION_TYPES[p.fs_type],
p.device, p.length, p.mount_point))

def DeleteFiles(self, file_list):
"""Delete all files in file_list."""
Expand Down
29 changes: 9 additions & 20 deletions tools/releasetools/ota_from_target_files
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package
Override build.prop items with custom vendor init.
Enabled when TARGET_UNIFIED_DEVICE is defined in BoardConfig

--mount_by_label <boolean>
Force the OTA package to mount and format System by label
Can be enabled by defining TARGET_SETS_FSTAB. Defaults to false.

"""

import sys
Expand Down Expand Up @@ -106,7 +102,6 @@ OPTIONS.worker_threads = 3
OPTIONS.backuptool = False
OPTIONS.override_device = 'auto'
OPTIONS.override_prop = False
OPTIONS.mount_by_label = False

def MostPopularKey(d, default):
"""Given a dict, return the key corresponding to the largest
Expand Down Expand Up @@ -459,16 +454,15 @@ def WriteFullOTAPackage(input_zip, output_zip):
device_specific.FullOTA_InstallBegin()

if OPTIONS.backuptool:
script.Mount("/system", OPTIONS.mount_by_label)
script.Mount("/system")
script.RunBackup("backup")
if not OPTIONS.mount_by_label:
script.Unmount("/system")
script.Unmount("/system")

script.ShowProgress(0.5, 0)

if OPTIONS.wipe_user_data:
script.Print("Formatting /data")
script.FormatPartition("/data", OPTIONS.mount_by_label)
script.FormatPartition("/data")

script.Print("#######################################");
script.Print("# _____ __ __ ______ #");
Expand All @@ -485,11 +479,9 @@ def WriteFullOTAPackage(input_zip, output_zip):
WritePolicyConfig(OPTIONS.info_dict["selinux_fc"], output_zip)

script.Print("Formatting /system")
script.FormatPartition("/system", OPTIONS.mount_by_label)
if not OPTIONS.mount_by_label:
script.Mount("/system")

# script.UnpackPackageDir("recovery", "/system")
script.FormatPartition("/system")
script.Mount("/system")
script.UnpackPackageDir("recovery", "/system")
script.Print("Extracting /system")
script.UnpackPackageDir("system", "/system")

Expand Down Expand Up @@ -651,7 +643,7 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
metadata["pre-build"] = source_fp
metadata["post-build"] = target_fp

script.Mount("/system", OPTIONS.mount_by_label)
script.Mount("/system")
script.AssertSomeFingerprint(source_fp, target_fp)

source_boot = common.GetBootableImage(
Expand Down Expand Up @@ -720,7 +712,7 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):

if OPTIONS.wipe_user_data:
script.Print("Erasing user data...")
script.FormatPartition("/data", OPTIONS.mount_by_label)
script.FormatPartition("/data")

script.Print("Removing unneeded files...")
script.DeleteFiles(["/"+i[0] for i in verbatim_targets] +
Expand Down Expand Up @@ -886,8 +878,6 @@ def main(argv):
OPTIONS.override_device = a
elif o in ("--override_prop"):
OPTIONS.override_prop = bool(a.lower() == 'true')
elif o in ("--mount_by_label"):
OPTIONS.mount_by_label = bool(a.lower() == 'true')
else:
return False
return True
Expand All @@ -904,8 +894,7 @@ def main(argv):
"aslr_mode=",
"backup=",
"override_device=",
"override_prop=",
"mount_by_label="],
"override_prop="],
extra_option_handler=option_handler)

if len(args) != 2:
Expand Down