From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.223.154.236 with SMTP id a99mr742703wrc.7.1518681288354; Wed, 14 Feb 2018 23:54:48 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.223.142.69 with SMTP id n63ls5863837wrb.11.gmail; Wed, 14 Feb 2018 23:54:47 -0800 (PST) X-Google-Smtp-Source: AH8x2253WdCxwmCZobHWPGR9FYHgokDewrajFrGp9ReFyd28TgwLeqWxDAVeWre48d8pvxjAVi9B X-Received: by 10.223.133.198 with SMTP id 6mr792259wru.31.1518681287797; Wed, 14 Feb 2018 23:54:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518681287; cv=none; d=google.com; s=arc-20160816; b=C9GjUS5OdVA/zdVa0bwsKuLKdk3gC5CLy+9Wgsk+XJvwkJaAv8MGorCTU+VJ1y3Lve IgS39QfS6LOQuxxMPE1HybTHQLItg6R1JaXv1+Erkb6jA3Hn22jUEwkfkKeL/ahJufba B5PZeavCzM9XjKkyEo9q4LoKu/3U+buW3uSFqADXx5VNOvI+v2BTt24vP5zgzJzIdwpf npAi6V9HO2poBIw8m3Duh//OatDtVSQGYPDld4RtAVBKbvFEoXayu7/KfTT+yfFjyfpo iZ9KqIPj79sMGxHgq7nssAX4YcB0AgcCFMwbAjOmg/x4BPypLv/inU38NRmPCxURvJ1J BqBA== 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=yvHbpdRBm15rjAUP8GXmnX3Gygkow2AQb05mUn1fjj4=; b=pA5FgnyvrpT1Pci4M0JG+ZmOyFfBviA90vLTsgsnAmgvVVSLRyudYtUfBcnsazfbRb rHMUMg3gsG1ghDhA4tjyE8N4T6+WJqzJkQc3QNM8RSggcXPe8IcGHocz3g2E9nf7siaN uELxcPQp9WGVAEDIFB/ZPEdLCvQhX/1eZTE9+SvEd35RWcyVGNmzZmEs9zdn/kH528BQ LYtxp2ybg1GJEguTxLg5OvqyO09qysDK3K/3cwf5YfcoYDRwGGjd/7+mtnSctdOs/HTk j2n6F3Ejz4W0YnZ3cRHNcUus2IbbqJ6FWRuCaYOAH6eK5gvqztgb5epfG5CqMDB/iYFr EVig== 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 v8si781697wrg.2.2018.02.14.23.54.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 23:54:47 -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 w1F7slhu007662 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2018 08:54:47 +0100 Received: from [167.87.36.215] ([167.87.36.215]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w1F7sk7Y026246; Thu, 15 Feb 2018 08:54:47 +0100 Subject: Re: [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> <59a2a6e6-c4f9-f8d5-cfd5-7c74834a0cd1@siemens.com> <701d4870-d831-b22d-2b25-2f9ebffb88ea@ilbers.de> From: Jan Kiszka Message-ID: <45897f97-9ef1-82d2-e56b-c038c4f7161b@siemens.com> Date: Thu, 15 Feb 2018 08:54:46 +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: <701d4870-d831-b22d-2b25-2f9ebffb88ea@ilbers.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TUID: jM4iAi9l8HlC On 2018-02-15 08:54, Alexander Smirnov wrote: > > 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]? Yes, that's what I meant below. Jan > > 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 >> +} >> > -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux