From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.223.169.133 with SMTP id b5mr731773wrd.8.1518680119037; Wed, 14 Feb 2018 23:35:19 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.199.10 with SMTP id x10ls2577119wmf.9.gmail; Wed, 14 Feb 2018 23:35:18 -0800 (PST) X-Google-Smtp-Source: AH8x225wS34pQQlPxSzK11tIn1YOdTaIC2hGjh2ZKDgVIXXfeFDee7AOpS9skvPiry0FdDlfJvUd X-Received: by 10.28.45.201 with SMTP id t192mr795972wmt.26.1518680118438; Wed, 14 Feb 2018 23:35:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518680118; cv=none; d=google.com; s=arc-20160816; b=xrmt3n0J+rAN6gJGoObWIf3hiYkkJ7RExrDuwT85250+Bl7qKKtz4sluwTeDLI+Kfg RAauPVVt30DXnlF0/NFhtb5qoHkrhQoi2S+zQjf7SHG7ySHaWbTFgcem6YZcBXI/JjWi nldcg4pPY2lVhT0yWzuXn0/cvr7p+bcGMhYpky0LN9QgAFSobyeiwuoZfJ/1koJWfCxC USN87J2JOK5FlIc8P/UHxNdJ7Q+TLQotUiCzeEa2OWPbNsnch81ACKeeguhzFwLTyYDK sw2ttylaTQzh3sitNfIqvilMFQFiD1A1s+IudYwrivt5SrS1rHcwIopiY8a+ajCyF1LZ 1jKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=qM2TnituQIh+oOM5yRV5dMOI4kZvZswMfJZaE+xSkWw=; b=CQt/xe5LoIW6I2XspgBsrTjoHEcGrnke88HntvrhgLj5iMNuPW5hPVNbkzDdMgftjD VRFGqkQ6Yr+omf1OE50VSf9gLe5LCu5qBx6/TXQLuL7/EppJSb89na078ol85c4SalYB eMihX15g8dt10gIYrusricbxryykVFsLdYCSip+GNpgwAOT59fyhI/OqaJ1MHhVl/+N6 hrdyZWmMP9Fi2h8sF2ckEC+jiZ5W5b6ZY1lcZnBt8UB9osaATCi4P/of3ZYzv8shXNGO tfYWs3u0lQUUROmpNaP3QoCaC+kyP+KxzJ2MOhAFrMRqpAd2Viy2SKjIJXFgIhoDRd7l LqNQ== 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 v8si780058wrg.2.2018.02.14.23.35.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 23:35:18 -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 w1F7ZHNr004724 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2018 08:35:18 +0100 Received: from [167.87.36.215] ([167.87.36.215]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w1F7ZHhe025489; Thu, 15 Feb 2018 08:35:17 +0100 Subject: [PATCH v6 4/5] Provide include file for easy custom module builds To: Alexander Smirnov , isar-users References: <4e502291374cbbdfd24827ad4f039517d4297e96.1518599595.git.jan.kiszka@siemens.com> From: Jan Kiszka Message-ID: <59a2a6e6-c4f9-f8d5-cfd5-7c74834a0cd1@siemens.com> Date: Thu, 15 Feb 2018 08:35:17 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: 4ryyT6dnUlZp 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 --- Changes in v6: - fix module build on wheezy-arm and (upcoming) stretch-arm64 This allows to keep v5 of patch 5. Sorry for the mess, but I initially thought it was an issue with old wheezy on special ARM hardware only. But when it also popped up on stretch-arm64, I finally analyzed it. .../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..707f857 --- /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_NAME@ +Maintainer: ISAR project + +Package: @PN@ +Architecture: any +Depends: linux-image-@KERNEL_NAME@ +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..46cf977 --- /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) + +%: + CFLAGS= LDFLAGS= 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..aa232f7 --- /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 += "linux-headers-${KERNEL_NAME}" + +SRC_URI += "file://debian/" + +inherit dpkg + +dpkg_runbuild_prepend() { + cp -r ${WORKDIR}/debian ${WORKDIR}/${S}/ + sed -i -e 's/@PN@/${PN}/g' -e 's/@PV@/${PV}/g' \ + -e 's/@KERNEL_NAME@/${KERNEL_NAME}/g' \ + -e 's/@DESCRIPTION@/${DESCRIPTION}/g' \ + ${WORKDIR}/${S}/debian/changelog ${WORKDIR}/${S}/debian/control +} -- 2.13.6