All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dixit Parmar <dixitparmar19@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Dixit Parmar <dixitparmar19@gmail.com>
Subject: [PATCH v2] meta/meta-selftest: add selftest-hello-mod recipe
Date: Mon,  9 Jun 2025 19:11:18 +0530	[thread overview]
Message-ID: <20250609134119.11666-1-dixitparmar19@gmail.com> (raw)

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>
---
 .../files/hello-mod/Makefile                  | 14 +++++++++++
 .../files/hello-mod/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/hello-mod/Makefile
 create mode 100644 meta-selftest/recipes-test/selftest-hello-mod/files/hello-mod/hello.c
 create mode 100644 meta-selftest/recipes-test/selftest-hello-mod/hello-mod_0.1.bb

diff --git a/meta-selftest/recipes-test/selftest-hello-mod/files/hello-mod/Makefile b/meta-selftest/recipes-test/selftest-hello-mod/files/hello-mod/Makefile
new file mode 100644
index 0000000000..4ded35fbc3
--- /dev/null
+++ b/meta-selftest/recipes-test/selftest-hello-mod/files/hello-mod/Makefile
@@ -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
diff --git a/meta-selftest/recipes-test/selftest-hello-mod/files/hello-mod/hello.c b/meta-selftest/recipes-test/selftest-hello-mod/files/hello-mod/hello.c
new file mode 100644
index 0000000000..4f73455d20
--- /dev/null
+++ b/meta-selftest/recipes-test/selftest-hello-mod/files/hello-mod/hello.c
@@ -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");
diff --git a/meta-selftest/recipes-test/selftest-hello-mod/hello-mod_0.1.bb b/meta-selftest/recipes-test/selftest-hello-mod/hello-mod_0.1.bb
new file mode 100644
index 0000000000..8a98c70703
--- /dev/null
+++ b/meta-selftest/recipes-test/selftest-hello-mod/hello-mod_0.1.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Example of how to build an external Linux kernel module - selftest variant"
+DESCRIPTION = "${SUMMARY}"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit module
+
+SRC_URI = "file://hello-mod/Makefile \
+           file://hello-mod/hello.c \
+          "
+
+S = "${WORKDIR}/hello-mod"
+
+# 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"
-- 
2.43.0



             reply	other threads:[~2025-06-09 13:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 13:41 Dixit Parmar [this message]
2025-06-09 14:54 ` [OE-core] [PATCH v2] meta/meta-selftest: add selftest-hello-mod recipe Gyorgy Sarvari
2025-06-18 12:29   ` Dixit Parmar
2025-06-19  4:45 ` [OE-core] " Mathieu Dubois-Briand
2025-06-19  5:56   ` Dixit Parmar
2025-06-19 11:40     ` [OE-core] " Mathieu Dubois-Briand
2025-06-19 11:56       ` Dixit Parmar
2025-06-21  7:32         ` Dixit Parmar

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=20250609134119.11666-1-dixitparmar19@gmail.com \
    --to=dixitparmar19@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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.