diff options
| author | Zoltán Böszörményi <zboszor@gmail.com> | 2021-08-23 16:54:48 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-27 11:54:33 +0100 |
| commit | e6fae346ea93a2cbb52bb2be01013aabae1215cd (patch) | |
| tree | 8a7ae0e83936be07d000d8cc7d2adb53d2d1b970 /meta/classes/kernel-module-split.bbclass | |
| parent | 2190abe8bbd633b72d8605c7808df634dd33274c (diff) | |
| download | poky-e6fae346ea93a2cbb52bb2be01013aabae1215cd.tar.gz | |
Allow opt-out of split kernel modules
For some use cases, a monolithic kernel-modules package containing
all modules built from the kernel sources may be preferred.
For one, download time is shorter and installation time is faster.
Set KERNEL_SPLIT_MODULES="0" for this in. The default is one subpackage
per module.
Also, adapt kernel.bbclass to KERNEL_SPLIT_MODULES != "1" case
Extra RDEPENDS and other inter-package references are needed in
this case.
(From OE-Core rev: 4b13409d82e9d576e32b978f7a42a143127ab894)
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-module-split.bbclass')
| -rw-r--r-- | meta/classes/kernel-module-split.bbclass | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass index 6c1de4c992..a29c294810 100644 --- a/meta/classes/kernel-module-split.bbclass +++ b/meta/classes/kernel-module-split.bbclass | |||
| @@ -28,6 +28,7 @@ do_install:append() { | |||
| 28 | install -d ${D}${sysconfdir}/modules-load.d/ ${D}${sysconfdir}/modprobe.d/ | 28 | install -d ${D}${sysconfdir}/modules-load.d/ ${D}${sysconfdir}/modprobe.d/ |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | KERNEL_SPLIT_MODULES ?= "1" | ||
| 31 | PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages " | 32 | PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages " |
| 32 | 33 | ||
| 33 | KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or "kernel" }-modules" | 34 | KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or "kernel" }-modules" |
| @@ -156,18 +157,26 @@ python split_kernel_module_packages () { | |||
| 156 | kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel" | 157 | kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel" |
| 157 | kernel_version = d.getVar("KERNEL_VERSION") | 158 | kernel_version = d.getVar("KERNEL_VERSION") |
| 158 | 159 | ||
| 160 | metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE') | ||
| 161 | splitmods = d.getVar('KERNEL_SPLIT_MODULES') | ||
| 162 | postinst = d.getVar('pkg_postinst:modules') | ||
| 163 | postrm = d.getVar('pkg_postrm:modules') | ||
| 164 | |||
| 165 | if splitmods != '1': | ||
| 166 | etcdir = d.getVar('sysconfdir') | ||
| 167 | d.appendVar('FILES:' + metapkg, '%s/modules-load.d/ %s/modprobe.d/ %s/modules/' % (etcdir, etcdir, d.getVar("nonarch_base_libdir"))) | ||
| 168 | d.appendVar('pkg_postinst:%s' % metapkg, postinst) | ||
| 169 | d.prependVar('pkg_postrm:%s' % metapkg, postrm); | ||
| 170 | return | ||
| 171 | |||
| 159 | module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$' | 172 | module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$' |
| 160 | 173 | ||
| 161 | module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX') | 174 | module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX') |
| 162 | module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX') | 175 | module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX') |
| 163 | module_pattern = module_pattern_prefix + kernel_package_name + '-module-%s' + module_pattern_suffix | 176 | module_pattern = module_pattern_prefix + kernel_package_name + '-module-%s' + module_pattern_suffix |
| 164 | 177 | ||
| 165 | postinst = d.getVar('pkg_postinst:modules') | ||
| 166 | postrm = d.getVar('pkg_postrm:modules') | ||
| 167 | |||
| 168 | modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='%s-%s' % (kernel_package_name, kernel_version)) | 178 | modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='%s-%s' % (kernel_package_name, kernel_version)) |
| 169 | if modules: | 179 | if modules: |
| 170 | metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE') | ||
| 171 | d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules)) | 180 | d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules)) |
| 172 | 181 | ||
| 173 | # If modules-load.d and modprobe.d are empty at this point, remove them to | 182 | # If modules-load.d and modprobe.d are empty at this point, remove them to |
