-
Notifications
You must be signed in to change notification settings - Fork 326
deploy: only set aboot/abootcfg when found #3413
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
Conversation
Hi @ricardosalveti. Thanks for your PR. I'm waiting for a ostreedev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@ericcurtin at https://github.com/ostreedev/ostree/blob/main/src/libostree/ostree-sysroot-deploy.c#L1201 we are checking for availability of aboot.img and aboot.cfg under /usr/lib/modules/$kver, but when creating the boot entry it sets to the correct path once found and to Since I don't have the aboot logic background, should it really be pointing to Noticed this when booting ostree with systemd-boot, as it complained about the 'aboot' and 'abootcfg' entries:
|
/ok-to-test |
cc @ericcurtin who added aboot |
This would require a test to be sure... There's some not obvious paths in this code as at osbuild-time OSTree when built for aboot behaves a little differently to say when actually booted... |
It's a pity we don't have Packit integrated with OSTree, would be neat to grab an rpm built from this PR and run a quick test. |
@ricardosalveti mind if we take a little while to test this change? |
Might even be worth adding CI for this platform now. There's more variety of ARM runners in GitHub now than there was when this code was added. |
not at all, I guess one thing to confirm is if |
I tested this change on a Qualcomm RideSX4 (sa8775p) with AutoSD 9, and everything looks good to me. @cgwalters @ericcurtin : I am fine with merging this. Tested-by: Brian Masney bmasney@redhat.com |
Thanks for testing this, tested-by tag added and commit updated. |
@masneyb curious what tested means here? Build an image with modified ostree rpm using osbuild? AutoSD booted with modified rpm? AutoSD and OSTree upgraded and booted into the new image version successfully with modified rpm? Just want to be sure, so if this comes back to bite us we know what was tested :) Thanks for helping out. |
I would not block on this, but if we break, we have to push a new OSTree rpm to CentOS Stream, not fun. |
Happy to merge... I'm wary of these changes because some of these code paths behave differently at osbuild-time, first-boot time and upgrade time... |
I guess continuous-integration/jenkins/pr-merge is a flake maybe? |
@ericcurtin : I tested this with the following procedure:
So I guess the only scenario that I didn't test was the upgrade functionality. Suggestions welcome here for how I can test that. Is there anything else that I should have tested? Tomorrow I also want to test this on a Renesas board that we have. |
Regarding the CI failure:
and
Along with various other errors related to |
Maybe @jlebon knows how to kick off the tests again? |
It's documented here: https://sigs.centos.org/automotive/building/unattended_updates/ It's possible to kinda do a fake upgrade, if all the various composefs/fsverity verifications are turned off and we do a "rpm-ostree install some rpm". An rpm-ostree install is kinda like an atomic upgrade. We have done the two most important tests though maybe it's enough, thanks for writing that down. |
Will be neat to see this on the Renasas board, we are missing the userspace AB switching tool for the RideSX4 board. We would fake the AB switching sometimes to test this on RideSX4 or do AA switching (all on the same slot 😅) |
@ericcurtin : I was able to test |
Almost all the CI failures here are not related to the PR, they're fallout from Fedora CoreOS 42 switching to a container image for transport by default. One of the failures is related to the bin/sbin merge. I will look at fixing the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refines the bootloader configuration setup in the deployment process by ensuring that the "aboot" and "abootcfg" entries are only set when aboot.img is detected.
- Removed the fallback branch that previously set "aboot" from the deployment_dirpath.
- Updated the "abootcfg" path to use bootcsumdir consistently with "aboot".
Comments suppressed due to low confidence (1)
src/libostree/ostree-sysroot-deploy.c:2114
- Add tests to verify that no bootloader configuration entries are set when aboot.img is absent, ensuring that the removal of the fallback behavior does not introduce regressions.
g_autofree char *aboot_relpath = g_strconcat ("/", bootcsumdir, "/", aboot_fn, NULL);
g_autofree char *aboot_relpath = g_strconcat ("/", bootcsumdir, "/", aboot_fn, NULL); | ||
ostree_bootconfig_parser_set (bootconfig, "aboot", aboot_relpath); | ||
} | ||
else | ||
{ | ||
g_autofree char *aboot_relpath | ||
= g_strconcat ("/", deployment_dirpath, "/usr/lib/ostree-boot/aboot.img", NULL); | ||
ostree_bootconfig_parser_set (bootconfig, "aboot", aboot_relpath); | ||
} | ||
|
||
g_autofree char *abootcfg_relpath | ||
= g_strconcat ("/", deployment_dirpath, "/usr/lib/ostree-boot/aboot.cfg", NULL); | ||
ostree_bootconfig_parser_set (bootconfig, "abootcfg", abootcfg_relpath); | ||
g_autofree char *abootcfg_relpath = g_strconcat ("/", bootcsumdir, "/aboot.cfg", NULL); | ||
ostree_bootconfig_parser_set (bootconfig, "abootcfg", abootcfg_relpath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change consolidates the aboot and abootcfg paths to use bootcsumdir exclusively. Please update the function's documentation and related comments to clearly state that these boot entries will only be set when aboot.img is found.
Copilot uses AI. Check for mistakes.
@ricardosalveti you can rebase on top of @cgwalters fixes |
Bootloader entry should only have aboot and abootcfg configuration entries when aboot.img is found on the system (e.g. /usr/lib/modules/$kver). Otherwise it will be always set, won't be used during boot and systemd-boot will complain about unknown lines. Tested-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
Head branch was pushed to by a user without write access
done, thanks! |
Fingers crossed auto-merge works |
This change seems to have broken automotive updates for me. We used to look for aboot.cfg in /usr/lib/ostree-boot, but then change makes it look in This means that the BLS file will point to the wrong location for the aboot.cfg file and we never actually update the aboot partition during an A/B switch in the deploy. |
The change in ostreedev#3413 was meant to change when the abootcfg option is set in the BLS file. However, it also changed the value of this key, using the wrong directory (bootcsumdir instead of /usr/lib/ostree-boot). This means that during update, aboot-update gets the wrong path to the config and cannot correctly write the aboot partition.
The change in ostreedev#3413 was meant to change when the abootcfg option is set in the BLS file. However, it also changed the value of this key, using the wrong directory (bootcsumdir instead of /usr/lib/ostree-boot). This means that during update, aboot-update gets the wrong path to the config and cannot correctly write the aboot partition. Signed-off-by: Alexander Larsson <alexl@redhat.com>
@alexlarsson : Can you elaborate specifically what's broken with automotive updates? I outlined what all I tested above in two different comments. This includes the I also listed aboot-deploy 0.7 to work as a requirement. |
@masneyb Hmm, actually I'm not sure if you would have noticed it in your test. Here is what happens when I use ukiboot:
However, looking at aboot-deploy it seems like for aboot, maybe things will work "correctly" (falling back to a single slot boot) with a non-existing config file. However, if any other options from the config file was necessary it would still fail. |
When I tested this in automotive back in Spring, we didn't have a utility bundled by default to do the slot switching, so this was a single slot deployment. I ensured that when I did the upgrade that the new package versions appeared on reboot. I did not go through the system log messages to look for error messages. |
@masneyb I think I only got the error message because i needed the aboot.cfg file to tell it to look for ukiboot_a partition names instead of the default aboot_a name. So, it failed to find the partition for me, but not for you. |
Bootloader entry should only have aboot and abootcfg configuration entries when aboot.img is found on the system (e.g. /usr/lib/modules/$kver).
Otherwise it will be always set, won't be used during boot and systemd-boot will complain about unknown lines.