From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.28.89.193 with SMTP id n184mr176462wmb.22.1518102343823; Thu, 08 Feb 2018 07:05:43 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.223.197.7 with SMTP id q7ls1464725wrf.10.gmail; Thu, 08 Feb 2018 07:05:43 -0800 (PST) X-Google-Smtp-Source: AH8x226MjjtVimn585VCt0jTT/n+bLieBeqODx/D20NEkgioJUd8Gtw/oQ/jCQS1hOIbksWNrBu4 X-Received: by 10.223.184.42 with SMTP id h39mr153438wrf.4.1518102343218; Thu, 08 Feb 2018 07:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518102343; cv=none; d=google.com; s=arc-20160816; b=Fv73Baxbi9FTG9ppLdAKMhxXYhqVOmKwPO6gd4jqShl4LGFvPIG9pxyAuILuhusYCs MfS2upIVbAaBM3bC5IGWnYJEYDyU2yHpQZe9w9HFCsN4VM8ha5podp/9QwZRquPPlEDY kWrNxOAlCxdp+FLKjhf/W17YoWI+Um/EvJkT9bqamJTXGwBDHtkoO+DGao+K8qfkWctD zKlbyCVawXmFCCWrOG4mCpnBhpsSZsZRBNOpjcjP+Kg05vF+mjCxBYWP56khLMR8U547 +W3vLtVl6ZjrFC+fV/Zux7FuspiP9wUwXPNe4BTJhBa3UuI7yHtrOpThp+KLOOCFOmVq EHqg== 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=rrFyMcT2yI8mx1/MrelNk9TXEM1N6/NKh5kdVJ9vXPY=; b=VWfY9LLuCx5B3NBUzgnjk7Dao9ftaj1IfNCcneh67h9Oaw53Icg3uev3UskcunPJR/ YyZQVAs1DM+ZSoMtW5OTxwrxCSEMt2eHCDGACUbAlcCtOUO2b3HVglewmU7Of2XWma9+ tLrOnzoyePTjCRfa5bxDffOCIbPWJWbsM/fNZpZyw3CNzrPy0nM99zV8YYheqQd9IaKM J624o8FZWYxId7i7MZRq4TcXdhCpeQqzUjn/FMa5qMerjM9+LPj44aUzpljArESHwccz aJhzivfERfhkqf4Nk1GLlW7TEWs3PvsNaBC5sKBno8K/2AmT4jRfQVFB+0+LMJRUWKGv 2mMA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id s5si9360wra.3.2018.02.08.07.05.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 07:05:43 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w18F5g8d031492 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 8 Feb 2018 16:05:42 +0100 Received: from md1f2u6c.ad001.siemens.net (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w18F5gae010454 for ; Thu, 8 Feb 2018 16:05:42 +0100 From: Jan Kiszka To: isar-users Subject: [PATCH 7/8] Provide include file for easy custom module builds Date: Thu, 8 Feb 2018 16:05:40 +0100 Message-Id: <0633bbdb90f92280d546298872c3bc8c83d3f03a.1518102341.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-TUID: B2jr/s10hWP9 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 --- meta/recipes-kernel/linux-module/files/debian/changelog | 5 +++++ meta/recipes-kernel/linux-module/files/debian/compat | 1 + meta/recipes-kernel/linux-module/files/debian/control | 11 +++++++++++ meta/recipes-kernel/linux-module/files/debian/rules | 8 ++++++++ meta/recipes-kernel/linux-module/module.inc | 17 +++++++++++++++++ 5 files changed, 42 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..51d3dc5 --- /dev/null +++ b/meta/recipes-kernel/linux-module/files/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f + +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..a17a14f --- /dev/null +++ b/meta/recipes-kernel/linux-module/module.inc @@ -0,0 +1,17 @@ +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