Add file-level scanner for Linux kernel module (.ko) metadata - #5249
Open
OctavioValdiviaMendoza wants to merge 10 commits into
Open
Add file-level scanner for Linux kernel module (.ko) metadata#5249OctavioValdiviaMendoza wants to merge 10 commits into
OctavioValdiviaMendoza wants to merge 10 commits into
Conversation
…ata using .modinfo section found in ELF files to yield the module macros
…s that are now passed to PackageData
…y DependecyPackage and PAckageData are structured correctly
Add Linux Kernel Module package parser Add support for parsing Linux Kernel Module (.ko) files. Add pyelftools as a runtime dependency for reading ELF .modinfo sections, register the new handler, and add unit tests.
…km.py Add self to AUTHORS.rst Signed-off-by: diana-galeana <162429082+diana-galeana@users.noreply.github.com>
Signed-off-by: OctavioValdiviaMendoza <octavio.valdiviamendoza@sjsu.edu>
Signed-off-by: OctavioValdiviaMendoza <octavio.valdiviamendoza@sjsu.edu>
Signed-off-by: OctavioValdiviaMendoza <octavio.valdiviamendoza@sjsu.edu>
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.
Fixes #625
This PR adds file-level scanning of metadata embedded in compiled Linux Kernel Module (
.ko) files.Implementation
A new
LinuxKernelModuleScanneris implemented inscancode/plugin_lkm.pyusing ScanCode's file-levelScanPluginarchitecture.The scanner:
--lkmoption.pyelftoolsto open.kofiles as ELF files..modinfoELF section.key=valueentries.author,alias, andfirmwareas lists.linux_kernel_moduleattribute..modinfodependsvalue into a simple list of required kernel-module names.For example:
{ "linux_kernel_module": { "license": ["GPL"], "author": ["Example Author"], "depends": ["video", "backlight"] } }Tests
Test coverage includes:
Tasks