Skip to content

Commit

Permalink
rpi_boot: hide the flag_file things to _RPIBootControl
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang committed Jun 19, 2024
1 parent 6fbb2cd commit 8f8d8eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/otaclient/app/boot_control/_rpi_boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ def __init__(self) -> None:
self._check_boot_files()
self._check_active_slot_id()

# NOTE(20240604): for backward compatibility, always remove flag file
flag_file = Path(cfg.SYSTEM_BOOT_MOUNT_POINT) / cfg.SWITCH_BOOT_FLAG_FILE
flag_file.unlink(missing_ok=True)

def _check_active_slot_id(self):
"""Check whether the active slot fslabel is matching the slot id.
Expand Down Expand Up @@ -414,10 +418,6 @@ def __init__(self) -> None:
/ Path(cfg.OTA_STATUS_DIR).relative_to("/"),
finalize_switching_boot=self._rpiboot_control.finalize_switching_boot,
)

# NOTE(20240604): for backward compatibility, always remove flag file
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 8f8d8eb

Please sign in to comment.