1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 10:51:13 +01:00

vexperess flashing: added an option to keep UEFI entry

This commit is contained in:
Sergei Trofimov 2015-09-14 15:31:21 +01:00
parent 76253e1e26
commit e36c619fc2

View File

@ -154,7 +154,7 @@ class VersatileExpressFlasher(Flasher):
"""
def flash(self, image_bundle=None, images=None):
def flash(self, image_bundle=None, images=None, recreate_uefi_entry=True): # pylint: disable=arguments-differ
device = self.owner
if not hasattr(device, 'port') or not hasattr(device, 'microsd_mount_point'):
msg = 'Device {} does not appear to support VExpress flashing.'
@ -176,10 +176,12 @@ class VersatileExpressFlasher(Flasher):
init_dtr=0) as target:
menu = UefiMenu(target)
menu.open(timeout=300)
if menu.has_option(device.uefi_entry):
if recreate_uefi_entry and menu.has_option(device.uefi_entry):
self.logger.debug('Deleting existing device entry.')
menu.delete_entry(device.uefi_entry)
menu.create_entry(device.uefi_entry, device.uefi_config)
menu.create_entry(device.uefi_entry, device.uefi_config)
elif not menu.has_option(device.uefi_entry):
menu.create_entry(device.uefi_entry, device.uefi_config)
menu.select(device.uefi_entry)
target.expect(device.android_prompt, timeout=device.timeout)