Merge "[config] Dist supports custom super image script" into main
This commit is contained in:
@@ -7118,6 +7118,7 @@ $(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(IMG_FROM_TARG
|
|||||||
PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$(dir $(ZIP2ZIP)):$$PATH \
|
PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$(dir $(ZIP2ZIP)):$$PATH \
|
||||||
$(IMG_FROM_TARGET_FILES) \
|
$(IMG_FROM_TARGET_FILES) \
|
||||||
--additional IMAGES/VerifiedBootParams.textproto:VerifiedBootParams.textproto \
|
--additional IMAGES/VerifiedBootParams.textproto:VerifiedBootParams.textproto \
|
||||||
|
--build_super_image $(BUILD_SUPER_IMAGE) \
|
||||||
$(BUILT_TARGET_FILES_PACKAGE) $@
|
$(BUILT_TARGET_FILES_PACKAGE) $@
|
||||||
|
|
||||||
$(call declare-1p-container,$(INTERNAL_UPDATE_PACKAGE_TARGET),)
|
$(call declare-1p-container,$(INTERNAL_UPDATE_PACKAGE_TARGET),)
|
||||||
|
@@ -65,6 +65,7 @@ OPTIONS.retrofit_dap = None
|
|||||||
OPTIONS.build_super = None
|
OPTIONS.build_super = None
|
||||||
OPTIONS.sparse_userimages = None
|
OPTIONS.sparse_userimages = None
|
||||||
OPTIONS.use_fastboot_info = False
|
OPTIONS.use_fastboot_info = False
|
||||||
|
OPTIONS.build_super_image = None
|
||||||
|
|
||||||
def LoadOptions(input_file):
|
def LoadOptions(input_file):
|
||||||
"""Loads information from input_file to OPTIONS.
|
"""Loads information from input_file to OPTIONS.
|
||||||
@@ -174,7 +175,13 @@ def RebuildAndWriteSuperImages(input_file, output_file):
|
|||||||
input_tmp = common.UnzipTemp(input_file)
|
input_tmp = common.UnzipTemp(input_file)
|
||||||
|
|
||||||
super_file = common.MakeTempFile('super_', '.img')
|
super_file = common.MakeTempFile('super_', '.img')
|
||||||
BuildSuperImage(input_tmp, super_file)
|
|
||||||
|
# Allow overriding the BUILD_SUPER_IMAGE binary
|
||||||
|
if OPTIONS.build_super_image:
|
||||||
|
command = [OPTIONS.build_super_image, input_tmp, super_file]
|
||||||
|
common.RunAndCheckOutput(command)
|
||||||
|
else:
|
||||||
|
BuildSuperImage(input_tmp, super_file)
|
||||||
|
|
||||||
logger.info('Writing super.img to archive...')
|
logger.info('Writing super.img to archive...')
|
||||||
with zipfile.ZipFile(
|
with zipfile.ZipFile(
|
||||||
@@ -231,6 +238,8 @@ def main(argv):
|
|||||||
OPTIONS.bootable_only = True
|
OPTIONS.bootable_only = True
|
||||||
elif o == '--additional':
|
elif o == '--additional':
|
||||||
OPTIONS.additional_entries.append(a)
|
OPTIONS.additional_entries.append(a)
|
||||||
|
elif o == '--build_super_image':
|
||||||
|
OPTIONS.build_super_image = a
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
@@ -240,6 +249,7 @@ def main(argv):
|
|||||||
extra_long_opts=[
|
extra_long_opts=[
|
||||||
'additional=',
|
'additional=',
|
||||||
'bootable_zip',
|
'bootable_zip',
|
||||||
|
'build_super_image=',
|
||||||
],
|
],
|
||||||
extra_option_handler=option_handler)
|
extra_option_handler=option_handler)
|
||||||
if len(args) != 2:
|
if len(args) != 2:
|
||||||
|
Reference in New Issue
Block a user