ram_value = fastboot_utils.get_bxt_ram(serial=serial)
        if ram_value == "2g": image_platform = "image_o_bxt_2g"
        if ram_value == "4g": image_platform = "image_o_bxt_4g"
        if ram_value == "8g": image_platform = "image_o_bxt_4g"
    vbmeta_corrupted_system_metadata_path = config.get(
        image_platform, "vbmeta_corrupted_system_metadata")
    vbmeta_corrupted_system_metadata_name = vbmeta_corrupted_system_metadata_path.split(
        "/")[-1]
    fastboot_utils.download_file(url=fastboot_path +
                                 vbmeta_corrupted_system_metadata_path,
                                 local_filename="./temp/image/n/img/" +
                                 vbmeta_corrupted_system_metadata_name)

    adb_steps.reboot(command="fastboot", reboot_timeout=300, serial=serial)()
    fastboot_steps.fastboot_erase_partition(partition_name="vbmeta",
                                            reboot=False,
                                            serial=serial)()
    fastboot_steps.flash_image(partition_name="vbmeta",
                               file_name="./temp/image/n/img/" +
                               vbmeta_corrupted_system_metadata_name,
                               lock_dut=True,
                               serial=serial)()

    check_point1 = False
    check_point2 = False

    fastboot_utils.start_minicom(serial=serial)

    os.system("fastboot reboot > /dev/null 2>&1")
    time.sleep(60)
    fastboot_utils.to_fastboot_by_script(serial=serial)
コード例 #2
0
                             zip_file=flash_files,
                             serial=serial,
                             sleep_time=30,
                             wait_for_adb=False)
    fastboot_utils.to_fastboot_by_script(serial=serial)
    local_steps.wait_for_fastboot(timeout=300, serial=serial)()

    img_path = "./temp/image/n/flashfiles/"
    fastboot_steps.flash_image(partition_name="gpt",
                               file_name=img_path + "gpt_gr_mrb_b1.bin",
                               unlock_dut=True,
                               lock_dut=False,
                               serial=serial)()
    fastboot_steps.fastboot_erase_partition(partition_name="teedata",
                                            unlock_dut=False,
                                            lock_dut=False,
                                            reboot=False,
                                            serial=serial)()
    fastboot_steps.fastboot_erase_partition(partition_name="misc",
                                            unlock_dut=False,
                                            lock_dut=False,
                                            reboot=False,
                                            serial=serial)()
    fastboot_steps.fastboot_erase_partition(partition_name="persistent",
                                            unlock_dut=False,
                                            lock_dut=False,
                                            reboot=False,
                                            serial=serial)()
    fastboot_steps.fastboot_erase_partition(partition_name="metadata",
                                            unlock_dut=False,
                                            lock_dut=False,
args = {}
for entry in script_args:
    key, val = entry.split("=")
    args[key] = val
flash_files = args["flash_files"]
partition_name = args["partition_name"]
partition_name = partition_name.split(",")
file_name = args["file_name"]
file_name = file_name.split(",")

##### test start #####
try:
    os.system("mkdir -p ./temp/files/flash")
    fastboot_utils.download_flash_scripts()

    fastboot_steps.fastboot_erase_partition(partition_name = partition_name[0], serial = serial)()
    fastboot_steps.fastboot_erase_partition(partition_name = partition_name[1], serial = serial)()

    check_point1 = False
    check_point2 = False

    fastboot_utils.start_minicom(serial=serial)

    os.system("fastboot reboot > /dev/null 2>&1")
    time.sleep(60)
    fastboot_utils.to_fastboot_by_script(serial=serial)

    fastboot_utils.kill_minicom()

    file_path = "./temp/files/minicom_result.txt"
    return_result = open(file_path).readlines()
コード例 #4
0
	eb_userdebug_patch_flashfiles_zip_name = eb_userdebug_patch_flashfiles_zip_path.split("/")[-1]
	fastboot_utils.download_file(url=fastboot_path+eb_userdebug_patch_flashfiles_zip_path, local_filename="./temp/image/eb/userdebug/"+eb_userdebug_patch_flashfiles_zip_name)

	eb_img_multiboot_corrupted_c_path = config.get(image_platform, eb_img_multiboot_corrupted_c)
	eb_img_multiboot_corrupted_c_name = eb_img_multiboot_corrupted_c_path.split("/")[-1]
	fastboot_utils.download_file(url=fastboot_path+eb_img_multiboot_corrupted_c_path, local_filename="./temp/image/eb/img/"+eb_img_multiboot_corrupted_c_name)

	if platform_name == "bxtp_abl":
		fastboot_utils.flash_bxt_m_fused(eb_user_patch_flashfiles_zip_name=eb_user_patch_flashfiles_zip_name, eb_userdebug_patch_flashfiles_zip_name=eb_userdebug_patch_flashfiles_zip_name, support_flash=True, serial=serial)
	if platform_name == "gordon_peak":
		zip_name = fastboot_utils.get_zip_name(zip_path=flash_files)
		if zip_name == "r0_bxtp_abl":
			fastboot_utils.flash_bxt_m_fused(eb_user_patch_flashfiles_zip_name=eb_user_patch_flashfiles_zip_name, eb_userdebug_patch_flashfiles_zip_name=eb_userdebug_patch_flashfiles_zip_name, support_flash=True, serial=serial)
		if zip_name == "gordon_peak":
			fastboot_utils.flash_bxt(zip_file="./temp/image/eb/userdebug/"+eb_userdebug_patch_flashfiles_zip_name, serial=serial)

	adb_steps.reboot(command="fastboot", reboot_timeout=300, serial=serial)()
	fastboot_steps.fastboot_erase_partition(partition_name="multiboot", reboot=False, serial=serial)()
	fastboot_steps.flash_image(partition_name="multiboot", file_name="./temp/image/eb/img"+eb_img_multiboot_corrupted_c_name, lock_dut=True, serial=serial)()
	os.system("fastboot reboot > /dev/null 2>&1")
	time.sleep(60)
	local_steps.wait_for_fastboot(timeout = 300, serial = serial)()

	fastboot_utils.flash_bxt(zip_file=flash_files, serial=serial)
	os.system("sudo rm -rf ./temp")

except:
	fastboot_utils.flash_bxt(zip_file=flash_files, serial=serial)
	os.system("sudo rm -rf ./temp")
	raise
##### test end #####