diff options
author | Zoltán Böszörményi <zboszor@gmail.com> | 2021-08-23 16:54:49 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-27 11:54:34 +0100 |
commit | 7768da3fe88619eefce38ab8f785fd95a544a794 (patch) | |
tree | a8052afab749860935fed2da0448b1bf39ed3ea5 /meta | |
parent | e6fae346ea93a2cbb52bb2be01013aabae1215cd (diff) | |
download | poky-7768da3fe88619eefce38ab8f785fd95a544a794.tar.gz |
kernel.bbclass: Use full versions for inter-package dependencies
If the kernel configuration enables module signing but no key
is provided, then the kernel generates one during the kernel build.
The current runtime-dependency references (with only package names
without full versions) allow mixed package installations from different
rebuilds of the same kernel version.
This creates an issue because then the modules either don't work
or taint the kernel.
Tighten RDEPENDS with the full package version, i.e. use (= ${EXTENDPKGV})
markers for inter-package dependencies.
The kernel will pull in the kernel-modules subpackage of the same
exact version automatically if KERNEL_SPLIT_MODULES="0" is set.
Otherwise the situation is the same as with the old default with
one subpackage per kernel module where they have to be upgraded
manually.
(From OE-Core rev: 56428d15803733e14d6f1faf5f77eb933ef966f3)
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')
-rw-r--r-- | meta/classes/kernel.bbclass | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 6dc5387a9b..9ec7daa17a 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
@@ -91,17 +91,18 @@ python __anonymous () { | |||
91 | kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel" | 91 | kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel" |
92 | imagedest = d.getVar('KERNEL_IMAGEDEST') | 92 | imagedest = d.getVar('KERNEL_IMAGEDEST') |
93 | 93 | ||
94 | fullver = d.getVar('EXTENDPKGV') | ||
94 | for type in types.split(): | 95 | for type in types.split(): |
95 | if bb.data.inherits_class('nopackages', d): | 96 | if bb.data.inherits_class('nopackages', d): |
96 | continue | 97 | continue |
97 | typelower = type.lower() | 98 | typelower = type.lower() |
98 | d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower)) | 99 | d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower)) |
99 | d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type) | 100 | d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type) |
100 | d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, typelower)) | 101 | d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s (= %s)' % (kname, typelower, fullver)) |
101 | splitmods = d.getVar("KERNEL_SPLIT_MODULES") | 102 | splitmods = d.getVar("KERNEL_SPLIT_MODULES") |
102 | if splitmods != '1': | 103 | if splitmods != '1': |
103 | d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % kname) | 104 | d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules (= %s)' % (kname, fullver)) |
104 | d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' %s-modules-${KERNEL_VERSION_PKG_NAME}' % kname) | 105 | d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' %s-modules-${KERNEL_VERSION_PKG_NAME} (= %s)' % (kname, fullver)) |
105 | d.setVar('PKG:%s-modules' % kname, '%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname) | 106 | d.setVar('PKG:%s-modules' % kname, '%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname) |
106 | d.appendVar('RPROVIDES:%s-modules' % kname, '%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname) | 107 | d.appendVar('RPROVIDES:%s-modules' % kname, '%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname) |
107 | 108 | ||
@@ -628,12 +629,12 @@ FILES:${KERNEL_PACKAGE_NAME}-image = "" | |||
628 | FILES:${KERNEL_PACKAGE_NAME}-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build" | 629 | FILES:${KERNEL_PACKAGE_NAME}-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build" |
629 | FILES:${KERNEL_PACKAGE_NAME}-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}" | 630 | FILES:${KERNEL_PACKAGE_NAME}-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}" |
630 | FILES:${KERNEL_PACKAGE_NAME}-modules = "" | 631 | FILES:${KERNEL_PACKAGE_NAME}-modules = "" |
631 | RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base" | 632 | RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base (= ${EXTENDPKGV})" |
632 | # Allow machines to override this dependency if kernel image files are | 633 | # Allow machines to override this dependency if kernel image files are |
633 | # not wanted in images as standard | 634 | # not wanted in images as standard |
634 | RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image" | 635 | RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image (= ${EXTENDPKGV})" |
635 | PKG:${KERNEL_PACKAGE_NAME}-image = "${KERNEL_PACKAGE_NAME}-image-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}" | 636 | PKG:${KERNEL_PACKAGE_NAME}-image = "${KERNEL_PACKAGE_NAME}-image-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}" |
636 | RDEPENDS:${KERNEL_PACKAGE_NAME}-image += "${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', '${KERNEL_PACKAGE_NAME}-vmlinux', '', d)}" | 637 | RDEPENDS:${KERNEL_PACKAGE_NAME}-image += "${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', '${KERNEL_PACKAGE_NAME}-vmlinux (= ${EXTENDPKGV})', '', d)}" |
637 | PKG:${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}" | 638 | PKG:${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}" |
638 | RPROVIDES:${KERNEL_PACKAGE_NAME}-base += "${KERNEL_PACKAGE_NAME}-${KERNEL_VERSION}" | 639 | RPROVIDES:${KERNEL_PACKAGE_NAME}-base += "${KERNEL_PACKAGE_NAME}-${KERNEL_VERSION}" |
639 | ALLOW_EMPTY:${KERNEL_PACKAGE_NAME} = "1" | 640 | ALLOW_EMPTY:${KERNEL_PACKAGE_NAME} = "1" |