From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.46.82.14 with SMTP id g14mr89443ljb.15.1518102344408; Thu, 08 Feb 2018 07:05:44 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.65.133 with SMTP id d5ls480892ljf.11.gmail; Thu, 08 Feb 2018 07:05:43 -0800 (PST) X-Google-Smtp-Source: AH8x225RtboeXyr0lwEFgZciO0GJFpmBv5GiPdpIx0mF3k9lhB+RcqSJi0f93MylRpiDXXnc6aaE X-Received: by 10.46.122.16 with SMTP id v16mr87131ljc.13.1518102343613; Thu, 08 Feb 2018 07:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518102343; cv=none; d=google.com; s=arc-20160816; b=ObQ4juisVmLyat2jYA5wNODxJZ3xz0kNJKF0L6V7DeeLNOjTN7wTfpDAeFSGfXXwWa 2lG4fN9ajHIwVetVySJTWvF3CEJkY4vznej1fJKLinEUx//U0dzjaBw/8cDaK2Q08WcQ i4/gxZyy1qP/Gi/PJzVTX/Miu6X/THTuCWys97msbxYncUCRY1bpIBv9cK+VTRn8iJRE CNoRg6sLLJw7UAJfo/5/t2jAYY3TgTDXG/LT6zebPp9nwdjXELZxtbsIfgvTWrhZbumR rDJ5HbZV81g85KoNKdfnDUWhO0Z0TZSDGIlNV/r6Xgo5kHo7F8aREx2aXaO9VoRxmLug ssZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:to:from:arc-authentication-results; bh=0KtRRIi/aKbyjGWOeuGELEXzc0OcaM1Ttpz82hxXczg=; b=hoBIwj7eUq3y4LWnStgCwdApbsw50vJH4lk1c79PU6tIo3LD6KqOLTaqO5eFMWEtaG MANP73jd6NrQJsuuq1bLkFfnFZstFDd5Keyi7aLoZIQwzDYgGh0QmbPeg8R5a7DM8YPA ODqz4iOg114WI283jQuG+cOsYyO9VENWLMM7tpzSQ/NRWiJkw9hOjN4kWoO5doimT5X+ 8GQC12lwBDsmhnjCLNrUU1NeHHN+W35JDpgA9Hm/OuMt002X196kD/eQiI9EBiS4XJzn uaCbGNLlLl1krrlHa2QtWlOwCdpuL2Q2hrgkHtPokbiX3nl3Pr4pgaN1/PUUdc8Yiq4q U4sQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id m2si10201lfj.2.2018.02.08.07.05.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 07:05:43 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w18F5gHH009758 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 8 Feb 2018 16:05:42 +0100 Received: from md1f2u6c.ad001.siemens.net (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w18F5gaf010454 for ; Thu, 8 Feb 2018 16:05:42 +0100 From: Jan Kiszka To: isar-users Subject: [PATCH 8/8] Add exemplary kernel module Date: Thu, 8 Feb 2018 16:05:41 +0100 Message-Id: <7825082809296659a7422d69a2f3fa41ae58b97e.1518102341.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-TUID: yZbSuH3fBVRG From: Jan Kiszka This demonstrates the usage of the new module.inc via a primitive hello world module. Signed-off-by: Jan Kiszka --- meta-isar/conf/local.conf.sample | 2 +- .../recipes-kernel/example-module/example-module.bb | 5 +++++ .../recipes-kernel/example-module/files/src/Makefile | 11 +++++++++++ .../example-module/files/src/example-module.c | 19 +++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 meta-isar/recipes-kernel/example-module/example-module.bb create mode 100644 meta-isar/recipes-kernel/example-module/files/src/Makefile create mode 100644 meta-isar/recipes-kernel/example-module/files/src/example-module.c diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample index 2ae43e7..92dea46 100644 --- a/meta-isar/conf/local.conf.sample +++ b/meta-isar/conf/local.conf.sample @@ -153,7 +153,7 @@ CONF_VERSION = "1" # # The default list of extra packages to be installed. -IMAGE_INSTALL = "example-hello example-raw" +IMAGE_INSTALL = "example-hello example-raw example-module" # # Default parallel jobs for bitbake: diff --git a/meta-isar/recipes-kernel/example-module/example-module.bb b/meta-isar/recipes-kernel/example-module/example-module.bb new file mode 100644 index 0000000..86dbf18 --- /dev/null +++ b/meta-isar/recipes-kernel/example-module/example-module.bb @@ -0,0 +1,5 @@ +include recipes-kernel/linux-module/module.inc + +SRC_URI += "file://src" + +S = "src" diff --git a/meta-isar/recipes-kernel/example-module/files/src/Makefile b/meta-isar/recipes-kernel/example-module/files/src/Makefile new file mode 100644 index 0000000..59a9703 --- /dev/null +++ b/meta-isar/recipes-kernel/example-module/files/src/Makefile @@ -0,0 +1,11 @@ +obj-m := example-module.o + +INSTALL_MOD_PATH ?= $(DESTDIR) +export INSTALL_MOD_PATH + +modules modules_install clean: + $(MAKE) -C $(KDIR) M=$(PWD) $@ + +install: modules_install + +.PHONY: modules modules_install install clean diff --git a/meta-isar/recipes-kernel/example-module/files/src/example-module.c b/meta-isar/recipes-kernel/example-module/files/src/example-module.c new file mode 100644 index 0000000..2099e16 --- /dev/null +++ b/meta-isar/recipes-kernel/example-module/files/src/example-module.c @@ -0,0 +1,19 @@ +/* + * Example modules + * + * Copyright (c) Siemens AG, 2018 + * + * This work is licensed under the terms of the GNU GPL, version 2. + */ + +#include + +static int __init example_module_init(void) +{ + printk("Just an example\n"); + return -ENOANO; +} + +module_init(example_module_init); + +MODULE_LICENSE("GPL"); -- 2.13.6