On Wed, Aug 31, 2022, at 10:49 PM, Michael Chang wrote:
On Wed, Aug 31, 2022 at 10:57:30AM +0200, Alberto Planas wrote:
On Tuesday, August 30, 2022 7:56:40 PM CEST Chris Murphy wrote:
Any recent thoughts on the general direction to go in? Thanks.
There are some developers (Ludwig and Michael Chang) making progress in this direction.
One of them is that there is an experimental patch to GRUB2 that make it to understand the BLS layout. This patch needs work and stabilization, but can be a future candidate to express in the ESP a layout that can be both be understood by GRUB and sd-boot (the devil is in the details, so this will be a lot of work)
Yes I think it is good to have those BLS support in grub. It is not in factory yet but will carry on that.
There is also some work on expressing the snapshots subvolumes in terms of this BLS, and some draft tool will create new boot entries (for now only for sd-boot) per combination of tested kernel + initrd + snapshot. In this way a rollback is a matter of a bootctl call (reeeeally neat)
It should be suffice to just run `btrfs subvolume set-default ...` and reboot to rollback to `any` root snapshot. No bootctl or any bootloader related reinstall/reconfig should take place in the middle of the process, otherwise the operation is not going to be an atomic rollback immute to sudden failure like power outage in between.
I'm not fussy about what tool invokes rollbacks. If $BOOT is an independent file system from $ROOT, then two modifications are needed and thus we can't assume atomicity. e.g. you'd have to do both a btrfs subvolume set-default and change grubenv saved_entry to point to a proper kernel+initramfs combination; and yeah since that's not atomic there is the potential, no matter which order those are done in, that a crash happen after the 1st, before the 2nd, and now you can't boot. Either the kernel you need isn't being pointed to; or the kernel modules you need aren't available. But I think that's not insurmountable, the question is what are the follow on consequences? e.g. you can write a new BLS snippet that points to a specific kernel+initramfs+$ROOT combination, and then when you're ready to make that the current boot, just change the proper variable in grubenv or with bootctl -- Chris Murphy