Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user-initiated rollback #381

Merged
merged 3 commits into from
Jan 23, 2025
Merged

Add user-initiated rollback #381

merged 3 commits into from
Jan 23, 2025

Conversation

detsch
Copy link
Member

@detsch detsch commented Dec 19, 2024

No description provided.

@detsch detsch requested a review from mike-sul December 19, 2024 16:13
@detsch detsch force-pushed the detsch-user-rollback branch from 3b57c51 to 2cc18d1 Compare December 19, 2024 16:16
@detsch
Copy link
Member Author

detsch commented Dec 19, 2024

Still missing handling of bootloader rollback protection. If enabled, we should not allow rollback after update is finalized.

src/liteclient.cc Outdated Show resolved Hide resolved
@mike-sul
Copy link
Contributor

LGTM, will test it a bit.

@detsch detsch force-pushed the detsch-user-rollback branch from 2cc18d1 to a974c91 Compare January 3, 2025 00:04
src/aklite_client_ext.cc Outdated Show resolved Hide resolved
src/aklite_client_ext.cc Outdated Show resolved Hide resolved
src/aklite_client_ext.cc Outdated Show resolved Hide resolved
src/aklite_client_ext.cc Outdated Show resolved Hide resolved
src/aklite_client_ext.cc Outdated Show resolved Hide resolved
src/aklite_client_ext.cc Outdated Show resolved Hide resolved

Uptane::Target rollback_target{Uptane::Target::Unknown()};
{
std::vector<Uptane::Target> installed_versions;
storage->loadPrimaryInstallationLog(&installed_versions,
true /* make sure that Target has been successfully installed */);
true /* make sure that Target has been successfully installed */, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same question about considering the current target as the target to rollback to under certain circumstances.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A change here is probably needed, to allow current depending if the latest install has finished or not. I'll adjust it tomorrow.

src/aklite_client_ext.cc Outdated Show resolved Hide resolved
src/aklite_client_ext.cc Outdated Show resolved Hide resolved
@mike-sul
Copy link
Contributor

mike-sul commented Jan 3, 2025

LGTM, the direction is fine. I just have two concerns:

  1. Not allowing the current target as "rollback" target under certain circumstances.
  2. Doing the boot fw rollback protection check before invoking installation of the rollback target (we simply don't know boot fw version in advance before the version file is available of a file system).

@detsch detsch force-pushed the detsch-user-rollback branch 3 times, most recently from 3fec0a3 to bba8f3f Compare January 9, 2025 20:41
@detsch detsch force-pushed the detsch-user-rollback branch 5 times, most recently from ad34f29 to e456ee7 Compare January 15, 2025 20:15
src/aklite_client_ext.cc Outdated Show resolved Hide resolved
src/aklite_client_ext.cc Outdated Show resolved Hide resolved
src/aklite_client_ext.cc Outdated Show resolved Hide resolved
src/aklite_client_ext.cc Outdated Show resolved Hide resolved
src/aklite_client_ext.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@mike-sul mike-sul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I have just a few nitpicks apart of the test issue mentioned earlier.

@detsch detsch force-pushed the detsch-user-rollback branch 2 times, most recently from 2565cbb to 1473d8b Compare January 16, 2025 14:34
@detsch detsch force-pushed the detsch-user-rollback branch from 1473d8b to 52168f2 Compare January 17, 2025 19:59
@detsch detsch marked this pull request as ready for review January 17, 2025 19:59
@detsch detsch force-pushed the detsch-user-rollback branch from 52168f2 to 3ffd0fd Compare January 23, 2025 20:52
This new operation marks the current target as a failing target, and
proceeds to install the selected rollback target, which can be
automatically selected (the most recent fully installed target), or
explicitly defined by the caller of the function.
A rollback can be initiated after an installation is completed, but also
while finalization of system reboot is still pending.

Signed-off-by: Andre Detsch <[email protected]>
@detsch detsch force-pushed the detsch-user-rollback branch from 3ffd0fd to 4c0a1cd Compare January 23, 2025 20:58
@detsch detsch merged commit c658acb into master Jan 23, 2025
5 checks passed
@detsch detsch deleted the detsch-user-rollback branch January 23, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants