Skip to content

Commit

Permalink
Merge branch 'main' into release/v3.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang authored May 15, 2024
2 parents 0aa5efa + 3c5fea7 commit f92c29c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions otaclient/app/boot_control/_jetson_cboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def _nv_firmware_update(self) -> Optional[bool]:
new_bsp_v = parse_bsp_version(_new_bsp_v_fpath.read_text())
except Exception as e:
logger.warning(f"failed to detect new image's BSP version: {e!r}")
logger.info("skip firmware update due to new image BSP version unknown")
logger.warning("skip firmware update due to new image BSP version unknown")
return

logger.info(f"BUP package version: {new_bsp_v=}")
Expand Down Expand Up @@ -481,7 +481,6 @@ def _nv_firmware_update(self) -> Optional[bool]:
standby_bootloader_slot, new_bsp_v
)
return True
logger.info("no firmware payload BUP available, skip firmware update")

# APIs

Expand Down Expand Up @@ -529,14 +528,17 @@ def post_update(self) -> Generator[None, None, None]:
)

# ------ firmware update ------ #
_fw_update_result = self._nv_firmware_update()
if _fw_update_result:
# update the firmware_bsp_version file on firmware update applied
self._firmware_ver_control.write_standby_firmware_bsp_version()
firmware_update_result = self._nv_firmware_update()
if firmware_update_result:
self._firmware_ver_control.write_current_firmware_bsp_version()
elif _fw_update_result is not None:
elif firmware_update_result is None:
logger.info("no firmware update occurs")
else:
raise JetsonCBootContrlError("firmware update failed")

# ------ preserve BSP version files to standby slot ------ #
self._firmware_ver_control.write_standby_firmware_bsp_version()

# ------ preserve /boot/ota folder to standby rootfs ------ #
preserve_ota_config_files_to_standby(
active_slot_ota_dirpath=self._mp_control.active_slot_mount_point
Expand All @@ -548,6 +550,7 @@ def post_update(self) -> Generator[None, None, None]:
)

# ------ for external rootfs, preserve /boot folder to internal ------ #
# NOTE: the copy must happen AFTER all the changes to active slot's /boot done.
if self._cboot_control._external_rootfs:
logger.info(
"rootfs on external storage enabled: "
Expand Down

0 comments on commit f92c29c

Please sign in to comment.