From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6514350167115694080 X-Received: by 10.80.204.74 with SMTP id n10mr10852714edi.12.1517309377054; Tue, 30 Jan 2018 02:49:37 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.80.185.67 with SMTP id m61ls1499737ede.4.gmail; Tue, 30 Jan 2018 02:49:36 -0800 (PST) X-Google-Smtp-Source: AH8x224/O2y2dctTFLvMRNXkNXWe3heAUL4TGEuGMaBwwz/ukaop7w9xABlQbn8Q3WYmFfVQVkHC X-Received: by 10.80.134.135 with SMTP id r7mr10788639eda.1.1517309376338; Tue, 30 Jan 2018 02:49:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517309376; cv=none; d=google.com; s=arc-20160816; b=V7PtfDnzx1opMNrVyySin05swNPZazgB3u1tcJi6mQY6eM/g7dOKnW0DKJSlDQs1tP E49+p+7pgy2MAjfXtHHjnCa1MAkZG64NPzaczjr7tA0XU6f6d0xenOpUwGVGNV2uS4cd dURQQsNl/qri7KXUUexufH/EDjy8FH/JR2Raa5cPkaTj07qFam1FqyFOZbMK9PP+CUo1 nbb5R6JU8vgJo1NTcQsSN7nB7nPfANViNQtD2Pa1DKNG+ZW+1kzsPayg42i6AOwj2JmH BlwlgA6wI8b6t4c/z4LLN28V1rFfa0ETNWMgAnAxX2WrbK2gKX4+IftkQIymeYZ2jzCE Mkzg== 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=bbqAcvMJMtOysdQ4vjZm5m4Dww4eqxn65NLrtQgPnjU=; b=fvTcoqk4DFFIXZM+MSmM1+soEq0Yx6goquKAfEFVNmH8ZscYOuyFKaPVmsryR4PY8Z guzHyDOfcrj83u/frLgVV68clWkCsRIAQelQ5C04qZe7SntgTltEhpz2uHIWdFIIWUn1 L/pIv0dfOCoS/oyS7ztqFo3gyNMe3dw2Pw5xAt0BDJnbaBaxX84IGNjjpEbJtBF/oEc7 wm5AdkAulHhu/34oTphgN+ykureHiJFOzvu/6aAJLNxf3ld5/ywD+CT73dHeeUzIgdCD Xmot4rpnw3RWloIgGxSiUtOd7V74vDlDcjbPg7c3ll7okY3kXfJztCOW0plKJPEQJvYH vbNA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id t4si1370815edt.2.2018.01.30.02.49.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 02:49:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from [10.0.2.15] ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w0UAnWBw004402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 30 Jan 2018 11:49:34 +0100 Subject: Re: [PATCH v2] Install kernel via replaceable recipe To: Jan Kiszka , isar-users References: <4ab8a0f9-9a34-0e20-bfe0-a447ffe134f6@siemens.com> From: Alexander Smirnov Message-ID: Date: Tue, 30 Jan 2018 13:49:27 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <4ab8a0f9-9a34-0e20-bfe0-a447ffe134f6@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: riRC30VOzz8T 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. > > 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? Alex