Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions tools/releasetools/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2423,13 +2423,15 @@ def __init__(self, src_size=None, tgt_size=None):

class DynamicPartitionsDifference(object):
def __init__(self, info_dict, block_diffs, progress_dict=None,
source_info_dict=None):
source_info_dict=None, build_without_vendor=False):
if progress_dict is None:
progress_dict = dict()

self._build_without_vendor = build_without_vendor
self._remove_all_before_apply = False
if source_info_dict is None:
self._remove_all_before_apply = True
if not build_without_vendor:
self._remove_all_before_apply = True
source_info_dict = dict()

block_diff_dict = {e.partition:e for e in block_diffs}
Expand Down Expand Up @@ -2554,6 +2556,17 @@ def comment(line):
'applying full OTA')
append('remove_all_groups')

if self._build_without_vendor:
comment('System-only build, keep original vendor partitions')
# When building without vendor, we do not want to override
# any partition already existing. In this case, we can only
# resize, but not remove / create / re-create any other
# partition.
for p, u in self._partition_updates.items():
comment('Resize partition %s to %s' % (p, u.tgt_size))
append('resize %s %s' % (p, u.tgt_size))
return

for p, u in self._partition_updates.items():
if u.src_group and not u.tgt_group:
append('remove %s' % p)
Expand Down