From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.46.112.1 with SMTP id l1mr86386ljc.15.1518681249776; Wed, 14 Feb 2018 23:54:09 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.21.23 with SMTP id s23ls132473ljd.15.gmail; Wed, 14 Feb 2018 23:54:09 -0800 (PST) X-Google-Smtp-Source: AH8x226mnqFWFF/fNTVVpYD+da8sxW4cXQOhRLDN9Nw6mqzvR/LisHf4c+kGt0zXodVe5PSI5dlQ X-Received: by 10.46.85.25 with SMTP id j25mr81928ljb.43.1518681249279; Wed, 14 Feb 2018 23:54:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518681249; cv=none; d=google.com; s=arc-20160816; b=eiVesBVSW6jheVxU9UrJYCkIX/71T0qqC7f4QB8pjEjZhNke2PvFJIlWPeK4shvuok 0Vm7qAhHyvMkJsZRFvG7s9y2oUIZnu4yPvcL3w+uf6KrTD0tFx61Tpef6qp/wDtfND3h Q6A74Bbxs4OTJkm3GV9khVGRJhd3ziO0NaDSQdKd6yuoq1/VU3HK5Ni6WarAhZFOcU6Q 8FwTwf8xzG1F1WoenXUBLwPa1IiQU4u8ATKxvz6NE9VVK8V8yAec88e4z4F6YLqpg7vd IeNhrC6E8FhEBK3qP8UzajPpqzZHVAxlQC/zKWW6RZBItE9nZCFiUiiK9zOAaxjVdB5u PpZg== 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=HDR2cEQ9lFLySPu8jgbrJDxW146j6+gRpbVa/4QwdaA=; b=y55ptpO9c3erTm99myPFdBsX6Va8tsYo0vOOqB9Oaa2dMWhZ9knAbfaYVujtywedN3 NrB6g6FzT7ZHgEbUfIDt5318iUtdXYK93lB1wAMz5qw1GgCQoTX1ITwgdy8zOUFcM64c yvFmWmVfDtEJ027sFWz33P5Ltq39oOt496Os5dDip14in2HVNwKyJqtelzQXBOZI51P6 xq1LqezWwJq05LogL//iCxNFWtioN+tP3IIJ71zyWaPPs34XzcsdgcqMEldO/SqNXJdU mzev/2UGm4fgIuZpLq+JvN3VMKEgo1scn5Wo0ilI/hPZfEYh9/K1ifwcI5q/VsX50/5i boTA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id o26si788496ljc.5.2018.02.14.23.54.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 23:54:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from [10.0.2.15] ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w1F7s5CF013270 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 15 Feb 2018 08:54:07 +0100 Subject: Re: [PATCH v6 4/5] Provide include file for easy custom module builds To: Jan Kiszka , isar-users References: <4e502291374cbbdfd24827ad4f039517d4297e96.1518599595.git.jan.kiszka@siemens.com> <59a2a6e6-c4f9-f8d5-cfd5-7c74834a0cd1@siemens.com> From: Alexander Smirnov Message-ID: <701d4870-d831-b22d-2b25-2f9ebffb88ea@ilbers.de> Date: Thu, 15 Feb 2018 10:54:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <59a2a6e6-c4f9-f8d5-cfd5-7c74834a0cd1@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: 6saBeugt54Uw On 02/15/2018 10:35 AM, Jan Kiszka wrote: > 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. > Should I take then [v5 5/5]? Alex > 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 > +} > -- With best regards, Alexander Smirnov ilbers GmbH Baierbrunner Str. 28c D-81379 Munich +49 (89) 122 67 24-0 http://ilbers.de/ Commercial register Munich, HRB 214197 General manager: Baurzhan Ismagulov