Skip to content

Commit

Permalink
including kernel module example
Browse files Browse the repository at this point in the history
  • Loading branch information
amamory committed Dec 24, 2021
1 parent 4503ac6 commit 93a6443
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
2 changes: 2 additions & 0 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ IMAGE_INSTALL_append = " hellodep"
IMAGE_INSTALL_append = " hellogit"
IMAGE_INSTALL_append = " hellogitcmake"

# my kernel recipes
MACHINE_EXTRA_RDEPENDS += "kernel-module-hello"
13 changes: 10 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -759,13 +759,20 @@ Check out more information on these links:
- https://george-calin.medium.com/how-to-prepare-a-helloworld-c-recipe-with-yocto-project-1f74c296a777
- https://tutorialadda.com/yocto/create-your-own-linux-image-for-the-raspberry-pi-board-using-yocto-project

## To Learn More

- [Yocto Project Mega-Manual (v3.1 dunfell)](https://www.yoctoproject.org/docs/3.1/mega-manual/mega-manual.html)
- [Books about Yocto](https://www.yoctoproject.org/learn/books/)
- https://git.yoctoproject.org/poky/tree/meta-skeleton

## TO DO

- add *kernel module*:
- [x] add *kernel module*:
- [example1](https://stackoverflow.com/questions/36188472/yocto-adding-kernel-module-recipe-to-image-but-it-doesnt-load-on-boot); and
- [example2](https://developer.toradex.com/knowledge-base/custom-meta-layers-recipes-images-in-yocto-project#Compile_a_Custom_Kernel_Module);
- make a [cmake module](https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/How-To-Find-Libraries) for `libhello`;
- how to deploy `libhello-dev` into the image ? this would include the library headers.
- [ ] add a [linux service](https://git.yoctoproject.org/poky/tree/meta-skeleton/recipes-skeleton/service);
- [ ] make a [cmake module](https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/How-To-Find-Libraries) for `libhello`;
- [ ] how to deploy `libhello-dev` into the image ? this would include the library headers.

## Contributions

Expand Down
20 changes: 20 additions & 0 deletions recipes-kernel/hello-mod/hello-mod_1.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# source: https://developer.toradex.com/knowledge-base/custom-meta-layers-recipes-images-in-yocto-project#Compile_a_Custom_Kernel_Module

SUMMARY = "Example of how to build an external Linux kernel module"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

# required for modules
inherit module

SRCREV = "4f082b755fdf2ef8da30adf2dfbca6fc0745cd2f"
SRC_URI = " \
git://github.com/toradex/hello-mod.git;branch=main;protocol=https \
"

PV = "1.0+git${SRCPV}"

S = "${WORKDIR}/git"

RPROVIDES_${PN} += "kernel-module-hello"

0 comments on commit 93a6443

Please sign in to comment.