From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.223.157.2 with SMTP id k2mr226750wre.2.1518110581242; Thu, 08 Feb 2018 09:23:01 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.29.85 with SMTP id d82ls1133495wmd.12.gmail; Thu, 08 Feb 2018 09:23:00 -0800 (PST) X-Google-Smtp-Source: AH8x2249JPVMgLiW+iDVlNyBybDisZnmytAr4GS8yDrZeEzLNHRAwGfDSUZQM8YnPTG2UhgQh+7E X-Received: by 10.28.190.2 with SMTP id o2mr18766wmf.2.1518110580689; Thu, 08 Feb 2018 09:23:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518110580; cv=none; d=google.com; s=arc-20160816; b=zyAHlvMzmLlzIgc49RQfowYOiKcSvorDvTtuFCK+aR/Dx96JusvBxOrf+1PAv5n1PN 7n6RdtwYiZdAmKZRbm6riSjnDAGZNlaAk20igTvfRUTfcM14MkmlrYZAHP3/ZJzeAzSE 6GIFBuTh/1TpAJN+78AZpv1v1jFvqBVmZvuobwgHz2IwsKXFT6vXJ2DlVx89BR2t/u9j 81oJ0VqpJZhaYdbtcxHsjtt31GGM0BoxgkItnMeKDZ5qYeiq2IZR1qIUrBUaLvgt9Bcn mFWnvGwUY+nAFIEE1l8RaNzJ1egRvzY2nhXlov2RgsoB6/VPOC2ISbeuMtuDMBJmwkXS CqgA== 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=CxzNgHmC6aY9cyFpWkvWGG6LWc9v2LRDRV7xxvEENNA=; b=eKueiLd/jk1Q+9iJ/vhzecBfUJeoAjZ6Z49xpYlKnJ7PfiPRe0GLbyxkbDa3A4JtGF XulajO7Awmwl/pEJ6L2kfrhkllZYUQ0FY7KavHe77RnehKLzdmniTY0NDOlzVgx/j3rf rWN5vQV7n5XdO+9qZpqm9ynpRuheZkdLkAge+Di/dh79RmXZKmfVIRjXGM/MryLhLETM ECFVqrKa4XWxUwkCgmuTLTjdfnsEUMf/w+NVxcsQBI9o1WCCbYgCAj1p+V+nGyt3/tab rdz1W1Xovqf7nFl5KxRj0Nv51fiZVkwCh8qPlhTRI6yEBH0qgEWP3FqLywIB7uS51LkH hwkA== 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 j65si27881wmj.0.2018.02.08.09.23.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 09:23:00 -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 mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w18HN0YS004616 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 8 Feb 2018 18:23:00 +0100 Received: from md1f2u6c.ad001.siemens.net (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id w18HMxfl025766 for ; Thu, 8 Feb 2018 18:23:00 +0100 From: Jan Kiszka To: isar-users Subject: [PATCH v2 7/8] Provide include file for easy custom module builds Date: Thu, 8 Feb 2018 18:22:58 +0100 Message-Id: X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-TUID: bLG8FHp/IB0t From: Jan Kiszka Analogously to linux-custom.inc, this provides an include for custom kernel modules. The user just needs to specify the module SRC_URI, and those sources must be then reside in a separate directory which is - as usual - defined via S. Signed-off-by: Jan Kiszka --- .../linux-module/files/debian/changelog | 5 +++++ .../linux-module/files/debian/compat | 1 + .../linux-module/files/debian/control | 11 ++++++++++ .../recipes-kernel/linux-module/files/debian/rules | 15 ++++++++++++++ meta/recipes-kernel/linux-module/module.inc | 24 ++++++++++++++++++++++ 5 files changed, 56 insertions(+) create mode 100644 meta/recipes-kernel/linux-module/files/debian/changelog create mode 100644 meta/recipes-kernel/linux-module/files/debian/compat create mode 100644 meta/recipes-kernel/linux-module/files/debian/control create mode 100755 meta/recipes-kernel/linux-module/files/debian/rules create mode 100644 meta/recipes-kernel/linux-module/module.inc diff --git a/meta/recipes-kernel/linux-module/files/debian/changelog b/meta/recipes-kernel/linux-module/files/debian/changelog new file mode 100644 index 0000000..c1c3516 --- /dev/null +++ b/meta/recipes-kernel/linux-module/files/debian/changelog @@ -0,0 +1,5 @@ +@PN@ (@PV@) unstable; urgency=low + + * Generated package. + + -- ISAR project Tue, 6 Feb 2018 00:00:00 +0000 diff --git a/meta/recipes-kernel/linux-module/files/debian/compat b/meta/recipes-kernel/linux-module/files/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/meta/recipes-kernel/linux-module/files/debian/compat @@ -0,0 +1 @@ +9 diff --git a/meta/recipes-kernel/linux-module/files/debian/control b/meta/recipes-kernel/linux-module/files/debian/control new file mode 100644 index 0000000..d8fbcaa --- /dev/null +++ b/meta/recipes-kernel/linux-module/files/debian/control @@ -0,0 +1,11 @@ +Source: @PN@ +Section: kernel +Priority: optional +Standards-Version: 3.9.6 +Build-Depends: linux-headers-@KERNEL_ARCH@ +Maintainer: ISAR project + +Package: @PN@ +Architecture: any +Depends: linux-image-@KERNEL_ARCH@ +Description: @DESCRIPTION@ diff --git a/meta/recipes-kernel/linux-module/files/debian/rules b/meta/recipes-kernel/linux-module/files/debian/rules new file mode 100755 index 0000000..4723cd8 --- /dev/null +++ b/meta/recipes-kernel/linux-module/files/debian/rules @@ -0,0 +1,15 @@ +#!/usr/bin/make -f + +# Debian rules for custom kernel module build +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2018 +# +# SPDX-License-Identifier: MIT + +export KDIR=$(shell ls -d /lib/modules/*/build) + +export DEB_BUILD_OPTIONS=parallel=$(shell nproc) + +%: + dh $@ --parallel diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc new file mode 100644 index 0000000..ecac75f --- /dev/null +++ b/meta/recipes-kernel/linux-module/module.inc @@ -0,0 +1,24 @@ +# Custom kernel module recipe include +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2018 +# +# SPDX-License-Identifier: MIT + +FILESPATH =. "${LAYERDIR_core}/recipes-kernel/linux-module/files:" + +DESCRIPTION ?= "Custom kernel module ${PN}" + +DEPENDS = "virtual/kernel" + +inherit dpkg + +SRC_URI = "file://debian/" + +dpkg_runbuild_prepend() { + cp -r ${WORKDIR}/debian ${WORKDIR}/${S}/ + sed -i -e 's/@PN@/${PN}/g' -e 's/@PV@/${PV}/g' \ + -e 's/@KERNEL_ARCH@/${KERNEL_ARCH}/g' \ + -e 's/@DESCRIPTION@/${DESCRIPTION}/g' \ + ${WORKDIR}/${S}/debian/changelog ${WORKDIR}/${S}/debian/control +} -- 2.13.6