From 9058086b64a123bc27ed79589173290e70b63778 Mon Sep 17 00:00:00 2001 From: "Velayutham, Arunkumar" Date: Fri, 2 May 2025 13:28:37 -0400 Subject: [PATCH] Fix IPU upgrade flow Update partition table information after dd IPU SSD image. Signed-off-by: Velayutham, Arunkumar --- utils/fwutils.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/utils/fwutils.py b/utils/fwutils.py index 816470d..d598b80 100644 --- a/utils/fwutils.py +++ b/utils/fwutils.py @@ -112,6 +112,23 @@ def reflash_ipu(self) -> None: if result.returncode: logger.error("Failed to flash_ssd_image") sys.exit(result.returncode) + + logger.info("Tidy up file system") + # sync at IMC to refresh the partition tables + run( + f"ssh -o 'StrictHostKeyChecking=no' -o 'UserKnownHostsFile=/dev/null' {self.imc_address} 'sync ; sync ; sync'", + dry_run=self.dry_run, + ) + # write the in-memory partition table to disk + run( + f"ssh -o 'StrictHostKeyChecking=no' -o 'UserKnownHostsFile=/dev/null' {self.imc_address} 'echo -e \"w\" | fdisk /dev/nvme0n1'", + dry_run=self.dry_run, + ) + run( + f"ssh -o 'StrictHostKeyChecking=no' -o 'UserKnownHostsFile=/dev/null' {self.imc_address} 'parted -sf /dev/nvme0n1 print'", + dry_run=self.dry_run, + ) + else: logger.info("Skipping flash_ssd_image")