diff options
-rw-r--r-- | meta/classes-recipe/kernel-module-split.bbclass | 13 |
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 | ||
31 | PACKAGE_WRITE_DEPS += "kmod-native depmodwrapper-cross" | 31 | PACKAGE_WRITE_DEPS += "kmod-native depmodwrapper-cross" |
32 | 32 | ||
33 | modulesloaddir ??= "${sysconfdir}/modules-load.d" | ||
34 | modprobedir ??= "${sysconfdir}/modprobe.d" | ||
35 | |||
33 | KERNEL_SPLIT_MODULES ?= "1" | 36 | KERNEL_SPLIT_MODULES ?= "1" |
34 | PACKAGESPLITFUNCS =+ "split_kernel_module_packages" | 37 | PACKAGESPLITFUNCS =+ "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 |