new file mode 100644
@@ -0,0 +1,14 @@
+obj-m := hello.o
+
+SRC := $(shell pwd)
+
+all:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
+
+modules_install:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
+
+clean:
+ rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
+ rm -f Module.markers Module.symvers modules.order
+ rm -rf .tmp_versions Modules.symvers
new file mode 100644
@@ -0,0 +1,24 @@
+/******************************************************************************
+ *
+ * Copyright (C) 2011 Intel Corporation. All rights reserved.
+ *
+ * SPDX-License-Identifier: GPL-2.0-only
+ *
+ *****************************************************************************/
+
+#include <linux/module.h>
+
+static int __init hello_init(void)
+{
+ pr_info("Hello World!\n");
+ return 0;
+}
+
+static void __exit hello_exit(void)
+{
+ pr_info("Goodbye Cruel World!\n");
+}
+
+module_init(hello_init);
+module_exit(hello_exit);
+MODULE_LICENSE("GPL");
new file mode 100644
@@ -0,0 +1,17 @@
+SUMMARY = "Example of how to build an external Linux kernel module -- selftest variant"
+DESCRIPTION = "${SUMMARY}"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
+
+inherit module
+
+SRC_URI = "file://Makefile \
+ file://hello.c \
+ "
+
+S = "${UNPACKDIR}"
+
+# The inherit of module.bbclass will automatically name module packages with
+# "kernel-module-" prefix as required by the oe-core build environment.
+
+RPROVIDES:${PN} += "kernel-module-hello"
Kernel module specific oe test cases requires a test kernel module package to work with. Added selftest-hello-mod derived from meta-skeleton/recipes-kernel/hello-mod. Signed-off-by: Dixit Parmar <dixitparmar19@gmail.com> --- Previous patch version: https://lists.openembedded.org/g/openembedded-core/topic/113550149 --- .../selftest-hello-mod/files/Makefile | 14 +++++++++++ .../selftest-hello-mod/files/hello.c | 24 +++++++++++++++++++ .../selftest-hello-mod/hello-mod_0.1.bb | 17 +++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 meta-selftest/recipes-test/selftest-hello-mod/files/Makefile create mode 100644 meta-selftest/recipes-test/selftest-hello-mod/files/hello.c create mode 100644 meta-selftest/recipes-test/selftest-hello-mod/hello-mod_0.1.bb