forked from kubernetes-sigs/kernel-module-management
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick the firmware implementation (#52)
* Load firmware from the module loader (#17) It is common for kernel module to come with firmware(s). On immutable operating systems like CoreOS, the standard firmware path `/lib/firmware` is read-only. So, we need to let the kernel know where to lookup firmware file(s). This change adds the `FirmwarePath` attribute to the `ModprobeSpec` definition and modify the `MakeLoadCommand` and `MakeUnloadCommand` methods to leverage it. It also adds a `Volume` and a `VolumeMount` to expose the `/var/lib/firmware/<Module.Name>` host directory (created if it doesn't exist) inside the pod. The `/var/lib/firmware` is [the recommended path for firmwares in OpenShift with RHCOS nodes](https://access.redhat.com/documentation/fr-fr/openshift_container_platform/4.10/html-single/post-installation_configuration/index#rhcos-load-firmware-blobs_post-install-machine-configuration-tasks). Putting the firmware in a `Module.Name` subfolder avoids multiple Modules to override each others firmware. It also simplifies the removal of the firmware files. The `MakeLoadCommand` adds a step to copy the `FirmwarePath` to `/var/lib/firmware/<Module.Name>` to the `modprobe` command. The `MakeUnloadCommand` removes the firmware folder previously copied after unloading the module. The commands use `/usr/bin -c` to allow shell control like `&&`. Signed-off-by: Fabien Dupont <[email protected]> Signed-off-by: Fabien Dupont <[email protected]> * Use a strings.Builder in Make{Un,}LoadCommand (#46) This change replaces the many `append` statement with a `strings.Builder` stream to make the string creation more efficient. We also use this change to allow loading the firware even when `Modprobe.Args` is set, as it's not related to how modprobe itself is invoked. Signed-off-by: Fabien Dupont <[email protected]> Signed-off-by: Fabien Dupont <[email protected]> Signed-off-by: Fabien Dupont <[email protected]> Co-authored-by: Fabien Dupont <[email protected]>
- Loading branch information
1 parent
02c6d44
commit 17b7ef7
Showing
4 changed files
with
298 additions
and
103 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.