All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zoltan Boszormenyi" <zboszor@pr.hu>
To: openembedded-core@lists.openembedded.org
Cc: zboszor@gmail.com
Subject: [PATCH v4 3/4] kernel.bbclass: Use full versions for inter-package dependencies
Date: Fri, 27 Aug 2021 09:37:11 +0200	[thread overview]
Message-ID: <20210827073712.2766816-4-zboszor@pr.hu> (raw)
In-Reply-To: <20210827073712.2766816-1-zboszor@pr.hu>

From: Zoltán Böszörményi <zboszor@gmail.com>

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.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
 meta/classes/kernel.bbclass | 13 +++++++------
 1 file 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 () {
     kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
     imagedest = d.getVar('KERNEL_IMAGEDEST')
 
+    fullver = d.getVar('EXTENDPKGV')
     for type in types.split():
         if bb.data.inherits_class('nopackages', d):
             continue
         typelower = type.lower()
         d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
         d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
-        d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, typelower))
+        d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s (= %s)' % (kname, typelower, fullver))
         splitmods = d.getVar("KERNEL_SPLIT_MODULES")
         if splitmods != '1':
-            d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % kname)
-            d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' %s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+            d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules (= %s)' % (kname, fullver))
+            d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' %s-modules-${KERNEL_VERSION_PKG_NAME} (= %s)' % (kname, fullver))
             d.setVar('PKG:%s-modules' % kname, '%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
             d.appendVar('RPROVIDES:%s-modules' % kname, '%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
 
@@ -628,12 +629,12 @@ FILES:${KERNEL_PACKAGE_NAME}-image = ""
 FILES:${KERNEL_PACKAGE_NAME}-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
 FILES:${KERNEL_PACKAGE_NAME}-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
 FILES:${KERNEL_PACKAGE_NAME}-modules = ""
-RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base"
+RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base (= ${EXTENDPKGV})"
 # Allow machines to override this dependency if kernel image files are
 # not wanted in images as standard
-RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image"
+RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image (= ${EXTENDPKGV})"
 PKG:${KERNEL_PACKAGE_NAME}-image = "${KERNEL_PACKAGE_NAME}-image-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
-RDEPENDS:${KERNEL_PACKAGE_NAME}-image += "${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', '${KERNEL_PACKAGE_NAME}-vmlinux', '', d)}"
+RDEPENDS:${KERNEL_PACKAGE_NAME}-image += "${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', '${KERNEL_PACKAGE_NAME}-vmlinux (= ${EXTENDPKGV})', '', d)}"
 PKG:${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
 RPROVIDES:${KERNEL_PACKAGE_NAME}-base += "${KERNEL_PACKAGE_NAME}-${KERNEL_VERSION}"
 ALLOW_EMPTY:${KERNEL_PACKAGE_NAME} = "1"
-- 
2.31.1


  parent reply	other threads:[~2021-08-27  7:37 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23 12:23 Kernel and RPM related bbclass changes Zoltan Boszormenyi
2021-08-23 12:23 ` [PATCH 1/6] package_rpm.bbclass: Handle posttrans scriptlets Zoltan Boszormenyi
2021-08-23 12:34   ` [OE-core] " Alexander Kanavin
2021-08-23 13:14     ` Zoltan Boszormenyi
2021-08-23 13:23       ` Richard Purdie
2021-08-23 13:42         ` Zoltan Boszormenyi
2021-08-23 12:23 ` [PATCH 2/6] kernel-module-split.bbclass: Support zstd-compressed modules Zoltan Boszormenyi
2021-08-23 12:23 ` [PATCH 3/6] kernel-module-split.bbclass: Allow opt-out of split kernel modules Zoltan Boszormenyi
2021-08-23 12:55   ` [OE-core] " Bruce Ashfield
2021-08-23 13:18     ` Zoltan Boszormenyi
2021-08-23 13:27       ` Bruce Ashfield
2021-08-23 13:31         ` Zoltan Boszormenyi
2021-08-23 13:35           ` Bruce Ashfield
     [not found]   ` <169DF0BA24F74A88.27647@lists.openembedded.org>
2021-08-23 12:56     ` Bruce Ashfield
2021-08-23 12:23 ` [PATCH 4/6] kernel.bbclass: Adapt to KERNEL_SPLIT_MODULES != "1" case Zoltan Boszormenyi
2021-08-23 12:23 ` [PATCH 5/6] kernel.bbclass: Use full versions for inter-package dependencies Zoltan Boszormenyi
2021-08-23 13:03   ` [OE-core] " Bruce Ashfield
2021-08-23 13:29     ` Zoltan Boszormenyi
2021-08-23 13:38       ` Bruce Ashfield
2021-08-23 13:48         ` Zoltan Boszormenyi
2021-08-23 12:23 ` [PATCH 6/6] Support zstd-compressed squashfs and cpio initramfs Zoltan Boszormenyi
2021-08-23 14:47 ` Kernel related bbclass changes Zoltan Boszormenyi
2021-08-23 14:47   ` [PATCH v2 1/4] kernel-module-split.bbclass: Support zstd-compressed modules Zoltan Boszormenyi
2021-08-23 14:47   ` [PATCH v2 2/4] Allow opt-out of split kernel modules Zoltan Boszormenyi
2021-08-23 14:47   ` [PATCH v2 3/4] kernel.bbclass: Use full versions for inter-package dependencies Zoltan Boszormenyi
2021-08-23 14:47   ` [PATCH v2 4/4] Support zstd-compressed squashfs and cpio initramfs Zoltan Boszormenyi
2021-08-23 14:54   ` Kernel related bbclass changes Zoltan Boszormenyi
2021-08-27  7:37     ` Kernel and image " Zoltan Boszormenyi
2021-08-27  7:37       ` [PATCH v4 1/4] kernel-module-split.bbclass: Support zstd-compressed modules Zoltan Boszormenyi
2021-08-27  7:37       ` [PATCH v4 2/4] Allow opt-out of split kernel modules Zoltan Boszormenyi
2021-08-27  7:37       ` Zoltan Boszormenyi [this message]
2021-08-30  9:30         ` [OE-core] [PATCH v4 3/4] kernel.bbclass: Use full versions for inter-package dependencies Andrey Zhizhikin
2021-08-30 10:06           ` Zoltan Boszormenyi
     [not found]           ` <b75df7be-03d8-e454-60b8-1651fc935ca5@gmail.com>
2021-08-30 10:25             ` Andrey Zhizhikin
2021-08-30 19:51               ` Jon Mason
2021-08-31  4:28                 ` Zoltan Boszormenyi
2021-08-31 13:32                   ` Richard Purdie
2021-08-31 13:54                     ` Andrey Zhizhikin
2021-08-27  7:37       ` [PATCH v4 4/4] Support zstd-compressed squashfs and cpio initramfs Zoltan Boszormenyi
2021-08-23 14:54 ` [PATCH v3 1/4] kernel-module-split.bbclass: Support zstd-compressed modules Zoltan Boszormenyi
2021-08-23 14:54 ` [PATCH v3 2/4] Allow opt-out of split kernel modules Zoltan Boszormenyi
2021-08-23 14:54 ` [PATCH v3 3/4] kernel.bbclass: Use full versions for inter-package dependencies Zoltan Boszormenyi
2021-08-23 14:54 ` [PATCH v3 4/4] Support zstd-compressed squashfs and cpio initramfs Zoltan Boszormenyi
2021-08-26 12:04   ` [OE-core] " Richard Purdie
2021-08-27  7:24     ` Zoltan Boszormenyi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210827073712.2766816-4-zboszor@pr.hu \
    --to=zboszor@pr.hu \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=zboszor@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.