Skip to content

Commit

Permalink
jetson-uefi: copy to internal emmc should happen after firmware update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang committed May 15, 2024
1 parent e41e4c4 commit 3bec963
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions otaclient/app/boot_control/_jetson_uefi.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def post_update(self) -> Generator[None, None, None]:
standby_slot_partuuid=self._uefi_control.standby_rootfs_dev_partuuid,
)

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

# ------ preserve /boot/ota folder to standby rootfs ------ #
Expand All @@ -511,6 +511,15 @@ def post_update(self) -> Generator[None, None, None]:
/ "ota",
)

# ------ switch boot to standby ------ #
firmware_update_triggered = self._capsule_firmware_update()
# NOTE: manual switch boot will cancel the firmware update and cancel the switch boot itself!
if not firmware_update_triggered:
self._uefi_control.switch_boot_to_standby()
logger.info(
f"no firmware update configured, manually switch slot: \n{_NVBootctrl.dump_slots_info()}"
)

# ------ for external rootfs, preserve /boot folder to internal ------ #
# NOTE: the copy should happen AFTER the changes to /boot folder at active slot.
if self._uefi_control._external_rootfs:
Expand All @@ -526,15 +535,6 @@ def post_update(self) -> Generator[None, None, None]:
/ "boot",
)

# ------ switch boot to standby ------ #
firmware_update_triggered = self._capsule_firmware_update()
# NOTE: manual switch boot will cancel the firmware update and cancel the switch boot itself!
if not firmware_update_triggered:
self._uefi_control.switch_boot_to_standby()
logger.info(
f"no firmware update configured, manually switch slot: \n{_NVBootctrl.dump_slots_info()}"
)

# ------ prepare to reboot ------ #
self._mp_control.umount_all(ignore_error=True)
logger.info("post update finished, wait for reboot ...")
Expand Down

0 comments on commit 3bec963

Please sign in to comment.