From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.80.146.139 with SMTP id k11mr2390571eda.4.1518362723109; Sun, 11 Feb 2018 07:25:23 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.80.170.50 with SMTP id o47ls5406729edc.3.gmail; Sun, 11 Feb 2018 07:25:22 -0800 (PST) X-Google-Smtp-Source: AH8x224gmz2fXzlGatLGstnGneVJcSVln0abG2V2ae/f7u9xNd2f9+M7XFI/wj97H92TC1kOZgcH X-Received: by 10.80.171.15 with SMTP id s15mr2394933edc.6.1518362722545; 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=Wdpv3UaOkJH3gVD5vifR6a9TZ9bklVVRUaPhYzmkx26NF0WKFWQVMzXOrX/m6pFQug H6eH+IGeSaCt12A/BujEDQ7LNrOAh1BlflQDSw5k4gvSex9DczVtTIpoBXCRTCX5NcoU u+ohpie6ALyJiw2kQfJi62K2+9kD++m2+OVPMy1zraQDdTuMclfDm+nPIZS1LnGdfPLv HwIyllYS3GiZqyX/JnfmW/Zx1GOL/Wdt6grIKyGi0tnXKanlOt3njkWk0Lo3dbifBeX8 uXXZ1pqJN9DQ5WtYv2MlC+Oeq99BUMZRjZ/irwu6WXe+GVjozUk1hcxwm/pfnlenjikA HTfw== 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=gGlQZ5CPFuP0i4hhas20EEAnC6iK9/of5JL/zDEbfzI=; b=Y1Qrbaj3Im2f30GB4ZJVvY/MCEkqnDaGvxxcUnZ2iHyUyYbe5rmfBpBwJML5RvkSUC VU6IXbOqcgKsPgm+aC4JTW5eugnEuDQxxNxQ8gpQ9jl4QQbnKS7HdMRK9eacOWwsNrA2 BWWJMlBAT5GRHvFKtMk/5zDU9Ez5P6H8rCwPb56xPbIunw2uqE2VcbF75zVS9/q5D5Hn QUtArhgYI5ko5lICBNr3iBpceFXl36Tq5ondR1CQnx2y2tFpw7Zz6xowaFLFPO1Tpobg 4P1UnYyZAeQCHEaBi99Q1uPvXfoSIpN7IoqR0usSDzp28JaORtOW1YCqZFHYZ5T9Pn76 XEew== 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 g45si373252eda.0.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.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 w1BFPLdT022655 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 11 Feb 2018 16:25:21 +0100 Received: from md1f2u6c.ww002.siemens.net ([167.87.32.7]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w1BFPKhF024517 for ; Sun, 11 Feb 2018 16:25:21 +0100 From: Jan Kiszka To: isar-users Subject: [PATCH v4 7/8] Provide include file for easy custom module builds Date: Sun, 11 Feb 2018 16:25:18 +0100 Message-Id: X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-TUID: oNqTwGoVJXp7 From: Jan Kiszka This provides an include for custom kernel modules. We choose an include over a class as we carry a couple of files to debianize the module. 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