In order to save memory the system deletes old ostree deployments,
after a reboot required update/upgrade. But in some cases, it was
not deleting them.
This commit fixes it, by creating a unique flag to say if the system
was rebooted after an update/upgrade.
Using this flag the agent can perform operations after the reboot.
This flag is saved under /var/persist, a folder that persists
between deployments.
Test-plan:
PASS: Install patches 22.12
PASS: Remove patches 22.12
PASS: Install patches 24.09
PASS: Remove patches 24.09
PASS: Rollback patches 24.09
PASS: Install major release 22.12 to 24.09
PASS: Rollback major release (during an upgrade from 22.12 to 24.09)
PASS: Apply/Remove 24.09 patch before bootstrap
Closes-bug: 2098029
Change-Id: I9e8cbea83e95f7cf8fe2af505766d476fcd3aee7
Signed-off-by: Lindley Vieira <lindley.vieira@windriver.com>