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

bootloader/grub2: Handle empty static configs #3300

Merged
merged 1 commit into from
Sep 15, 2024

Conversation

travier
Copy link
Member

@travier travier commented Sep 13, 2024

In #3205, we introduced a check to skip re-generating the GRUB config if we detect that static configs are in used by looking at bootupd's state.

Unfortunately this check is incomplete and does not account for present but null entries in the JSON state file.

A proper fix would be to parse the JSON but this requires a larger code change.

Fixes: #3295
Fixes: #3205

Copy link

openshift-ci bot commented Sep 13, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@travier
Copy link
Member Author

travier commented Sep 13, 2024

Still test / investigating if this is really the issue.

@travier
Copy link
Member Author

travier commented Sep 13, 2024

@travier
Copy link
Member Author

travier commented Sep 13, 2024

CI fixes in #3301

@@ -30,6 +30,7 @@
#define BOOTUPD_CONFIG "boot/bootupd-state.json"
// Horrible hack, to avoid including a JSON parser we just grep for this
#define BOOTUPD_CONFIG_STATIC_JSON_FRAGMENT "\"static-configs\""
#define BOOTUPD_CONFIG_STATIC_JSON_FRAGMENT_NULL "\"static-configs\":null"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch 😢

I dunno, maybe overdue for us to link in a json library, I had just hoped to do that with rust (that's in #3054 but nontrivial)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree it's really not great :/

In ostreedev#3205, we introduced a check to skip re-generating the GRUB config if
we detect that static configs are in used by looking at bootupd's state.

Unfortunately this check is incomplete and does not account for present
but null entries in the JSON state file.

A proper fix would be to parse the JSON but this requires a larger code
change.

Fixes: ostreedev#3295
Fixes: ostreedev#3205
@travier travier force-pushed the main-static-config-null branch from e339625 to 508a8b6 Compare September 13, 2024 22:34
@travier travier marked this pull request as ready for review September 13, 2024 23:24
@travier
Copy link
Member Author

travier commented Sep 13, 2024

This is working from initial testing.

@cgwalters cgwalters merged commit 558f260 into ostreedev:main Sep 15, 2024
24 of 25 checks passed
@travier travier deleted the main-static-config-null branch September 15, 2024 19:31
@champtar
Copy link

champtar commented Oct 7, 2024

Just stumbled on this bug with EL 9.4, is it already planned for backport to EL 9.4 (or 9.5) or should I open an issue/case ?
EDIT:

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.

Incorrect check for static configs with bootupd
3 participants