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

deploy: Change BootLoaderSpec filenames so they can be used for sorting #1654

Closed
wants to merge 1 commit into from

Conversation

martinezjavier
Copy link
Contributor

Currently the BLS snippets are named ostree-$ID-$VARIANT_ID-$index.conf,
but the BLS config files are actually sorted by using the version field
which is the inverse of the index.

In most places, _ostree_sysroot_read_boot_loader_configs() is used to
get the BLS files and this function already returns them sorted by the
version field. The only place where the index trailing number is used is
in the ostree-grub-generator script that lists the BLS files to populate
the grub config file.

But for some bootloaders the BLS filename is the criteria for sorting by
taking the filename as a string version. So on these bootloaders the BLS
entries will be listed in the reverse order.

To avoid that, change the BLS snippets filename to have the version field
instead of the index and also to have the version before deployment name.

Make the filenames to be of the form ostree-$version-$ID-$VARIANT_ID.conf
so the version is before the deployment name.

Signed-off-by: Javier Martinez Canillas javierm@redhat.com

Currently the BLS snippets are named ostree-$ID-$VARIANT_ID-$index.conf,
but the BLS config files are actually sorted by using the version field
which is the inverse of the index.

In most places, _ostree_sysroot_read_boot_loader_configs() is used to
get the BLS files and this function already returns them sorted by the
version field. The only place where the index trailing number is used is
in the ostree-grub-generator script that lists the BLS files to populate
the grub config file.

But for some bootloaders the BLS filename is the criteria for sorting by
taking the filename as a string version. So on these bootloaders the BLS
entries will be listed in the reverse order.

To avoid that, change the BLS snippets filename to have the version field
instead of the index and also to have the version before deployment name.

Make the filenames to be of the form ostree-$version-$ID-$VARIANT_ID.conf
so the version is before the deployment name.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
@martinezjavier
Copy link
Contributor Author

It seems the test failures are unrelated?

Since I see that in the required test suite the FAH28-insttests failed but this succeeded for ex-required .

And conversely f28-introspection-tests failed for ex-required which succeeded in the required test suite.

@cgwalters
Copy link
Member

That test is flaky sadly...I just don't want to drop it, as at some point I really want to expand our tests to work that way by default. There's some stuff we're doing in the background to enhance reliability here.
If it fails again in the merge queue we'll look then.

Anyways I thought about this a fair bit, I can't see a way it could break anything - the way we do an atomic swap of all the bootloader configs makes this transition easy, and older versions of libostree will keep using the version field. The only danger I can think of is if somehow 15_ostree gets out of sync with the library - but I don't think that will happen in e.g. Anaconda today.

@rh-atomic-bot r+ d86570d

@rh-atomic-bot
Copy link

⌛ Testing commit d86570d with merge 9f48e21...

@martinezjavier
Copy link
Contributor Author

@cgwalters agreed and hopefully we should eventually get rid of 15_ostree too.

@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: cgwalters
Pushing 9f48e21 to master...

cgwalters added a commit to cgwalters/rpm-ostree that referenced this pull request Jun 28, 2018
We should probably add a libtest.sh API for so for this, but this is
the quick hack.  Fallout from ostreedev/ostree#1654
rh-atomic-bot pushed a commit to coreos/rpm-ostree that referenced this pull request Jun 28, 2018
We should probably add a libtest.sh API for so for this, but this is
the quick hack.  Fallout from ostreedev/ostree#1654

Closes: #1433
Approved by: jlebon
rh-atomic-bot pushed a commit to coreos/rpm-ostree that referenced this pull request Jun 28, 2018
We should probably add a libtest.sh API for so for this, but this is
the quick hack.  Fallout from ostreedev/ostree#1654

Closes: #1433
Approved by: jlebon
mike-nguyen added a commit to mike-nguyen/atomic-host-tests that referenced this pull request Jul 24, 2018
The BootLoaderSpec filename change in ostree [0] is causing failures
in streams containing the change.  This commit will handle pre and
post BLS filename changes using a simple regex.

[0] ostreedev/ostree#1654
miabbott pushed a commit to projectatomic/atomic-host-tests that referenced this pull request Jul 24, 2018
* initramfs: update test for BootLoaderSpec change

The BootLoaderSpec filename change in ostree [0] is causing failures
in streams containing the change.  This commit will handle pre and
post BLS filename changes using a simple regex.

[0] ostreedev/ostree#1654
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants