From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH v2 4/8] Install kernel via replaceable recipe
Date: Thu, 8 Feb 2018 18:22:55 +0100 [thread overview]
Message-ID: <e7db30e20f966aaeb1288ee14b29afcf7d2ab67b.1518110579.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1518110579.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1518110579.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
This simplifies the common task of using a custom kernel instead of the
pre-selected disto variant: Move the kernel installation into a dummy
dpkg-raw recipe that only has the kernel package as dependency.
Which recipe is used for providing the kernel can now be selected via
the well-know PREFERRED_PROVIDER_virtual/kernel, just like in OE.
The kernel package name is derived from the KERNEL_ARCH variable which
is communicated from the target multiconfig file to the linux-distro
recipe.
Based on an idea of Henning Schild.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta-isar/conf/distro/debian-jessie.conf | 2 ++
meta-isar/conf/distro/debian-stretch.conf | 2 ++
meta-isar/conf/distro/debian-wheezy.conf | 2 ++
meta-isar/conf/distro/raspbian-jessie.conf | 2 ++
meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 3 ++-
meta-isar/conf/multiconfig/qemuarm-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemuarm-stretch.conf | 3 ++-
meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 2 +-
meta-isar/conf/multiconfig/qemui386-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemui386-stretch.conf | 3 ++-
meta-isar/conf/multiconfig/rpi-jessie.conf | 3 ++-
meta-isar/recipes-core/images/isar-image-base.bb | 5 ++++-
meta/recipes-kernel/linux/linux-distro.bb | 16 ++++++++++++++++
14 files changed, 40 insertions(+), 9 deletions(-)
create mode 100644 meta/recipes-kernel/linux/linux-distro.bb
diff --git a/meta-isar/conf/distro/debian-jessie.conf b/meta-isar/conf/distro/debian-jessie.conf
index d4bc4b1..4494c91 100644
--- a/meta-isar/conf/distro/debian-jessie.conf
+++ b/meta-isar/conf/distro/debian-jessie.conf
@@ -10,3 +10,5 @@ DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-distro"
diff --git a/meta-isar/conf/distro/debian-stretch.conf b/meta-isar/conf/distro/debian-stretch.conf
index 74177fd..1375c1d 100644
--- a/meta-isar/conf/distro/debian-stretch.conf
+++ b/meta-isar/conf/distro/debian-stretch.conf
@@ -8,3 +8,5 @@ DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-distro"
diff --git a/meta-isar/conf/distro/debian-wheezy.conf b/meta-isar/conf/distro/debian-wheezy.conf
index 017316e..1e99ddd 100644
--- a/meta-isar/conf/distro/debian-wheezy.conf
+++ b/meta-isar/conf/distro/debian-wheezy.conf
@@ -10,3 +10,5 @@ DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-distro"
diff --git a/meta-isar/conf/distro/raspbian-jessie.conf b/meta-isar/conf/distro/raspbian-jessie.conf
index bd3c280..6a6c568 100644
--- a/meta-isar/conf/distro/raspbian-jessie.conf
+++ b/meta-isar/conf/distro/raspbian-jessie.conf
@@ -10,3 +10,5 @@ DISTRO_APT_SOURCE_SEC ?= ""
DISTRO_CONFIG_SCRIPT ?= "raspbian-configscript.sh"
DISTRO_MULTICONF_BOOTSTRAP ?= "base"
DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-distro"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
index 51d39b6..c80a936 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
@@ -6,7 +6,7 @@ MACHINE ?= "qemuamd64"
DISTRO ?= "debian-jessie"
DISTRO_ARCH ?= "amd64"
-IMAGE_PREINSTALL += "linux-image-amd64"
+KERNEL_ARCH ?= "amd64"
ROOTFS_DEV ?= "sda"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
index c59876a..28ab3ae 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
@@ -6,9 +6,10 @@ MACHINE ?= "qemuamd64"
DISTRO ?= "debian-stretch"
DISTRO_ARCH ?= "amd64"
+KERNEL_ARCH ?= "amd64"
+
IMAGE_PREINSTALL += " \
init \
- linux-image-amd64 \
"
ROOTFS_DEV ?= "sda"
diff --git a/meta-isar/conf/multiconfig/qemuarm-jessie.conf b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
index ed84c6c..48244eb 100644
--- a/meta-isar/conf/multiconfig/qemuarm-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
@@ -13,7 +13,7 @@ MACHINE ?= "qemuarm"
DISTRO ?= "debian-jessie"
DISTRO_ARCH ?= "armhf"
-IMAGE_PREINSTALL += "linux-image-armmp"
+KERNEL_ARCH ?= "armmp"
ROOTFS_DEV ?= "vda"
diff --git a/meta-isar/conf/multiconfig/qemuarm-stretch.conf b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
index 1cce97a..5cf24f2 100644
--- a/meta-isar/conf/multiconfig/qemuarm-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
@@ -6,9 +6,10 @@ MACHINE ?= "qemuarm"
DISTRO ?= "debian-stretch"
DISTRO_ARCH ?= "armhf"
+KERNEL_ARCH ?= "armmp"
+
IMAGE_PREINSTALL += " \
init \
- linux-image-armmp \
"
ROOTFS_DEV ?= "vda"
diff --git a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
index 38ea191..695cdce 100644
--- a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
@@ -13,7 +13,7 @@ MACHINE ?= "qemuarm"
DISTRO ?= "debian-wheezy"
DISTRO_ARCH ?= "armhf"
-IMAGE_PREINSTALL += "linux-image-vexpress"
+KERNEL_ARCH ?= "vexpress"
ROOTFS_DEV ?= "mmcblk0"
diff --git a/meta-isar/conf/multiconfig/qemui386-jessie.conf b/meta-isar/conf/multiconfig/qemui386-jessie.conf
index d589661..f73ad98 100644
--- a/meta-isar/conf/multiconfig/qemui386-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemui386-jessie.conf
@@ -6,7 +6,7 @@ MACHINE ?= "qemui386"
DISTRO ?= "debian-jessie"
DISTRO_ARCH ?= "i386"
-IMAGE_PREINSTALL += "linux-image-686-pae"
+KERNEL_ARCH ?= "686-pae"
ROOTFS_DEV ?= "sda"
diff --git a/meta-isar/conf/multiconfig/qemui386-stretch.conf b/meta-isar/conf/multiconfig/qemui386-stretch.conf
index 40239e4..60f8ccb 100644
--- a/meta-isar/conf/multiconfig/qemui386-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemui386-stretch.conf
@@ -6,9 +6,10 @@ MACHINE ?= "qemui386"
DISTRO ?= "debian-stretch"
DISTRO_ARCH ?= "i386"
+KERNEL_ARCH ?= "686-pae"
+
IMAGE_PREINSTALL += " \
init \
- linux-image-686-pae \
"
ROOTFS_DEV ?= "sda"
diff --git a/meta-isar/conf/multiconfig/rpi-jessie.conf b/meta-isar/conf/multiconfig/rpi-jessie.conf
index d1dd9d9..c7c7fae 100644
--- a/meta-isar/conf/multiconfig/rpi-jessie.conf
+++ b/meta-isar/conf/multiconfig/rpi-jessie.conf
@@ -13,13 +13,14 @@ MACHINE ?= "rpi"
DISTRO ?= "raspbian-jessie"
DISTRO_ARCH ?= "armhf"
+KERNEL_ARCH ?= "rpi-rpfv"
+
IMAGE_PREINSTALL += " \
bind9-host \
dnsutils \
iproute2 \
iputils-ping \
isc-dhcp-client \
- linux-image-rpi-rpfv \
lrzsz \
net-tools \
netcat-openbsd \
diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index e54b9a6..5340767 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -18,12 +18,15 @@ PV = "1.0"
inherit image
-DEPENDS += "${IMAGE_INSTALL}"
+DEPENDS += "${IMAGE_INSTALL} \
+ virtual/kernel"
IMAGE_PREINSTALL += "apt \
dbus \
localepurge"
+IMAGE_INSTALL += "${@d.getVar("PREFERRED_PROVIDER_virtual/kernel", True)}"
+
WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
do_rootfs[dirs] = "${WORKDIR}/hooks_multistrap"
diff --git a/meta/recipes-kernel/linux/linux-distro.bb b/meta/recipes-kernel/linux/linux-distro.bb
new file mode 100644
index 0000000..1af93ed
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-distro.bb
@@ -0,0 +1,16 @@
+# Debian kernel pseudo package
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018
+#
+# SPDX-License-Identifier: MIT
+
+DESCRIPTION = "Meta package for distribution kernel"
+MAINTAINER = "ISAR project <isar-users@googlegroups.com>"
+PROVIDES = "virtual/kernel"
+
+KERNEL_ARCH ?= "${DISTRO_ARCH}"
+
+DEBIAN_DEPENDS = "linux-image-${KERNEL_ARCH}"
+
+inherit dpkg-raw
--
2.13.6
next prev parent reply other threads:[~2018-02-08 17:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-08 17:22 [PATCH v2 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
2018-02-08 17:22 ` [PATCH v2 1/8] Forward proxy settings to dpkg build Jan Kiszka
2018-02-08 17:22 ` [PATCH v2 2/8] Prioritize isar-apt repo over all others Jan Kiszka
2018-02-09 16:46 ` Henning Schild
2018-02-09 16:52 ` Jan Kiszka
2018-02-09 17:15 ` Henning Schild
2018-02-08 17:22 ` [PATCH v2 3/8] Replace SRC_DIR with S Jan Kiszka
2018-02-08 17:22 ` Jan Kiszka [this message]
2018-02-08 17:22 ` [PATCH v2 5/8] Provide include file for easy custom kernel builds Jan Kiszka
2018-02-09 16:59 ` Henning Schild
2018-02-09 17:24 ` Jan Kiszka
2018-02-09 17:31 ` Henning Schild
2018-02-09 17:30 ` Henning Schild
2018-02-09 17:54 ` Jan Kiszka
2018-02-09 19:04 ` Henning Schild
2018-02-11 15:16 ` Jan Kiszka
2018-02-09 17:57 ` [PATCH v3 " Jan Kiszka
2018-02-08 17:22 ` [PATCH v2 6/8] Add custom kernel examples Jan Kiszka
2018-02-09 17:01 ` Henning Schild
2018-02-08 17:22 ` [PATCH v2 7/8] Provide include file for easy custom module builds Jan Kiszka
2018-02-08 17:22 ` [PATCH v2 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=e7db30e20f966aaeb1288ee14b29afcf7d2ab67b.1518110579.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