Skip to content

Commit

Permalink
rpi_boot: fix flag file location
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang committed Jun 17, 2024
1 parent 24900cb commit bb6f86e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/otaclient/app/boot_control/_rpi_boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ def update_firmware(self, *, target_slot: SlotID, target_slot_mp: StrOrPath):

# NOTE(20240603): for backward compatibility(downgrade), still create the flag file.
# The present of flag files means the firmware is updated.
Path(cfg.SWITCH_BOOT_FLAG_FILE).write_text("")
flag_file = Path(cfg.SYSTEM_BOOT_MOUNT_POINT) / cfg.SWITCH_BOOT_FLAG_FILE
flag_file.write_text("")
os.sync()
except Exception as e:
_err_msg = f"failed to apply new kernel,initrd.img for {target_slot}: {e!r}"
Expand Down Expand Up @@ -395,7 +396,8 @@ def __init__(self) -> None:
)

# NOTE(20240604): for backward compatibility, always remove flag file
Path(cfg.SWITCH_BOOT_FLAG_FILE).unlink(missing_ok=True)
flag_file = Path(cfg.SYSTEM_BOOT_MOUNT_POINT) / cfg.SWITCH_BOOT_FLAG_FILE
flag_file.unlink(missing_ok=True)
logger.info("rpi_boot starting finished")
except Exception as e:
_err_msg = f"failed to start rpi boot controller: {e!r}"
Expand Down

0 comments on commit bb6f86e

Please sign in to comment.