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

[Feature request?] Make abroot not lock ifself if the current upgrade is cancelled by user #265

Open
fluoriteByte opened this issue Apr 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@fluoriteByte
Copy link

i think abroot should be able to unlock itself if the user cancelled an upgrade or if the upgrade pre-staging fails (during update check or during download)
it gets kinda annoying trying to test abroot when it keeps locking up needing a reboot

@taukakao taukakao added the enhancement New feature or request label Apr 25, 2024
@taukakao
Copy link
Member

Yeah, it should be possible to abort until the "safe point".
Though currently it's not defined correctly. It's here:

ABRoot/core/system.go

Lines 700 to 705 in 1c3f672

// from this point on, it is not possible to stop the upgrade
// so we remove the stage file. Note that interrupting the upgrade
// from this point on will not leave the system in an inconsistent
// state, but it could leave the future partition in a dirty state
// preventing it from booting.
err = s.RemoveStageFile()

This information is wrong, Generating the Fstab, crypttab and systemd mount units will not leave the system in an inconsistant state. It only affects the .system.new folder, which is completely independant.

The actual "safe point" would be before these lines probably:

ABRoot/core/system.go

Lines 815 to 818 in 1c3f672

err = CopyFile(
filepath.Join(systemNew, "boot", "vmlinuz-"+kernelVersion),
filepath.Join(initMountpoint, partFuture.Label, "vmlinuz-"+kernelVersion),
)

I think this is the first time something from the old future system is overwritten, but this needs to be evaluated further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants