Index: recipes-kernel/Hello-mod/files/COPYRIGHT =================================================================== diff -u --- recipes-kernel/Hello-mod/files/COPYRIGHT (revision 0) +++ recipes-kernel/Hello-mod/files/COPYRIGHT (revision e3deb32644d8d9a3cab8d099a91a9f01b854b390) @@ -0,0 +1,16 @@ +SPDX-License-Identifier: GPL-2.0-or-later + +Copyright (C) YEAR OWNER + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . Index: recipes-kernel/Hello-mod/files/Makefile =================================================================== diff -u --- recipes-kernel/Hello-mod/files/Makefile (revision 0) +++ recipes-kernel/Hello-mod/files/Makefile (revision e3deb32644d8d9a3cab8d099a91a9f01b854b390) @@ -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 Index: recipes-kernel/Hello-mod/files/hello.c =================================================================== diff -u --- recipes-kernel/Hello-mod/files/hello.c (revision 0) +++ recipes-kernel/Hello-mod/files/hello.c (revision e3deb32644d8d9a3cab8d099a91a9f01b854b390) @@ -0,0 +1,17 @@ +#include + +static int __init hello_init(void) { + pr_info("Leahi: Hello Word!\n"); + return 0; +} + +static void __exit hello_exit(void) { + pr_info("Leahi: Goodbye Cruel Word!\n"); +} + +module_init(hello_init); +module_exit(hello_exit); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Bruce"); +MODULE_DESCRIPTION("A simple Hello World kernel module"); \ No newline at end of file Index: recipes-kernel/Hello-mod/hello-mod_0.1.bb =================================================================== diff -u --- recipes-kernel/Hello-mod/hello-mod_0.1.bb (revision 0) +++ recipes-kernel/Hello-mod/hello-mod_0.1.bb (revision e3deb32644d8d9a3cab8d099a91a9f01b854b390) @@ -0,0 +1,17 @@ +SUMMARY = "Simple out-of-tree Linux kernel module (hello)" +DESCRIPTION = "${SUMMARY}" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=b3503427bea3419bf0d0ae8f32da8686" + +inherit module + +PV = "0.1" +PR = "r0" + +SRC_URI = "file://hello.c \ + file://Makefile \ + file://COPYRIGHT " + +S = "${WORKDIR}" + +RPROVIDES:${PN} = "kernel-module-hello"