summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/files
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2013-10-18 10:23:44 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-18 15:51:00 +0100
commitc61c3dee162aa1f5bf31b2a09d8b916dc1712056 (patch)
tree7c2d4e6fe517d5283b505c8bfb1292c7055797b8 /meta/lib/oeqa/runtime/files
parentce6c3ec0e5f4822e85b8f957e9e31fa9de438c55 (diff)
downloadopenembedded-core-contrib-c61c3dee162aa1f5bf31b2a09d8b916dc1712056.tar.gz
lib/oeqa/runtime: build kernel module on target test
Builds a simple Hello World module on target. Added to the defaults for core-image-sato-sdk. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime/files')
-rw-r--r--meta/lib/oeqa/runtime/files/hellomod.c19
-rw-r--r--meta/lib/oeqa/runtime/files/hellomod_makefile8
2 files changed, 27 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/files/hellomod.c b/meta/lib/oeqa/runtime/files/hellomod.c
new file mode 100644
index 0000000000..a383397e93
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/hellomod.c
@@ -0,0 +1,19 @@
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+
+static int __init hello_init(void)
+{
+ printk(KERN_INFO "Hello world!\n");
+ return 0;
+}
+
+static void __exit hello_cleanup(void)
+{
+ printk(KERN_INFO "Cleaning up hellomod.\n");
+}
+
+module_init(hello_init);
+module_exit(hello_cleanup);
+
+MODULE_LICENSE("GPL");
diff --git a/meta/lib/oeqa/runtime/files/hellomod_makefile b/meta/lib/oeqa/runtime/files/hellomod_makefile
new file mode 100644
index 0000000000..b92d5c8fe0
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/hellomod_makefile
@@ -0,0 +1,8 @@
+obj-m := hellomod.o
+KDIR := /usr/src/kernel
+
+all:
+ $(MAKE) -C $(KDIR) M=$(PWD) modules
+
+clean:
+ $(MAKE) -C $(KDIR) M=$(PWD) clean