From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520199916203016192 X-Received: by 10.80.146.139 with SMTP id k11mr494921eda.4.1518102343702; Thu, 08 Feb 2018 07:05:43 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.80.170.50 with SMTP id o47ls2404216edc.3.gmail; Thu, 08 Feb 2018 07:05:43 -0800 (PST) X-Google-Smtp-Source: AH8x227+2q0RzeFUS1bk+mn3/8r9pwRX1uJ7b2IO2kb0x0eDxggZc9G7038tCJAazA+Rf9uYmMsE X-Received: by 10.80.146.139 with SMTP id k11mr494913eda.4.1518102343119; Thu, 08 Feb 2018 07:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518102343; cv=none; d=google.com; s=arc-20160816; b=ztvmCbZLQd9XteKqF03nu3wfmxvpeoQe8hUheohV7aY1D2tJh4VWspe6yw/x1ikT9Y qyI5cFmx4a+EfY3rAqerBATbvokNpcTRmoEfjcgZnlyt1fDYhw0S7STHTMacJrQ11XLy m9VB3FzBVpt4BQVGYukmJUpofejHjc1WUG1wgyhdfQhfJFboQyfR+V5WHV0zDWweAozT rkmgrrfZw6tdR+2PeIlE3ambTOYBKd7JqQCYnZs/7WgRYYOe0PqxbZxedxR9xUcrAO44 DFSdI8vgHWG4Tx40vob4d3YwRF5FUunY98rnr7xpcDEPIfzPGKLMTZcNUud7EuQEaeV3 c2mw== 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=nmrmiE1Q43FBIA7xmSbtemw4Husiojri5R2BP/fzdAk=; b=EQfVWCx/AY77WUvUmD6PYHIkY2FmUjWg7NzfxXmlPMxGkPfUjTZbyONNSwl7N/WYip fwXbVvEPeYFqjznQYF2OkDF8FDGyR8621mKrL1niLCQ2SDOWo79ANFjzySgfa9zUFtzi 3vIcUFWczY+8VIlYR3a7ZVhxIi7mXlb8wUoNLkEH2k+gC0RSc/U2KaRmy4YlbzJXJaqv GBjqOTC4uB+O06+zWHB1gIil4AMSgHSjT0yurzHTducSRd0jBB7Gg2QUjoINjKeFH9AT 5jsZh6K27/Eicl59oR6N3Ed7QP3zoI1VQDs4/EN3t8JekeBuwKXuDxJGNgLwFZRK4gx2 pMpg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id v28si4987edd.3.2018.02.08.07.05.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 07:05:43 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w18F5gkg009743 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 8 Feb 2018 16:05:42 +0100 Received: from md1f2u6c.ad001.siemens.net (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w18F5gab010454 for ; Thu, 8 Feb 2018 16:05:42 +0100 From: Jan Kiszka To: isar-users Subject: [PATCH 4/8] Install kernel via replaceable recipe Date: Thu, 8 Feb 2018 16:05:37 +0100 Message-Id: <549f6b78e038792513957643e4c5c466f32deb99.1518102341.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-TUID: qmEVW4iQQd8i 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 | 14 ++++++++++++++ 14 files changed, 38 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..a0700e8 --- /dev/null +++ b/meta/recipes-kernel/linux/linux-distro.bb @@ -0,0 +1,14 @@ +# Debian kernel pseudo package +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2018 + +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