public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH 7/8] Provide include file for easy custom module builds
Date: Thu,  8 Feb 2018 16:05:40 +0100	[thread overview]
Message-ID: <0633bbdb90f92280d546298872c3bc8c83d3f03a.1518102341.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1518102341.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1518102341.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

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 <jan.kiszka@siemens.com>
---
 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 <isar-users@googlegroups.com>  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 <isar-users@googlegroups.com>
+
+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


  parent reply	other threads:[~2018-02-08 15:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 15:05 [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
2018-02-08 15:05 ` [PATCH 1/8] Forward proxy settings to dpkg build Jan Kiszka
2018-02-08 15:05 ` [PATCH 2/8] Prioritize isar-apt repo over all others Jan Kiszka
2018-02-08 15:05 ` [PATCH 3/8] Replace SRC_DIR with S Jan Kiszka
2018-02-08 15:05 ` [PATCH 4/8] Install kernel via replaceable recipe Jan Kiszka
2018-02-08 15:05 ` [PATCH 5/8] Provide include file for easy custom kernel builds Jan Kiszka
2018-02-08 15:05 ` [PATCH 6/8] Add custom kernel examples Jan Kiszka
2018-02-08 15:05 ` Jan Kiszka [this message]
2018-02-08 15:05 ` [PATCH 8/8] Add exemplary kernel module Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0633bbdb90f92280d546298872c3bc8c83d3f03a.1518102341.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox