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

grub and ostree disagree on BLS versioning #2961

Closed
cgwalters opened this issue Jul 31, 2023 · 1 comment · Fixed by #3206
Closed

grub and ostree disagree on BLS versioning #2961

cgwalters opened this issue Jul 31, 2023 · 1 comment · Fixed by #3206
Assignees
Labels
difficulty/medium medium complexity/difficutly issue jira reward/medium Fixing this will be notably useful

Comments

@cgwalters
Copy link
Member

OK so I was playing around with alternative stateroots (i.e. ostree admin os-init backup; ostree admin deploy --os=backup $commit) and made an unfortunate discovery.

Today, ostree writes BLS files with a version entry in them, and that's what it thinks the bootloader order should be.

grub2 though seems to be parsing the filenames...as if they were RPM packages actually. See this code: https://github.com/rhboot/grub2/blob/7de33f4072abf5f14c4fdad6e566c58bdbf3b26e/grub-core/commands/blscfg.c#L400

And what's ugly here is what ostree writes into the filenames looks like ostree-$version-$stateroot. Except...that parsing code splits on -. So things go badly if the stateroot name contains -...as it does for fedora-coreos.

We end up with (I think)

name=ostree-$version
version=fedora
release=coreos

This isn't exactly problem if one only has one stateroot...we'll still correctly sort on the ordering of "name" here...it's just ugly.

However, it does completely break the ability to use alternative stateroots because then the parsing of things just breaks.

I think we could probably change the filenames we emit to match this schema. Hmm...probably we need the version to go first to reliably fix this, and then encode everything else into the version field or so?

@cgwalters
Copy link
Member Author

I think last time I looked at this it looked like zipl at least did read the version field.

@cgwalters cgwalters added difficulty/medium medium complexity/difficutly issue reward/medium Fixing this will be notably useful labels Jul 31, 2023
cgwalters added a commit to cgwalters/ostree that referenced this issue Aug 24, 2023
I've verified that this fixes compatibility with GRUB, which
parses the filename:
ostreedev#2961

However, out of a large degree of conservatism I've made this
an opt-in behavior for now.

My plan is to test it out in the FCOS development streams first.
cgwalters added a commit to cgwalters/ostree that referenced this issue Aug 24, 2023
I've verified that this fixes compatibility with GRUB, which
parses the filename:
ostreedev#2961

However, out of a large degree of conservatism I've made this
an opt-in behavior for now.

My plan is to test it out in the FCOS development streams first.
@jmarrero jmarrero self-assigned this Nov 1, 2023
@jmarrero jmarrero added the jira label Nov 1, 2023
cgwalters added a commit to cgwalters/ostree that referenced this issue Feb 28, 2024
I think it's about time we flipped this on by default;
like the bootprefix I was a bit too chicken.  We still have
a `bootloader-naming-1` that can be flipped on in case of
some regression.

Closes: ostreedev#2961
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/medium medium complexity/difficutly issue jira reward/medium Fixing this will be notably useful
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants