Vanilla-OS / ABRoot

ABRoot is a utility that provides full immutability and atomicity to a Linux system, by transacting between two root filesystems. Updates are performed using OCI images, to ensure that the system is always in a consistent state.
http://abroot.vanillaos.org/
GNU General Public License v3.0
317 stars 23 forks source link

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

Open fluoriteByte opened 7 months ago

fluoriteByte commented 7 months ago

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 commented 7 months ago

Yeah, it should be possible to abort until the "safe point". Though currently it's not defined correctly. It's here: https://github.com/Vanilla-OS/ABRoot/blob/1c3f672d4bea734b6e02425ff63a67698a54ae6b/core/system.go#L700-L705

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: https://github.com/Vanilla-OS/ABRoot/blob/1c3f672d4bea734b6e02425ff63a67698a54ae6b/core/system.go#L815-L818

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

taukakao commented 3 weeks ago

One additional thing: We would probably need to capture "os.Interrupt" so that we can clean up the lockfile even if the user interrupts with Ctrl+C.