From a82df9187d6e10bb05964042be6ab6c2fc42fe6f Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Wed, 9 Feb 2022 17:46:09 +0000 Subject: [PATCH] arm/ffa-debugfs-mod: remove kernel image runtime dependency CS1K wants to put the ffa-debugfs kernel module into the initramfs, but this pulls in the kernel image too because kernel modules depend on the kernel image (via kernel-module-split.bbclass). Arguably this should be controllable somehow, as it's not mandatory to have an image on the same file system as the modules: initramfs or separate /boot partitions being notable cases. Until this is resolved upstream[1] we can work around it by removing the RDEPENDS on the kernel from the kernel module. As the package is generated during do_package this can't be a simple RDEPENDS:remove, but has to be another package split function which runs after the module splitting function. [1] https://lore.kernel.org/openembedded-core/20220209173036.3823144-1-ross.burton@arm.com/T/#t Signed-off-by: Ross Burton Signed-off-by: Jon Mason --- .../ffa-debugfs/ffa-debugfs-mod_2.1.0.bb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meta-arm/recipes-kernel/ffa-debugfs/ffa-debugfs-mod_2.1.0.bb b/meta-arm/recipes-kernel/ffa-debugfs/ffa-debugfs-mod_2.1.0.bb index 4fedad1c..03ce0135 100644 --- a/meta-arm/recipes-kernel/ffa-debugfs/ffa-debugfs-mod_2.1.0.bb +++ b/meta-arm/recipes-kernel/ffa-debugfs/ffa-debugfs-mod_2.1.0.bb @@ -27,3 +27,13 @@ do_install:append() { } COMPATIBLE_HOST = "(arm|aarch64).*-linux" + +# Kernel modules currently RDEPEND on the kernel, which is troublesome when you want to put a +# kernel module into a initramfs without pulling the kernel into the initramfs, which would be +# silly. Until this is a recommends the easiest way to handle this is to remove the dependency +# in this recipe. +PACKAGESPLITFUNCS:append = " remove_kernel_dependency" +python remove_kernel_dependency() { + key = "RDEPENDS:kernel-module-arm-ffa-user-" + d.getVar("KERNEL_VERSION") + d.delVar(key) +}