Loading core/Makefile +3 −0 Original line number Diff line number Diff line Loading @@ -4180,6 +4180,9 @@ endif # BOARD_PREBUILT_DTBOIMAGE @# INSTALLED_RADIOIMAGE_TARGET. $(hide) $(foreach part,$(BOARD_PACK_RADIOIMAGES), \ echo $(part) >> $(zip_root)/META/pack_radioimages.txt;) @# Any images specified will be added into ota.zip $(hide) $(foreach part,$(BOARD_PACK_IMAGES), \ echo $(part) >> $(zip_root)/META/pack_images.txt;) @# Run fs_config on all the system, vendor, boot ramdisk, @# and recovery ramdisk files in the zip, and save the output ifdef BUILDING_SYSTEM_IMAGE Loading tools/releasetools/add_img_to_target_files.py +24 −0 Original line number Diff line number Diff line Loading @@ -920,6 +920,30 @@ def AddImagesToTargetFiles(filename): if os.path.exists(pack_radioimages_txt): with open(pack_radioimages_txt) as f: AddPackRadioImages(output_zip, f.readlines()) # images that need to be packed into IMAGES/, and product-img.zip. pack_images = os.path.join( OPTIONS.input_tmp, "META", "pack_images.txt") if os.path.exists(pack_images): banner("images") with open(pack_images, 'r') as f: lines = f.readlines() for line in lines: img_inf = line.strip().split(":") img_path = img_inf[0].strip() print("img_path" +img_path) img_name = os.path.basename(img_path) _, ext = os.path.splitext(img_name) if not ext: img_name += ".img" prebuilt_path = os.path.join(OPTIONS.input_tmp, "IMAGES", img_name) if os.path.exists(prebuilt_path): print("%s already exists, no need to overwrite..." % (img_name,)) continue if output_zip: common.ZipWrite(output_zip, prebuilt_path, os.path.join("IMAGES", img_name)) else: shutil.copy(img_path, prebuilt_path) if output_zip: common.ZipClose(output_zip) Loading tools/releasetools/ota_from_target_files.py +20 −0 Original line number Diff line number Diff line Loading @@ -715,6 +715,15 @@ def _WriteRecoveryImageToBoot(script, output_zip): # The "recovery.img" entry has been written into package earlier. script.WriteRawImage("/boot", "recovery.img") def WriteImage(image, dest, script, output_zip): img_path = os.path.join( OPTIONS.input_tmp, "IMAGES", image) common.ZipWrite( output_zip, img_path, image) logger.info( "adding image: using %s", image) script.WriteRawImage("/"+dest, image) def HasRecoveryPatch(target_files_zip): namelist = [name for name in target_files_zip.namelist()] Loading Loading @@ -1112,6 +1121,17 @@ else if get_stage("%(bcb_dev)s") == "3/3" then if boot_img != None: script.WriteRawImage("/boot", "boot.img") pack_images = os.path.join(OPTIONS.input_tmp, "META", "pack_images.txt") if os.path.exists(pack_images): with open(pack_images, 'r') as f: lines = f.readlines() for line in lines: print(line) img_inf = line.strip().split(":") WriteImage(os.path.basename(img_inf[0]), img_inf[1], script, output_zip) script.ShowProgress(0.1, 10) device_specific.FullOTA_InstallEnd() Loading Loading
core/Makefile +3 −0 Original line number Diff line number Diff line Loading @@ -4180,6 +4180,9 @@ endif # BOARD_PREBUILT_DTBOIMAGE @# INSTALLED_RADIOIMAGE_TARGET. $(hide) $(foreach part,$(BOARD_PACK_RADIOIMAGES), \ echo $(part) >> $(zip_root)/META/pack_radioimages.txt;) @# Any images specified will be added into ota.zip $(hide) $(foreach part,$(BOARD_PACK_IMAGES), \ echo $(part) >> $(zip_root)/META/pack_images.txt;) @# Run fs_config on all the system, vendor, boot ramdisk, @# and recovery ramdisk files in the zip, and save the output ifdef BUILDING_SYSTEM_IMAGE Loading
tools/releasetools/add_img_to_target_files.py +24 −0 Original line number Diff line number Diff line Loading @@ -920,6 +920,30 @@ def AddImagesToTargetFiles(filename): if os.path.exists(pack_radioimages_txt): with open(pack_radioimages_txt) as f: AddPackRadioImages(output_zip, f.readlines()) # images that need to be packed into IMAGES/, and product-img.zip. pack_images = os.path.join( OPTIONS.input_tmp, "META", "pack_images.txt") if os.path.exists(pack_images): banner("images") with open(pack_images, 'r') as f: lines = f.readlines() for line in lines: img_inf = line.strip().split(":") img_path = img_inf[0].strip() print("img_path" +img_path) img_name = os.path.basename(img_path) _, ext = os.path.splitext(img_name) if not ext: img_name += ".img" prebuilt_path = os.path.join(OPTIONS.input_tmp, "IMAGES", img_name) if os.path.exists(prebuilt_path): print("%s already exists, no need to overwrite..." % (img_name,)) continue if output_zip: common.ZipWrite(output_zip, prebuilt_path, os.path.join("IMAGES", img_name)) else: shutil.copy(img_path, prebuilt_path) if output_zip: common.ZipClose(output_zip) Loading
tools/releasetools/ota_from_target_files.py +20 −0 Original line number Diff line number Diff line Loading @@ -715,6 +715,15 @@ def _WriteRecoveryImageToBoot(script, output_zip): # The "recovery.img" entry has been written into package earlier. script.WriteRawImage("/boot", "recovery.img") def WriteImage(image, dest, script, output_zip): img_path = os.path.join( OPTIONS.input_tmp, "IMAGES", image) common.ZipWrite( output_zip, img_path, image) logger.info( "adding image: using %s", image) script.WriteRawImage("/"+dest, image) def HasRecoveryPatch(target_files_zip): namelist = [name for name in target_files_zip.namelist()] Loading Loading @@ -1112,6 +1121,17 @@ else if get_stage("%(bcb_dev)s") == "3/3" then if boot_img != None: script.WriteRawImage("/boot", "boot.img") pack_images = os.path.join(OPTIONS.input_tmp, "META", "pack_images.txt") if os.path.exists(pack_images): with open(pack_images, 'r') as f: lines = f.readlines() for line in lines: print(line) img_inf = line.strip().split(":") WriteImage(os.path.basename(img_inf[0]), img_inf[1], script, output_zip) script.ShowProgress(0.1, 10) device_specific.FullOTA_InstallEnd() Loading