From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.28.87.194 with SMTP id l185mr1393wmb.9.1518110581311; Thu, 08 Feb 2018 09:23:01 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.202.2 with SMTP id a2ls1098365wmg.8.canary-gmail; Thu, 08 Feb 2018 09:23:00 -0800 (PST) X-Google-Smtp-Source: AH8x224gz9oUY2BWbpxYwNtsJeSkZJ3Q8Rwmr+5kXaeRm4ltqlLQUIgfhlZeR1pEJFazpf8PNIJq X-Received: by 10.28.116.24 with SMTP id p24mr16751wmc.6.1518110580519; Thu, 08 Feb 2018 09:23:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518110580; cv=none; d=google.com; s=arc-20160816; b=cWhcxZgjE2/Luxx3jjoZ4WTx6/fkn8eq8n5Gk4rqIjOZvix/DbGQIBZRwh61JpdVMX hcFTqRS3HoUUAbSyMkBkOD5X3PWVLhVKP0Qjyv4rYSnlHXfj3vSqPffIp+bmm5bgL0fT fvTbvGD7jEOAnst1W2BP+q/wBFkUz+YJoAk/OgC15Uxl8pilj/IxoI8rsa4U9Aoa9WUN P7HJr9EhBrjUPDdUqI6Ll+5bfctDTJojCTBC+PsuIisE7Mhx0zCWKTT2zCogpJivZAbx uEfYtW7qClsK5mwtq6kb2ysedFgsnDl5BzZUcJg3nrFO9W/xJ20JefMwBgoFliUnWPZv yLBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:to:from:arc-authentication-results; bh=q7uW3VMrnxw5xJWYnNJLorfmQ1o71GHjBThdiy6t73Y=; b=FLo+LDteWZOvQKm95n9iLGFUNXzTxviFmdKQFJdRxtHCh47WwFFOUqJFpP8R+MGRno N46Nbg3jOKgaJmxgbBoQJvQbEt/H1/azzXaBmR+dmC6yTdWmFFb3IlkrWWYoIkTOGlo4 WmO467LzszfGQ4/mF10xLBUzwgrfuSdOpLmGuEyJSIKK3IbeGSlc2qSdF/tvzr99yyiy x8NFVudSz9jhdx4ZlydKAyL9ErwgsnNothXPBr/BQ46g9Q4oBI+jHqwqntSco0CPJfza SETkEGlaK2RZEwTzGCcPg7iGPDhC2K3Y1oUyd4NPhhe5pENLGrR4ibbyMjExlN31I3p2 M5EA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id b10si25164wmc.0.2018.02.08.09.23.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 09:23:00 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w18HMxaZ014745 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 8 Feb 2018 18:23:00 +0100 Received: from md1f2u6c.ad001.siemens.net (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id w18HMxfi025766 for ; Thu, 8 Feb 2018 18:22:59 +0100 From: Jan Kiszka To: isar-users Subject: [PATCH v2 4/8] Install kernel via replaceable recipe Date: Thu, 8 Feb 2018 18:22:55 +0100 Message-Id: X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-TUID: pBLuQOC/u3W4 From: Jan Kiszka 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 --- 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 " +PROVIDES = "virtual/kernel" + +KERNEL_ARCH ?= "${DISTRO_ARCH}" + +DEBIAN_DEPENDS = "linux-image-${KERNEL_ARCH}" + +inherit dpkg-raw -- 2.13.6