Uncompress modules#28
Conversation
| 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") |
There was a problem hiding this comment.
Perhaps something like
patched_obj_ko = re.sub(r'(?:\.ko|\.gz|\.xz|\.zst)+$', '',patched_obj_ko)
would be cleaner?
There was a problem hiding this comment.
Perhaps even (?:\.ko)?(?:\.gz|\.xz|\.xz)?$ ? I mean, we're expecting at most one level of compression?
dcdd444 to
dbee7f5
Compare
|
I had to install python313-magic to use the magic lib. Otherwise, I addressed all your comments. |
|
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 |
I think so, yes. |
0119879 to
e394b35
Compare
def6eb1 to
172e9c5
Compare
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>
172e9c5 to
dbf5054
Compare
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.