From: Alexander Smirnov <asmirnov@ilbers.de>
To: Jan Kiszka <jan.kiszka@siemens.com>,
isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH v2] Install kernel via replaceable recipe
Date: Tue, 30 Jan 2018 13:49:27 +0300 [thread overview]
Message-ID: <fbfa6184-9d71-0334-9c9b-7af19ace3d96@ilbers.de> (raw)
In-Reply-To: <4ab8a0f9-9a34-0e20-bfe0-a447ffe134f6@siemens.com>
On 01/30/2018 12:34 PM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This simplifies the common task of using a custom kernel instead of the
> pre-selected debian 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 communicated from the target multiconfig file
> to the linux-debian recipe via the DEBIAN_KERNEL variable.
Why it's Debian kernel? This could be a bit confusing, Isar doesn'y
support only official Debian kernel. For example Isar already supports
Raspbian which contains its own Raspbian kernel.
>
> Based on an idea of Henning Schild.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> Changes in v2:
> - install kernel meta package from local repo, instead of trying to
> pre-install it from the upstream one
> (I swear I tested this and it worked, but I have no idea how it
> could...)
>
> 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 | 7 ++++++-
> meta-isar/recipes-kernel/linux/linux-debian.bb | 12 ++++++++++++
> 10 files changed, 30 insertions(+), 9 deletions(-)
> create mode 100644 meta-isar/recipes-kernel/linux/linux-debian.bb
>
> diff --git a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
> index 51d39b6..e49751f 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"
> +DEBIAN_KERNEL ?= "linux-image-amd64"
>
> ROOTFS_DEV ?= "sda"
>
> diff --git a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
> index c59876a..f3dcd3a 100644
> --- a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
> +++ b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
> @@ -8,9 +8,10 @@ DISTRO_ARCH ?= "amd64"
>
> IMAGE_PREINSTALL += " \
> init \
> - linux-image-amd64 \
> "
>
> +DEBIAN_KERNEL ?= "linux-image-amd64"
> +
> ROOTFS_DEV ?= "sda"
>
> QEMU_ARCH ?= "x86_64"
> diff --git a/meta-isar/conf/multiconfig/qemuarm-jessie.conf b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
> index ed84c6c..50a27f5 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"
> +DEBIAN_KERNEL ?= "linux-image-armmp"
>
> ROOTFS_DEV ?= "vda"
>
> diff --git a/meta-isar/conf/multiconfig/qemuarm-stretch.conf b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
> index 1cce97a..9b99fb0 100644
> --- a/meta-isar/conf/multiconfig/qemuarm-stretch.conf
> +++ b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
> @@ -8,9 +8,10 @@ DISTRO_ARCH ?= "armhf"
>
> IMAGE_PREINSTALL += " \
> init \
> - linux-image-armmp \
> "
>
> +DEBIAN_KERNEL ?= "linux-image-armmp"
> +
> ROOTFS_DEV ?= "vda"
>
> QEMU_ARCH ?= "arm"
> diff --git a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
> index 38ea191..ab163a2 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"
> +DEBIAN_KERNEL ?= "linux-image-vexpress"
>
> ROOTFS_DEV ?= "mmcblk0"
>
> diff --git a/meta-isar/conf/multiconfig/qemui386-jessie.conf b/meta-isar/conf/multiconfig/qemui386-jessie.conf
> index d589661..e3df61d 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"
> +DEBIAN_KERNEL ?= "linux-image-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..344783e 100644
> --- a/meta-isar/conf/multiconfig/qemui386-stretch.conf
> +++ b/meta-isar/conf/multiconfig/qemui386-stretch.conf
> @@ -8,9 +8,10 @@ DISTRO_ARCH ?= "i386"
>
> IMAGE_PREINSTALL += " \
> init \
> - linux-image-686-pae \
> "
>
> +DEBIAN_KERNEL ?= "linux-image-686-pae"
> +
> ROOTFS_DEV ?= "sda"
>
> QEMU_ARCH ?= "i386"
> diff --git a/meta-isar/conf/multiconfig/rpi-jessie.conf b/meta-isar/conf/multiconfig/rpi-jessie.conf
> index d1dd9d9..cfbeb3a 100644
> --- a/meta-isar/conf/multiconfig/rpi-jessie.conf
> +++ b/meta-isar/conf/multiconfig/rpi-jessie.conf
> @@ -19,7 +19,6 @@ IMAGE_PREINSTALL += " \
> iproute2 \
> iputils-ping \
> isc-dhcp-client \
> - linux-image-rpi-rpfv \
> lrzsz \
> net-tools \
> netcat-openbsd \
> @@ -31,4 +30,6 @@ IMAGE_PREINSTALL += " \
> vim \
> "
>
> +DEBIAN_KERNEL ?= "linux-image-rpi-rpfv"
> +
> ROOTFS_DEV ?= "mmcblk0p2"
> diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
> index e359ac3..2f03cd1 100644
> --- a/meta-isar/recipes-core/images/isar-image-base.bb
> +++ b/meta-isar/recipes-core/images/isar-image-base.bb
> @@ -18,12 +18,17 @@ PV = "1.0"
>
> inherit image
>
> -DEPENDS += "${IMAGE_INSTALL}"
> +PREFERRED_PROVIDER_virtual/kernel ?= "linux-debian"
> +
> +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-isar/recipes-kernel/linux/linux-debian.bb b/meta-isar/recipes-kernel/linux/linux-debian.bb
> new file mode 100644
> index 0000000..21d20c2
> --- /dev/null
> +++ b/meta-isar/recipes-kernel/linux/linux-debian.bb
> @@ -0,0 +1,12 @@
> +# Debian kernel pseudo package
> +#
> +# This software is a part of ISAR.
> +# Copyright (c) Siemens AG, 2018
> +
> +DESCRIPTION = "Prebuilt Debian kernel"
> +MAINTAINER = "ISAR project"
> +PROVIDES = "virtual/kernel"
> +
> +DEBIAN_DEPENDS = "${DEBIAN_KERNEL}"
> +
> +inherit dpkg-raw
Do I understand correctly, that this recipe creates fake package that
has dependency from the upstream kernel? So in target rootfs 2 kernel
packages will be installed?
Alex
next prev parent reply other threads:[~2018-01-30 10:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 9:34 Jan Kiszka
2018-01-30 10:31 ` Henning Schild
2018-01-30 10:40 ` Jan Kiszka
2018-01-30 10:49 ` Alexander Smirnov [this message]
2018-01-30 10:52 ` Jan Kiszka
2018-01-30 11:06 ` Alexander Smirnov
2018-01-30 11:25 ` Jan Kiszka
2018-01-30 12:06 ` Alexander Smirnov
2018-01-30 12:39 ` Jan Kiszka
2018-01-30 12:57 ` Alexander Smirnov
2018-02-01 16:20 ` 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=fbfa6184-9d71-0334-9c9b-7af19ace3d96@ilbers.de \
--to=asmirnov@ilbers.de \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.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