From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6514350167115694080 X-Received: by 10.46.25.221 with SMTP id 90mr1470220ljz.17.1517309576208; Tue, 30 Jan 2018 02:52:56 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.25.143.193 with SMTP id s62ls370776lfk.3.gmail; Tue, 30 Jan 2018 02:52:55 -0800 (PST) X-Google-Smtp-Source: AH8x224uzNIlaaSdwdPCMpMWYdlUiWnOE9ZO94ThIBLXyh9NrIpItBtG7zrxr3ilUssABD6IxODI X-Received: by 10.46.0.163 with SMTP id e35mr1811050lji.31.1517309575470; Tue, 30 Jan 2018 02:52:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517309575; cv=none; d=google.com; s=arc-20160816; b=O7SsdnGbfUZz175STVI6U3AZx98dyYtMx2uXVvAX6ZG7Kt22D7/FhzankiZ2eNsIYC uiNl5nkx1+Jp/KVWhm9G7wV4TFRe79t5liSg3uqffEeSFxXgjY620Nw+7wWt+O9MOVKU m5R2D1yASpeQkP48fld6KtMQCzaZxvHEZ8+4ofgNc0j2slqLLTEfIqraKsClmUjwQqnl bZcJtXGbFFtKbYA+KS3VVRb6ekc4iDm3YTSgjcmgb4VXsc/4Fw93a2iEIlCtfsFAt80Y W1Xsqnd7lRZOrEbK1a8mQdxDuQXPW/jr0HgzHD7T5YhwFzn8VC6AiMMzF+vkNxnzpHSS XPTA== 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=uHxrTW2l+WUjE8jN604vCheJ375/19RwMFTcJbXIO8s=; b=xE4FKEhJSNrRFCmDzK4Lywqa9K6F47UTRC6BGV+ZGRoOYYPWS+Dg6xyR0BbkWcr7ZF Yr4prFmmd+EO1nzp4571dBiChf38XKCdFm6DijgpwzPlEu2WboFQ5A2sTMrRzpP/YYrH DbADNuRcw9aYwW73DLKOOMach7p2GdWY/8XXvPmQIlokPecYM2eHIgaAPyxZgNCJ/It5 RMTE9gXAGP5YfG/ZXym/gKANM9yXFFXWF+lK66xM6cKB7YwHlRtEqBw3S0OSS66TIKip AR380INByJxt7ZghzR9KEF4ie1oPoPmPAXWiKY0YgrQVtNi1z+RwbJdjMNkzBRR+vZpg KDBg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id h92si1319165lfi.3.2018.01.30.02.52.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 02:52:55 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w0UAqsBY020620 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Jan 2018 11:52:54 +0100 Received: from [139.25.68.37] (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w0UAqsCu027539; Tue, 30 Jan 2018 11:52:54 +0100 Subject: Re: [PATCH v2] Install kernel via replaceable recipe To: Alexander Smirnov , isar-users References: <4ab8a0f9-9a34-0e20-bfe0-a447ffe134f6@siemens.com> From: Jan Kiszka Message-ID: <70d3096b-ecb4-ab4c-5361-f63b80961c32@siemens.com> Date: Tue, 30 Jan 2018 11:52:53 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TUID: 58w5/FXGSfMI On 2018-01-30 11:49, Alexander Smirnov wrote: > On 01/30/2018 12:34 PM, Jan Kiszka wrote: >> From: Jan Kiszka >> >> 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. I'm always open for better name proposals. > >> >> Based on an idea of Henning Schild. >> >> Signed-off-by: Jan Kiszka >> --- >> >> 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? Right, one empty linux-debian meta package and the real one. The former allows us to trivially kick out the latter in favor of a custom kernel. Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux