Skip to content

Uncompress modules#28

Open
marcosps wants to merge 3 commits intoSUSE:masterfrom
marcosps:uncompress-modules
Open

Uncompress modules#28
marcosps wants to merge 3 commits intoSUSE:masterfrom
marcosps:uncompress-modules

Conversation

@marcosps
Copy link
Copy Markdown

These changes do not change how klp-ccp works, just handles kernel modules that are not compressed. It will still continue to work the uncompressed files as before.

Comment thread examples/policies/suse/klp_policy.py Outdated
self._patched_obj_name = \
patched_obj_ko[0].translate({ord('-') : ord('_')})
patched_obj_ko = (
patched_obj_ko.removesuffix(".zst").removesuffix(".gz").removesuffix(".xz").removesuffix(".ko")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps something like
patched_obj_ko = re.sub(r'(?:\.ko|\.gz|\.xz|\.zst)+$', '',patched_obj_ko)
would be cleaner?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Perhaps even (?:\.ko)?(?:\.gz|\.xz|\.xz)?$ ? I mean, we're expecting at most one level of compression?

@marcosps marcosps force-pushed the uncompress-modules branch 2 times, most recently from dcdd444 to dbee7f5 Compare April 20, 2026 14:49
@marcosps
Copy link
Copy Markdown
Author

I had to install python313-magic to use the magic lib. Otherwise, I addressed all your comments.

@marcosps
Copy link
Copy Markdown
Author

Since klp-build will use it as well, maybe we can add this dep there, since I couldn't find any python project or setup.py in klp-ccp.

@vmezzela
Copy link
Copy Markdown
Contributor

Since klp-build will use it as well, maybe we can add this dep there, since I couldn't find any python project or setup.py in klp-ccp.

I think it has to go directly in the rpm/*.spec file. Maybe Requires: python313-magic will do?

@marcosps
Copy link
Copy Markdown
Author

Since klp-build will use it as well, maybe we can add this dep there, since I couldn't find any python project or setup.py in klp-ccp.

I think it has to go directly in the rpm/*.spec file. Maybe Requires: python313-magic will do?

I think so, yes.

@marcosps marcosps force-pushed the uncompress-modules branch 4 times, most recently from 0119879 to e394b35 Compare April 22, 2026 12:24
@marcosps marcosps force-pushed the uncompress-modules branch 2 times, most recently from def6eb1 to 172e9c5 Compare April 28, 2026 13:21
If the given patched object is not decompressed, do it before loading
the ELF.

No functional changes.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Do not error out if the patched object isn't a .ko file. The kernel
modules are now handled correctly even when they are compressed later
in the same script.

Also, remove the suffixes from the filename. This is required because
klp-build consumes obj_exts file generated by klp-ccp to created the
externalized entries, and for such it uses the module names in the file.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
@marcosps marcosps force-pushed the uncompress-modules branch from 172e9c5 to dbf5054 Compare April 28, 2026 13:23
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.

4 participants