From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.46.118.14 with SMTP id r14mr255121ljc.8.1518599599834; Wed, 14 Feb 2018 01:13:19 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.25.207.203 with SMTP id f194ls337830lfg.2.gmail; Wed, 14 Feb 2018 01:13:19 -0800 (PST) X-Google-Smtp-Source: AH8x226r16FCA8sId4orNrQHCXqF1csX/r4m9A9CNXKZDorzhFU9DKNQqP7k3O10BHDi7hoQ5ezt X-Received: by 10.25.211.79 with SMTP id k76mr309757lfg.1.1518599599175; 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=WGm+DZ24R6LbJHfehvyUmeta/nw3Y9eWdJT33zM0CUB8I7r0bSQfexYHsINrU5vEh3 ODtuwdrWih0BXLcLvnaFy2Bxz5sbYpH3XMu0MWb4Bms869XNv2stfaruQfVD1YuCDr68 IKKZnYUjhxLoua0jzvuDOMER9XueU2NzHXCqVtN12GPSZMuFsTlgvIXUoNr2yKsj5/c/ 4LU2Lv3X/dtADIs3qm4lsSaSsnDPp06vKQpDefKtV/d2uCXOIKXGoEDEFto2Z/qYrZ+Y WbbAQ96FnB0hXwA3H5QiROCyLj7aoi6qDH4hcYi2khTobpjw6YAYt+/q5VlNZf+BnafG 4+yw== 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=a1AnWhQzNBP3hT+7w/OLtbE0qMYQmjIxll99JknEqnc=; b=B0Qk4ccGdHldvJz6tdCLPpNQORBklf0oEEacznDq6yCpRpRciWzLEeQyr0+tkOxbW9 ke+gaZB1i4qn4YfozX33/7U9JPYluhsLP01/AmUIzWv3F6P2Ky0Cw4+eqayKAoC5YDIE NRx4OF+JYQPs7Ele5vZoig3CLZXxzclvp3jozyEmromQkBfbJFoGG6x5BOYR/MksQJUX 4RTltQX17eSk2VDAstkQ+CNcb5J8xBRA0wIbKdJGnW6iU6US40nU3MUz9wot7AI4+Lxd k8KeYLPYY69yXpbidCbNq4CELYcs4xc8fS0jNiKx//iMZdUlbZVJc92lHNuBBzk10Tmj LWdw== 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 u10si704990lju.0.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 w1E9DIKu025065 (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 w1E9DHSc028726 for ; Wed, 14 Feb 2018 10:13:18 +0100 From: Jan Kiszka To: isar-users Subject: [PATCH v5 4/5] Provide include file for easy custom module builds Date: Wed, 14 Feb 2018 10:13:14 +0100 Message-Id: X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-TUID: ztGxbmsqmlOc 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..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..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..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