summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/kernel-module-split.bbclass
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2023-06-27 10:16:43 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-28 23:17:13 +0100
commit303421dce02fec67daab0dc86d85e11963d5741f (patch)
tree3946240c7c50c0cd5a825f7674024c179a87a956 /meta/classes-recipe/kernel-module-split.bbclass
parent696982900b068b89f3b5aca63b2e855abb511cdc (diff)
downloadpoky-303421dce02fec67daab0dc86d85e11963d5741f.tar.gz
kernel-module-split: make autoload and probeconf distribution specific
The modules-load.d [1] - Configure kernel modules to load at boot should install their configuration files in /usr/lib/modules-load.d. The modprobe.d [2] - Configuration directory for modprobe should install their configuration files in /lib/modprobe.d [1] https://man7.org/linux/man-pages/man5/modules-load.d.5.html [2] https://man7.org/linux/man-pages/man5/modprobe.d.5.html [YOCTO #12212] https://bugzilla.yoctoproject.org/show_bug.cgi?id=12212 CC: Ola x Nilsson <Ola.x.Nilsson@axis.com> CC: Peter Kjellerstedt <peter.kjellerstedt@axis.com> (From OE-Core rev: 347830e67c5ad72b4da165d644e3add69c20acb8) Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/kernel-module-split.bbclass')
-rw-r--r--meta/classes-recipe/kernel-module-split.bbclass13
1 files changed, 8 insertions, 5 deletions
diff --git a/meta/classes-recipe/kernel-module-split.bbclass b/meta/classes-recipe/kernel-module-split.bbclass
index c59e10adcd..0e4f9a6ec3 100644
--- a/meta/classes-recipe/kernel-module-split.bbclass
+++ b/meta/classes-recipe/kernel-module-split.bbclass
@@ -30,6 +30,9 @@ fi
30 30
31PACKAGE_WRITE_DEPS += "kmod-native depmodwrapper-cross" 31PACKAGE_WRITE_DEPS += "kmod-native depmodwrapper-cross"
32 32
33modulesloaddir ??= "${sysconfdir}/modules-load.d"
34modprobedir ??= "${sysconfdir}/modprobe.d"
35
33KERNEL_SPLIT_MODULES ?= "1" 36KERNEL_SPLIT_MODULES ?= "1"
34PACKAGESPLITFUNCS =+ "split_kernel_module_packages" 37PACKAGESPLITFUNCS =+ "split_kernel_module_packages"
35 38
@@ -88,7 +91,7 @@ python split_kernel_module_packages () {
88 91
89 dvar = d.getVar('PKGD') 92 dvar = d.getVar('PKGD')
90 93
91 # If autoloading is requested, output /etc/modules-load.d/<name>.conf and append 94 # If autoloading is requested, output ${modulesloaddir}/<name>.conf and append
92 # appropriate modprobe commands to the postinst 95 # appropriate modprobe commands to the postinst
93 autoloadlist = (d.getVar("KERNEL_MODULE_AUTOLOAD") or "").split() 96 autoloadlist = (d.getVar("KERNEL_MODULE_AUTOLOAD") or "").split()
94 autoload = d.getVar('module_autoload_%s' % basename) 97 autoload = d.getVar('module_autoload_%s' % basename)
@@ -97,7 +100,7 @@ python split_kernel_module_packages () {
97 if autoload and basename not in autoloadlist: 100 if autoload and basename not in autoloadlist:
98 bb.warn("module_autoload_%s is defined but '%s' isn't included in KERNEL_MODULE_AUTOLOAD, please add it there" % (basename, basename)) 101 bb.warn("module_autoload_%s is defined but '%s' isn't included in KERNEL_MODULE_AUTOLOAD, please add it there" % (basename, basename))
99 if basename in autoloadlist: 102 if basename in autoloadlist:
100 conf = '/etc/modules-load.d/%s.conf' % basename 103 conf = '%s/%s.conf' % (d.getVar('modulesloaddir'), basename)
101 name = '%s%s' % (dvar, conf) 104 name = '%s%s' % (dvar, conf)
102 os.makedirs(os.path.dirname(name), exist_ok=True) 105 os.makedirs(os.path.dirname(name), exist_ok=True)
103 with open(name, 'w') as f: 106 with open(name, 'w') as f:
@@ -119,7 +122,7 @@ python split_kernel_module_packages () {
119 modconflist = (d.getVar("KERNEL_MODULE_PROBECONF") or "").split() 122 modconflist = (d.getVar("KERNEL_MODULE_PROBECONF") or "").split()
120 modconf = d.getVar('module_conf_%s' % basename) 123 modconf = d.getVar('module_conf_%s' % basename)
121 if modconf and basename in modconflist: 124 if modconf and basename in modconflist:
122 conf = '/etc/modprobe.d/%s.conf' % basename 125 conf = '%s/%s.conf' % (d.getVar('modprobedir'), basename)
123 name = '%s%s' % (dvar, conf) 126 name = '%s%s' % (dvar, conf)
124 os.makedirs(os.path.dirname(name), exist_ok=True) 127 os.makedirs(os.path.dirname(name), exist_ok=True)
125 with open(name, 'w') as f: 128 with open(name, 'w') as f:
@@ -165,8 +168,8 @@ python split_kernel_module_packages () {
165 postrm = d.getVar('pkg_postrm:modules') 168 postrm = d.getVar('pkg_postrm:modules')
166 169
167 if splitmods != '1': 170 if splitmods != '1':
168 etcdir = d.getVar('sysconfdir') 171 d.appendVar('FILES:' + metapkg, '%s %s %s/modules' %
169 d.appendVar('FILES:' + metapkg, '%s/modules-load.d/ %s/modprobe.d/ %s/modules/' % (etcdir, etcdir, d.getVar("nonarch_base_libdir"))) 172 (d.getVar('modulesloaddir'), d.getVar('modprobedir'), d.getVar("nonarch_base_libdir")))
170 d.appendVar('pkg_postinst:%s' % metapkg, postinst) 173 d.appendVar('pkg_postinst:%s' % metapkg, postinst)
171 d.prependVar('pkg_postrm:%s' % metapkg, postrm); 174 d.prependVar('pkg_postrm:%s' % metapkg, postrm);
172 return 175 return