From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.46.51.4 with SMTP id d4mr263241ljc.36.1518599600176; Wed, 14 Feb 2018 01:13:20 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.25.210.77 with SMTP id j74ls556224lfg.4.gmail; Wed, 14 Feb 2018 01:13:19 -0800 (PST) X-Google-Smtp-Source: AH8x224Vev7urN1WyNB95VnViCS3g/Xs/RNUP2g7q5357YOx2gcgxICCnBqQhK/ERu7h/Owzm0lt X-Received: by 10.25.0.140 with SMTP id 134mr309070lfa.9.1518599599383; Wed, 14 Feb 2018 01:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518599599; cv=none; d=google.com; s=arc-20160816; b=SKyj6M64Rohv4p+shd66uCiKNkyd9WQRCqH7wkcSNxYnJwP3dcYB15wCJBY0m61pFR uwWloxA3B+scDPoqlwH/imDM2mTqimzKqxKZj2AwwapY8L1vkNiTCTRu5phQDq5jXrkw fh73/WpJG20pV68ltWjT5DqZNw8G2urZ7JX0Iev2MCkpUwWtpUWk8CyWPDExHuHWgDVE cbpmfQSd1YadiwYhmyZ+ODPvE03yj6lcsi8KDE6/xZFKCTlEesDl13dQ1/R2+SqgatpK EYYfgdq6fCgeQ3YeqyctVH4Z2Vz0Kjfn0Pic/hprude2MispGZ2ETa1fE7EgNF4xlR1m Hjvw== 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=GU74eOhAMeeih7rf1OIxuvzGBrlLGPmcIWE24g1DKUtRHxOAqXTJ+e21zeNK4EYwN6 fohIDlcWEWELMRBq03r341s3CtOfOK61JzjX9yleO8QFnqyaLWLyyV97buYMZYx4V070 giB/oH8+f/oA0JFgKOF18Po/FIIGFw4QfVj7SuzkYZBPYmvO2cwr52HqbNT2lVhYGg9s 06zrrs54zFC+qa2ybHbMKzKipIw349E2YtmGAxKeXhgRERHDrqRc89k2/LE+TXZKlOMz sZvWZ3ilSB2b/s2vze47oHldMr0K1/UyCrp8qo7febiOC1k9ixm5MeoNcZMNTToEmHVq SGPg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id l30si665524ljb.3.2018.02.14.01.13.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 01:13:19 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w1E9DIuG025082 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 14 Feb 2018 10:13:18 +0100 Received: from md1f2u6c.ww002.siemens.net ([167.87.36.169]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w1E9DHSd028726 for ; Wed, 14 Feb 2018 10:13:18 +0100 From: Jan Kiszka To: isar-users Subject: [PATCH v5 5/5] Add exemplary kernel module Date: Wed, 14 Feb 2018 10:13:15 +0100 Message-Id: <4e502291374cbbdfd24827ad4f039517d4297e96.1518599595.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-TUID: Dshk06bFTqql 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