Skip to content

Commit 7900d19

Browse files
TELCODOCS-1067: First draft
1 parent e3a6441 commit 7900d19

5 files changed

+111
-0
lines changed

hardware_enablement/kmm-kernel-module-management.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,17 @@ include::modules/kmm-building-and-signing-a-moduleloader-container-image.adoc[le
6666
For information on creating a service account, see xref:https://docs.openshift.com/container-platform/4.12/authentication/understanding-and-creating-service-accounts.html#service-accounts-managing_understanding-service-accounts[Creating service accounts].
6767

6868
include::modules/kmm-debugging-and-troubleshooting.adoc[leveloffset=+1]
69+
70+
// Added for TELCODOCS-1067
71+
include::modules/kmm-firmware-support.adoc[leveloffset=+1]
72+
[role="_additional-resources"]
73+
.Additional resources
74+
* xref:../hardware_enablement/kmm-kernel-module-management.adoc#kmm-creating-moduleloader-image_kernel-module-management-operator[Creating a ModuleLoader image].
75+
76+
include::modules/kmm-configuring-the-lookup-path-on-nodes.adoc[leveloffset=+2]
77+
[role="_additional-resources"]
78+
.Additional resources
79+
* xref:../post_installation_configuration/machine-configuration-tasks.adoc#understanding-the-machine-config-operator[Machine Config Operator].
80+
81+
include::modules/kmm-building-a-moduleloader-image.adoc[leveloffset=+2]
82+
include::modules/kmm-tuning-the-module-resource.adoc[leveloffset=+2]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hardware_enablement/kmm-kernel-module-management.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="kmm-building-a-moduleloader-image_{context}"]
7+
= Building a ModuleLoader image
8+
9+
.Procedure
10+
11+
* In addition to building the kernel module itself, include the binary firmware in the builder image:
12+
+
13+
[source,dockerfile]
14+
----
15+
FROM registry.redhat.io/ubi8/ubi-minimal as builder
16+
17+
# Build the kmod
18+
19+
RUN ["mkdir", "/firmware"]
20+
RUN ["curl", "-o", "/firmware/firmware.bin", "https://artifacts.example.com/firmware.bin"]
21+
22+
FROM registry.redhat.io/ubi8/ubi-minimal
23+
24+
# Copy the kmod, install modprobe, run depmod
25+
26+
COPY --from=builder /firmware /firmware
27+
----
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hardware_enablement/kmm-kernel-module-management.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="kmm-configuring-the-lookup-path-on-nodes_{context}"]
7+
= Configuring the lookup path on nodes
8+
9+
On {product-title} nodes, the set of default lookup paths for firmwares does not include the `/var/lib/firmware` path.
10+
11+
.Procedure
12+
13+
. Use the Machine Config Operator to create a `MachineConfig` custom resource (CR) that contains the `/var/lib/firmware` path:
14+
+
15+
[source,yaml]
16+
----
17+
apiVersion: machineconfiguration.openshift.io/v1
18+
kind: MachineConfig
19+
metadata:
20+
labels:
21+
machineconfiguration.openshift.io/role: worker <1>
22+
name: 99-worker-kernel-args-firmware-path
23+
spec:
24+
kernelArguments:
25+
- 'firmware_class.path=/var/lib/firmware'
26+
----
27+
<1> You can configure the label based on your needs. In the case of {sno}, use either `control-pane` or `master` objects.
28+
29+
30+
. By applying the `MachineConfig` CR, the nodes are automatically rebooted.

modules/kmm-firmware-support.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hardware_enablement/kmm-kernel-module-management.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="kmm-firmware-support_{context}"]
7+
= KMM firmware support
8+
9+
Kernel modules sometimes need to load firmware files from the file system. KMM supports copying firmware files from the ModuleLoader image to the node's file system.
10+
11+
The contents of `.spec.moduleLoader.container.modprobe.firmwarePath` are copied into the `/var/lib/firmware` path on the node before running the `modprobe` command to insert the kernel module.
12+
13+
All files and empty directories are removed from that location before running the `modprobe -r` command to unload the kernel module, when the pod is terminated.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hardware_enablement/kmm-kernel-module-management.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="kmm-tuning-the-module-resource_{context}"]
7+
= Tuning the Module resource
8+
9+
.Procedure
10+
11+
* Set `.spec.moduleLoader.container.modprobe.firmwarePath` in the `Module` custom resource (CR):
12+
+
13+
[source,yaml]
14+
----
15+
apiVersion: kmm.sigs.x-k8s.io/v1beta1
16+
kind: Module
17+
metadata:
18+
name: my-kmod
19+
spec:
20+
moduleLoader:
21+
container:
22+
modprobe:
23+
moduleName: my-kmod # Required
24+
25+
firmwarePath: /firmware <1>
26+
----
27+
<1> Optional: Copies `/firmware/*` into `/var/lib/firmware/` on the node.

0 commit comments

Comments
 (0)