ostree icon indicating copy to clipboard operation
ostree copied to clipboard

default fallback to ostree=current

Open cgwalters opened this issue 5 months ago • 2 comments

Re https://github.com/ostreedev/ostree/issues/2283 (but as a separate issue since while it's strongly related, we should think of this separately)

We have a whole chain of complex things in the current bootloader -> ostree= karg -> bootlinks -> deployment.

I think in the initramfs it'd be friendlier if we at least supported ostree=current or so, which could be defined in various ways, but the most obvious is to have a little bit of metadata attached to the deployment noting when it was last booted (i.e. ostree-boot-complete.service was reached).

Actually we should avoid depending on the wall clock, so probably we just want an incrementing serial number or so.

Anyways, in the initramfs we can support ostree=current which would find the largest number, and ostree=last-booted which would do the above (via ostree-boot-complete.service again).


Then connecting with the above issue, people could boot with ostree=last-booted manually (to start) and we should auto-repair the bootlinks on boot.

Arguably we could also change the initramfs logic to default to ostree=last-booted in the situation where the bootlinks are missing.

However...if we do any automatic fallback we definitely want observability - probably via having ostree-boot-complete.service failing? Or I guess logging structured metadata to the journal and/or exposing the fact we did a repair in the status.

cgwalters avatar Aug 15 '25 16:08 cgwalters

I think that could allow us to drop the ostree-cmdline.sh hack in our CoreOS live environment.

Well... maybe not. I guess we'd still need to inject at least ostree=current.

jlebon avatar Aug 15 '25 20:08 jlebon

One thing I'd like to do is sever ostree's dependency on an ostree= karg and have the ability for the initramfs to contain e.g. /usr/lib/ostree/booted or so to. The CoreOS live ISO's initramfs could set that and it would behave the same as e.g. ostree=current.

cgwalters avatar Aug 29 '25 20:08 cgwalters