From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.80.243.144 with SMTP id g16mr2387939edm.11.1518362723110; Sun, 11 Feb 2018 07:25:23 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.80.170.50 with SMTP id o47ls5406726edc.3.gmail; Sun, 11 Feb 2018 07:25:22 -0800 (PST) X-Google-Smtp-Source: AH8x225HknHMJZCnX9ZV6xG5gQiRRy4zGLxWRJJDS3pH+WdbQI99OKKMXoWvvYKjwXqTwjhvjcIs X-Received: by 10.80.201.74 with SMTP id p10mr2389518edh.7.1518362722360; Sun, 11 Feb 2018 07:25:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518362722; cv=none; d=google.com; s=arc-20160816; b=O/2cVopXeZrpx12VRF2Ir407P4sT6M3EDFI58v8J25AOS7WO+ihiiasPVN0t5Fug03 gHD6qnFVOa/kVUVugJBt7Bu3MXoBhhZ+FxIpzOtmnwcPT7qaDpRJJmHTX+SH1yI3ZBVs N2X5HZFRKImmXMKT2ADFveBwnYd2dsCP/zbbdQo+jbYjKca97wyBBGQ3VYoTH6k07z5X 67dt/Y7bNXjJ46zufWu+Pc4kiocfNppFLSxUsheGMhIp3mK6ZX+UtSdcGx3ez0f/T3rz IRqYJQ7JirCGN4PDmAA5GZ+E6VnRkuXKmL8ej486z1ckzm2PJoW8s9SMNIu54xJNG18+ RpEg== 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=Fne9UGFCJaAZQsgP6NElCKosuBWCDfxjMrOpaY6ecXs=; b=CIcZhfOIGkelb0otRYEKkOWEV7pegyb3n3bAbx9LNw4s6dNyNnrFnOXTB6nh4dQWE8 ySSKNkefFdZK4ynqww2Cc1ivEVLRWZGj/hsYm/eRAcVAlZukyHMyL2RktVMuD7WZihdn nMIwsYHjzbNeAt/vIkPlq9rNuOKxfpJvkoiz2II3YFMWWTEzj5RAJncRvpDg+wfcAIy4 m6D3uMsIdmb4ZDazxzxmuN4X/CkmOwrlnOtdYTtujWTW27w/Nxnqsb512Hrj14dHsP6b XTZYU4kmhl58zlgUXroRcDAXyLdDg9kbK/Ubf/DpbMn/s+GYMdwCcmGlHWa5F/T+7LRL C5OQ== 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 n22si277651edb.5.2018.02.11.07.25.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 07:25:22 -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 w1BFPLUB010654 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 11 Feb 2018 16:25:22 +0100 Received: from md1f2u6c.ww002.siemens.net ([167.87.32.7]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w1BFPKhG024517 for ; Sun, 11 Feb 2018 16:25:21 +0100 From: Jan Kiszka To: isar-users Subject: [PATCH v4 8/8] Add exemplary kernel module Date: Sun, 11 Feb 2018 16:25:19 +0100 Message-Id: <6113538c63d609e2b206ab5a97ef3417cc764656.1518362719.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-TUID: ql8v0dOhtLLs 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 | 12 ++++++++++++ .../recipes-kernel/example-module/files/src/Makefile | 18 ++++++++++++++++++ .../example-module/files/src/example-module.c | 19 +++++++++++++++++++ 4 files changed, 50 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..c7042cf --- /dev/null +++ b/meta-isar/recipes-kernel/example-module/example-module.bb @@ -0,0 +1,12 @@ +# Example recipe for building a custom module +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2018 +# +# SPDX-License-Identifier: MIT + +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..1625b28 --- /dev/null +++ b/meta-isar/recipes-kernel/example-module/files/src/Makefile @@ -0,0 +1,18 @@ +# Example module +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2018 +# +# SPDX-License-Identifier: GPL-2.0 + +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..07cb214 --- /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 + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#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