-
Notifications
You must be signed in to change notification settings - Fork 524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add driverdog to link and load kernel modules at runtime #1867
Conversation
packages/release/Cargo.toml
Outdated
ca-certificates = { path = "../ca-certificates" } | ||
binutils = { path = "../binutils" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: should keep this sorted.
ca-certificates = { path = "../ca-certificates" } | |
binutils = { path = "../binutils" } | |
binutils = { path = "../binutils" } | |
ca-certificates = { path = "../ca-certificates" } |
RefuseManualStart=true | ||
RefuseManualStop=true | ||
After=link-kernel-modules.service | ||
Wants=link-kernel-modules.service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could strengthen this dependency -
Wants=link-kernel-modules.service | |
Requires=link-kernel-modules.service |
sources/driverdog/src/main.rs
Outdated
// If the target module set was given, link the kernel modules in it | ||
if let Some(target) = target { | ||
let driver_config = modules_sets | ||
.get(&target) | ||
.context(error::MissingModuleSet { target })?; | ||
link_modules(&driver_config, &kernel_version)? | ||
} | ||
|
||
// Link all the modules sets if no target module was given | ||
for driver_config in modules_sets.values() { | ||
link_modules(&driver_config, &kernel_version)?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we always link all module sets, even if we pass the option for a specific set. The load modules function has the same issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, missing else
block? (Edit: Resolved)
sources/driverdog/src/main.rs
Outdated
// If the target module set was given, link the kernel modules in it | ||
if let Some(target) = target { | ||
let driver_config = modules_sets | ||
.get(&target) | ||
.context(error::MissingModuleSet { target })?; | ||
link_modules(&driver_config, &kernel_version)? | ||
} | ||
|
||
// Link all the modules sets if no target module was given | ||
for driver_config in modules_sets.values() { | ||
link_modules(&driver_config, &kernel_version)?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, missing else
block? (Edit: Resolved)
Binutils provides the ld linker, required to link proprietary kernel modules at runtime. Signed-off-by: Arnaldo Garcia Rincon <agarrcia@amazon.com>
Forced push includes rebase to resolve conflicts |
driverdog is a tool to link kernel modules at runtime, given a configuration. The configuration must be provided per driver vendor, and it is created at runtime by the tmpfilesd daemon, using a file from the %{_cross_factorydir} directory. Signed-off-by: Arnaldo Garcia Rincon <agarrcia@amazon.com>
67cd1e9
to
cf7b439
Compare
Forced push includes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌺
Issue number:
N / A
Description of changes:
Related to #1799 , that PR is quite big. I'm taking some of the commits in that PR as their individual PR.
We can't ship kernel modules linked against GPL code (i. e. proprietary kernel modules), doing so violates the GPL license under which the kernel is released. Instead, Bottlerocket images with proprietary kernel modules will link and load the kernel modules at runtime using
driverdog
.binutils
is built as part of therelease
package, but it isn't included in any variant. Instead, packages that depend on it will include it in their spec file, as follows:Testing done:
In the new variant created in #1799:
Shipped a drivers configuration file that looks as follows, along with required objects in the OS image:
Validated the kernel modules were linked and loaded:
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.