From patchwork Wed Feb 9 17:30:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 3458 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7286C433F5 for ; Wed, 9 Feb 2022 17:30:46 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.29732.1644427845846956676 for ; Wed, 09 Feb 2022 09:30:46 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 23C65ED1; Wed, 9 Feb 2022 09:30:45 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8F5633F73B; Wed, 9 Feb 2022 09:30:44 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: bruce.ashfield@gmail.com Subject: [PATCH 1/2] package: add extra_recommends to do_split_package() Date: Wed, 9 Feb 2022 17:30:35 +0000 Message-Id: <20220209173036.3823144-1-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Feb 2022 17:30:46 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/161575 It may be preferrable to add RRECOMMENDS instead of RDEPENDS to each of the split packages, so add extra_recommends to do this. Signed-off-by: Ross Burton --- meta/classes/package.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index f4a661ba25a..2143abca0d1 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -79,7 +79,7 @@ def legitimize_package_name(s): # Remaining package name validity fixes return s.lower().replace('_', '-').replace('@', '+').replace(',', '+').replace('/', '-') -def do_split_packages(d, root, file_regex, output_pattern, description, postinst=None, recursive=False, hook=None, extra_depends=None, aux_files_pattern=None, postrm=None, allow_dirs=False, prepend=False, match_path=False, aux_files_pattern_verbatim=None, allow_links=False, summary=None): +def do_split_packages(d, root, file_regex, output_pattern, description, postinst=None, recursive=False, hook=None, extra_depends=None, extra_recommends=None, aux_files_pattern=None, postrm=None, allow_dirs=False, prepend=False, match_path=False, aux_files_pattern_verbatim=None, allow_links=False, summary=None): """ Used in .bb files to split up dynamically generated subpackages of a given package, usually plugins or modules. @@ -108,6 +108,8 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst all packages. The default value of None causes a dependency on the main package (${PN}) - if you do not want this, pass '' for this parameter. + extra_recommends -- extra runtime recommends (RRECOMMENDS) to be set for + all packages. By default no recommends are added. aux_files_pattern -- extra item(s) to be added to FILES for each package. Can be a single string item or a list of strings for multiple items. Must include %s. @@ -222,6 +224,8 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst d.setVar('FILES:' + pkg, oldfiles + " " + newfile) if extra_depends != '': d.appendVar('RDEPENDS:' + pkg, ' ' + extra_depends) + if extra_recommends: + d.appendVar('RRECOMMENDS:' + pkg, ' ' + extra_recommends) if not d.getVar('DESCRIPTION:' + pkg): d.setVar('DESCRIPTION:' + pkg, description % on) if not d.getVar('SUMMARY:' + pkg): From patchwork Wed Feb 9 17:30:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 3459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD6CCC433EF for ; Wed, 9 Feb 2022 17:30:47 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.29733.1644427846282682854 for ; Wed, 09 Feb 2022 09:30:46 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E96FA113E; Wed, 9 Feb 2022 09:30:45 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 649243F73B; Wed, 9 Feb 2022 09:30:45 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: bruce.ashfield@gmail.com Subject: [PATCH 2/2] kernel-module-split: modules should recommend the kernel image Date: Wed, 9 Feb 2022 17:30:36 +0000 Message-Id: <20220209173036.3823144-2-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220209173036.3823144-1-ross.burton@arm.com> References: <20220209173036.3823144-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Feb 2022 17:30:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/161576 Currently each split-out kernel module RDEPENDS on the top-level kernel package (e.g. kernel-5.15-yocto-standard). Whilst at first this seems correct, as modules obviously need their matching kernel, there are many situations where the kernel is provided out-of-band and forcing the kernel in via RDEPENDS in the wrong thing to do, for example an initramfs really shouldn't contain a kernel image, but can contain kernel modules. Change the module splitting logic to use RRECOMMENDS instead of RDEPENDS, and tighten the dependency to kernel-image instead of kernel to pull in just the image, which also means PACKAGE_EXCLUDE = "kernel-image-*" is sufficient to ensure the image doesn't get pulled into an image. Signed-off-by: Ross Burton --- meta/classes/kernel-module-split.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass index a29c294810e..4429fee4b51 100644 --- a/meta/classes/kernel-module-split.bbclass +++ b/meta/classes/kernel-module-split.bbclass @@ -175,7 +175,7 @@ python split_kernel_module_packages () { module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX') module_pattern = module_pattern_prefix + kernel_package_name + '-module-%s' + module_pattern_suffix - 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)) + 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_recommends='%s-image-%s' % (kernel_package_name, kernel_version)) if modules: d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules))