Skip to content

Commit e5144dd

Browse files
Adding api for ordered multiple kernel modules (#380)
Adding list entry under Modprobe spec that defines the sequence of loading multiple independent kernel modules that are stored in the Module image. The entry is a list with the modules that depends on all other modules at the head of the list. Example: if moduleA depends on first loading moduleB, and moduleB depends on first loading moduleC then the list will look: ModulesLoadingOrder: - moduleA - moduleB - moduleC moduleC shoudl be loaded first, then module B, and then module C. moduleA should be set in the ModuleName entry of the ModprobeSpec
1 parent 5369cb8 commit e5144dd

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

api/v1beta1/module_types.go

+13
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,19 @@ type ModprobeSpec struct {
163163
// The firmware(s) will be copied to the host for the kernel to find them.
164164
// +optional
165165
FirmwarePath string `json:"firmwarePath,omitempty"`
166+
167+
// ModulesLoadingOrder defines the dependency between kernel modules loading, in case
168+
// it was not created by depmod (independent kernel modules).
169+
// The list order should be: upmost module, then the module it depends on and so on.
170+
// Example: if moduleA depends on first loading moduleB, and moduleB depends on first loading moduleC
171+
// the entry should look:
172+
// ModulesLoadingOrder:
173+
// - moduleA
174+
// - moduleB
175+
// - moduleC
176+
// In order to load all 3 modules, moduleA shoud be defined in the ModuleName parameter of this struct
177+
// +optional
178+
ModulesLoadingOrder []string `json:"modulesLoadingOrder,omitempty"`
166179
}
167180

168181
type ModuleLoaderContainerSpec struct {

api/v1beta1/zz_generated.deepcopy.go

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd-hub/bases/hub.kmm.sigs.x-k8s.io_managedclustermodules.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -2362,6 +2362,20 @@ spec:
23622362
description: ModuleName is the name of the Module
23632363
to be loaded.
23642364
type: string
2365+
modulesLoadingOrder:
2366+
description: 'ModulesLoadingOrder defines the dependency
2367+
between kernel modules loading, in case it was not
2368+
created by depmod (independent kernel modules).
2369+
The list order should be: upmost module, then the
2370+
module it depends on and so on. Example: if moduleA
2371+
depends on first loading moduleB, and moduleB depends
2372+
on first loading moduleC the entry should look:
2373+
ModulesLoadingOrder: - moduleA - moduleB - moduleC
2374+
In order to load all 3 modules, moduleA shoud be
2375+
defined in the ModuleName parameter of this struct'
2376+
items:
2377+
type: string
2378+
type: array
23652379
parameters:
23662380
description: 'Parameters is an optional list of kernel
23672381
module parameters to be provided to modprobe. They

config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -2263,6 +2263,20 @@ spec:
22632263
description: ModuleName is the name of the Module to be
22642264
loaded.
22652265
type: string
2266+
modulesLoadingOrder:
2267+
description: 'ModulesLoadingOrder defines the dependency
2268+
between kernel modules loading, in case it was not created
2269+
by depmod (independent kernel modules). The list order
2270+
should be: upmost module, then the module it depends
2271+
on and so on. Example: if moduleA depends on first loading
2272+
moduleB, and moduleB depends on first loading moduleC
2273+
the entry should look: ModulesLoadingOrder: - moduleA
2274+
- moduleB - moduleC In order to load all 3 modules,
2275+
moduleA shoud be defined in the ModuleName parameter
2276+
of this struct'
2277+
items:
2278+
type: string
2279+
type: array
22662280
parameters:
22672281
description: 'Parameters is an optional list of kernel
22682282
module parameters to be provided to modprobe. They should

0 commit comments

Comments
 (0)