From c61c3dee162aa1f5bf31b2a09d8b916dc1712056 Mon Sep 17 00:00:00 2001 From: Stefan Stanacar Date: Fri, 18 Oct 2013 10:23:44 +0300 Subject: 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 Signed-off-by: Richard Purdie --- meta/lib/oeqa/runtime/files/hellomod.c | 19 +++++++++++++++++++ meta/lib/oeqa/runtime/files/hellomod_makefile | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 meta/lib/oeqa/runtime/files/hellomod.c create mode 100644 meta/lib/oeqa/runtime/files/hellomod_makefile (limited to 'meta/lib/oeqa/runtime/files') 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 +#include +#include + +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 -- cgit v1.2.3