From d6fef909697eba91c306ea1cb626f52e4b075993 Mon Sep 17 00:00:00 2001 From: "bodong.yang" Date: Tue, 11 Jun 2024 08:59:45 +0000 Subject: [PATCH] jetson-uefi: distiguish firmware BSP version and rootfs BSP version --- .../app/boot_control/_jetson_uefi.py | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/otaclient/app/boot_control/_jetson_uefi.py b/src/otaclient/app/boot_control/_jetson_uefi.py index 97bc27138..77923d4dd 100644 --- a/src/otaclient/app/boot_control/_jetson_uefi.py +++ b/src/otaclient/app/boot_control/_jetson_uefi.py @@ -247,18 +247,38 @@ def __init__(self): raise JetsonUEFIBootControlError(_err_msg) logger.info(f"dev compatibility: {compat_info}") - # ------ check firmware BSP version ------ # + # ------ check BSP version ------ # + # check firmware BSP version try: self.bsp_version = bsp_version = ( NVBootctrlCommon.get_current_fw_bsp_version() ) assert bsp_version, "bsp version information not available" + logger.info(f"current slot firmware BSP version: {bsp_version}") except Exception as e: _err_msg = f"failed to detect BSP version: {e!r}" logger.error(_err_msg) raise JetsonUEFIBootControlError(_err_msg) logger.info(f"{bsp_version=}") + # check rootfs BSP version + try: + self.rootfs_bsp_verion = rootfs_bsp_version = parse_bsp_version( + Path(boot_cfg.NV_TEGRA_RELEASE_FPATH).read_text() + ) + logger.info(f"current slot rootfs BSP version: {rootfs_bsp_version}") + except Exception as e: + logger.warning(f"failed to detect rootfs BSP version: {e!r}") + self.rootfs_bsp_verion = rootfs_bsp_version = None + + if rootfs_bsp_version and rootfs_bsp_version >= bsp_version: + logger.warning( + ( + "current slot's rootfs bsp version is newer than the firmware bsp version, " + "this indicates the device previously only receive rootfs update, this is unexpected" + ) + ) + # ------ sanity check, currently jetson-uefi only supports >= R35.2 ----- # # only after R35.2, the Capsule Firmware update is available. if not bsp_version >= (35, 2, 0):