Repository navigation
kpatch-build, lib.sh: add kernel variant support - #1530
usebeforefree wants to merge 2 commits into
Conversation
|
@usebeforefree - thanks for the PR. The parsing and code looks mostly good, I have a few cosmetic suggestions:
Also, at some point would you later update the testing farm / packit CI to run aarch64-64k ? |
12cc263 to
3e73301
Compare
3e73301 to
1ce2d1a
Compare
|
Thanks for the review @joe-lawrence ! Applied all the suggestions.
I used the kpatch/kpatch-build/kpatch-build Lines 981 to 988 in 74ac9ff I can find-and-replace them if we'd like to use the proper term.
I will do this in a separate PR, otherwise we'd create circular dependency within them. |
You can leave the Photon "flavor" references in place. I have no idea if that's what that distribution uses that naming convention, I just thought for RHEL-based releases we should adopt what its kernel specfile is already using. (Naming things is already hard enough :)
Sounds good. |
|
@Tomcat-42 @ykopkova : I have no idea how to add @usebeforefree, or anybody for that matter, to the testing farm access. The current results say, "usebeforefree can't run tests internally". How can we add him? Thanks. |
|
Update: I would actually like to enable the packit tests in this PR, working on it in the meantime. |
I "think" only project maintainers or members can trigger packit ci testing. |
|
Update: I came up with this solution for adding the I see the test case is called in this PR, someone just needs to figure out a way to make the pipeline accept it. Though we firstly need to target the The easiest certainly would be:
Note to self: the same branch shenanigans could be done with Side question: Should we update other tests to target rhel-10.3? |
You know more than me about the testing :D, so I'd defer to Yulia / Pablo about this.
The next sprint we should be updating/pushing out final integration tests for the next y-stream releases. I think that's a pre-req for what you're asking here? |
|
/packit test |
f37de49 to
38fb136
Compare
|
/packit test |
1 similar comment
|
/packit test |
38fb136 to
bc8ebe1
Compare
|
not ready for merging, the 64k test is pointed to a custom branch |
|
/packit test |
bc8ebe1 to
1a0a39d
Compare
|
/packit test |
1a0a39d to
29cf1af
Compare
|
The tests for all arches except The only thing left really here is an issue I discovered along the way. The TLDR is that with this proposed fix you can't use the kpatch-build kpatch/kpatch-build/kpatch-build Lines 916 to 930 in 74ac9ff |
|
My proposal for how to fix the issue when calling
if [[ "$(uname -r)" =~ \+(.*)$ ]]; then
warn "kernel variants are incompatible with --sourcerpm"
exit 1
fi
if [[ "$(uname -r)" =~ \+(.*)$ ]]; then
ARCHVERSION="${ARCHVERSION}+${BASH_REMATCH[1]}"
fiNo idea what would be the better option. Exiting seems safer in any case, but I don't have the experience of how using kpatch-build to say if 2. solution would be viable. |
Here is how the kpatch-patch.spec runs kpatch-build: # ... close your eyes, kids, it's .specfile voodoo ...
kpatch-build/kpatch-build -n %{patchmodname} -r %{SOURCE10} -v $vmlinux --skip-cleanup $patch_sourcesI see, that's an interesting problem: the user initiates a kpatch-build and specifies the source rpm. Up until now, we could assume that the user was interested in the same-arch (non-variant) configuration from the source rpm. With this arm64 64k variant, that assumption may not always hold true. (BTW, I think this may be a similar problem if one wanted to build for modern RHEL realtime variant as well.) I think the "right" answer is probably an additional Does that capture the last hurdle and work as a solution? |
|
I think the proposal would work, but only if running kpatch-build on ex. I don't have the expertise to know this, what I do have are logs of tests that failed due to this exact situation, and an LLM analysis: A mismatch can at least cause a user to waste time on building the wrong kernel (see If the above is true, maybe we can just add an internal check for mismatch between running system variant and (non)passed variant? edit: I am confused about the usage of kpatch-build across different host and target systems, so feel free to just say if all this above is not really relevant, and I'll proceed to implement |
The user can build with a cross compiler, or in the case of arm64, either the ordinary or variant regardless of which one they are currently booted/installed. |
4272f3c to
5bd14a1
Compare
|
Rebased to include rhel10.3 integration tests, added the https://artifacts.osci.redhat.com/testing-farm/679ddddf-e4ee-4872-b703-6c4441848d8f Expecting the tests to pass and the variant argument to get called from this line: Will request a review after I confirm both the integration, and tier2 tests pass. |
5bd14a1 to
1b7888c
Compare
|
Thanks, the Two follow-ups before this is ready:
Untested (after option parsing / distro setup, once both are known): if [[ -n "$VARIANT" && -z "$SRCRPM" ]]; then
die "--variant requires --sourcerpm"
fiThis is the same pattern as the existing
There’s no check, so a bad value usually dies later as "kernel-debuginfo-…+bogus not installed or can't find config file." After the SRPM is unpacked and you’re selecting the config under elif [[ -n "$VARIANT" ]]; then
cfg="$KERNEL_SRCDIR/configs/kernel$ALT-$KVER-$ARCH-$VARIANT.config"
[[ -e "$cfg" ]] || die "kernel variant '$VARIANT' not found (expected $(basename "$cfg"))"
[[ -z "$CONFIGFILE" ]] && CONFIGFILE="$cfg"Note: the debuginfo/vmlinux check still runs before unpack, so without -v a bad variant may still hit that path first. The config check above covers the post-unpack case. Special-casing the earlier debuginfo die when --variant was set is optional. If this is starting to feel like scope creep, feel free to remove the variant / sourcerpm option for now and we can tackle in a subsequent MR to unblock testing (if that's possible). Thanks for working on this! |
Add kpatch-build kernel variant argument (e.g., 64k , rt-64k), and integration tests. This effort adds support for RHEL-derived distributions. Signed-off-by: Marko Kostić <mkostic@redhat.com>
Signed-off-by: Marko Kostić <mkostic@redhat.com>
1b7888c to
1c1a8a8
Compare
|
Applied all suggested changes.
Other paths set tests: https://artifacts.osci.redhat.com/testing-farm/5c49f894-b0c8-4296-873b-4ded30394de6/ |
At the moment kpatch-build doesn't support kernel variants (e.g., +64k , +rt_64k), this PR aims to add support for kpatch-build and testing for them. Tested on
kernel-64k-aarch64.Cc: @joe-lawrence