From 5ebe9b46d2944b380cd46a4a7bb882f438a1414c Mon Sep 17 00:00:00 2001 From: John Sanpe Date: Thu, 28 Dec 2023 02:21:07 +0800 Subject: [PATCH] qfil: fixed path inconsistency issue when setting bootable Signed-off-by: John Sanpe --- edlclient/Library/firehose_client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/edlclient/Library/firehose_client.py b/edlclient/Library/firehose_client.py index 9b2f18d..b0e5795 100644 --- a/edlclient/Library/firehose_client.py +++ b/edlclient/Library/firehose_client.py @@ -136,10 +136,11 @@ def check_cmd(self, func): return True return False - def find_bootable_partition(self, rawprogram): + def find_bootable_partition(self, imagedir, rawprogram): part = -1 for xml in rawprogram: - with open(xml, "r") as fl: + filename = os.path.join(imagedir, xml) + with open(filename, "r") as fl: for evt, elem in ET.iterparse(fl, events=["end"]): if elem.tag == "program": label = elem.get("label") @@ -957,7 +958,8 @@ def handle_firehose(self, cmd, options): else: self.warning(f"File : {filename} not found.") self.info("[qfil] patching ok") - bootable = self.find_bootable_partition(rawprogram) + + bootable = self.find_bootable_partition(imagedir, rawprogram) if bootable != -1: if self.firehose.cmd_setbootablestoragedrive(bootable): self.info("[qfil] partition({partition}) is now bootable\n".format(partition=bootable))