Store required patches in codestream object#170
Merged
fgyanz merged 14 commits intoSUSE:develfrom Dec 23, 2025
Merged
Conversation
2b96161 to
ed83cde
Compare
Collaborator
Author
|
@fgyanz comments addressed! |
Collaborator
|
@vmezzela can we already review? :D |
Collaborator
Author
|
Hi Marcos, I'll mark this as ready to be reviewed when I rebase it on the latest |
7b912bc to
7dbb731
Compare
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
7dbb731 to
1aecf4e
Compare
marcosps
reviewed
Dec 19, 2025
klpbuild/plugins/scan.py
Outdated
|
|
||
| def get_patched_kernels(codestreams, patches): | ||
| def filter_affected_codestreams(codestreams, patches): | ||
| # TODO: remove this |
Collaborator
Author
There was a problem hiding this comment.
Is it removed in a following commit? :D
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
In this way, if no patches are supplied, all the codestreams will go in the unaffected_codestreams list Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
This is in preparation to make apply_all_patches aware of patches
already present on each codestreams so that it can skip those.
This patch also drops logging.debug("Patches dir %s doesnt exists",
pdir) as it's kind of redundant with the next logs.
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@suse.com>
1aecf4e to
6ae6037
Compare
fgyanz
approved these changes
Dec 23, 2025
Collaborator
fgyanz
left a comment
There was a problem hiding this comment.
Reviewed and tested. I proposed a small cosmetic change but by no means mandatory. Thanks a lot for the changes, LGTM!! 🥳
| logging.info("\tDropping %s", patch_name) | ||
| continue | ||
|
|
||
| logging.info("\tApplying %s", patch_name) |
Collaborator
There was a problem hiding this comment.
Very much nitpicking, but I'd propose keeping the previous log message. It's a purely cosmetic change, but I think it keeps more consistent with klp-build logs format.
before:
[2025-11-18 22:05:52] 15.5u30:5.14.21-150500.55.121: Applying /home/fgonzalez/klp/livepatches/bsc1251984/fixes/15.5/01-wifi-rtw88-delete-timer-and-free-skb-queue-when-unlo.patch...
[2025-11-18 22:05:53] Patches dir /home/fgonzalez/klp/livepatches/bsc1251984/fixes/15.5u31 doesnt exists
[2025-11-18 22:05:53] Applying patches on 15.5u31(5.14.21-150500.55.124) from /home/fgonzalez/klp/livepatches/bsc1251984/fixes/15.5
[2025-11-18 22:05:53] 15.5u31:5.14.21-150500.55.124: Applying /home/fgonzalez/klp/livepatches/bsc1251984/fixes/15.5/01-wifi-rtw88-delete-timer-and-free-skb-queue-when-unlo.patch...
now:
Applying patches on 15.5u29(5.14.21-150500.55.116) from /home/fgonzalez/klp/livepatches/bsc1251984/fixes/15.5
Applying wifi-rtw88-delete-timer-and-free-skb-queue-when-unlo.patch
Applying patches on 15.5u30(5.14.21-150500.55.121) from /home/fgonzalez/klp/livepatches/bsc1251984/fixes/15.5
Applying wifi-rtw88-delete-timer-and-free-skb-queue-when-unlo.patch
Applying patches on 15.5u31(5.14.21-150500.55.124) from /home/fgonzalez/klp/livepatches/bsc1251984/fixes/15.5
Applying wifi-rtw88-delete-timer-and-free-skb-queue-when-unlo.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an initial reorganization of the code around
scanand the way we store the patches in preparation for fixing #153 .The final fix can be implemented only after #160 is merged since that PR drops the use of quilt to apply the patches, which makes it more easy to selectively apply them.
I took the chance to further refactor
scan. What was done before is:get_patched_kernels())The unnecessary thing was that we were storing the
cs.kernelinpatched_kernelswhen filtering withget_patched_kernels(). And then afterward we were checking which codestreams had that kernel withif cs.kernel in patched_kernels. This has been simplified by just filtering the patched codestreams (rather than their kernel). With this, a whole loop has been dropped because unneeded.Now the process is:
Avoiding the unneeded
patched_kernel.add(cs.kernel)and thencs->cs.kernel->if cs.kernel in patched_cs->patched_cs.append(cs)steps.Besides that, the most notable part is that now the required patches are stored in the codestream object directly, so that we can just retrieve the patches from there on a per codestream basis rather than on a per product basis, effectively introducing the possibility to perform the patch analysis only on those that are needed. And same goes for the extraction where we will be able to apply only the needed ones.
This is yet to be tested. I am posting this PR in advance to help coordinate the work across different PRs.