From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6514350167115694080 X-Received: by 10.80.134.135 with SMTP id r7mr4634188eda.1.1516740342018; Tue, 23 Jan 2018 12:45:42 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.80.190.10 with SMTP id a10ls1157404edi.6.gmail; Tue, 23 Jan 2018 12:45:41 -0800 (PST) X-Google-Smtp-Source: AH8x225eBa+7JTVnVp1lOwNiYsjhURZyInNmpeoqv+QPM6Rbktee1iiz4RjofqNl2S47hD/w3QQ7 X-Received: by 10.80.171.15 with SMTP id s15mr2836341edc.6.1516740341239; Tue, 23 Jan 2018 12:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516740341; cv=none; d=google.com; s=arc-20160816; b=qnsujMPzXsWqIhRWhFxEOBaBBibw87ct/rdRp4Kvd+iYyy45d7dopgCl+k2S6x1+QQ d14tECCV4BBZV2bvQakl3TJdOTHhJfJBgSf2nvSIihSXCzszYwm5BJI6YGFt3iBqQp7o nIKBtkOpDiROjv/v6G6HHwfJrlvXdUjs/YIaznvYCZaVO4PAdf2x+4TU8mlSwE7+URN4 JcpMjGQrLVxlbo8dktO7E6NNfyJJtaRF+AP9Bam4REJPgdPCACkPbFvBCC8KIRUTXNe4 +49nie1PCSWC6Ke8igGyn6qalu8iNraG0Ezy0UvzzyjKobJW036nmfEmtmjrIXzUIGjg 0pJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version:user-agent :date:message-id:subject:from:to:arc-authentication-results; bh=6rzPT3HFye+mZAcnKcRzWQK/iaGlSVXzUsxoutQV4FQ=; b=wpramp8yWNt1Ut6XQHhRLuUbp7FRQDsrJYDmAwMvSG3ewAQvIvJpJ/BfLtpL5DvLIS cgwsaAVMEMzyiAyhh1FzXKGpch0gC1EooXTmfORYSCgBKoOtO7ux4vHmqNk9of3XBclj epq2HRo+gP4hlxIjKDVlib4a7qrBjAJhLu0zkGDrFhyDBZV63NpQB3nGQx+/Y1hWdJAn fXgEelgT8hiVGxpTo7/Xjnj79CNhlw64NSN+5NWFo7EU00g/RFjvgmBJr4b5V4CPWLip j2AU1sYTmw391dwVJoD5X4Q1KqLLX6kZJYi7LZ/9AgdYgGDtRs9VWTviIS/fHO8J0D5x dBCQ== 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 g45si2746217eda.0.2018.01.23.12.45.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jan 2018 12:45:41 -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 w0NKjeXV014848 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 Jan 2018 21:45:40 +0100 Received: from md1f2u6c.ww002.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 w0NKjevN028800 for ; Tue, 23 Jan 2018 21:45:40 +0100 To: isar-users From: Jan Kiszka Subject: [PATCH] Install kernel via replaceable recipe Message-ID: <42503bac-f02a-35c7-0418-6fef03e3edb4@siemens.com> Date: Tue, 23 Jan 2018 21:45:39 +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 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: m+urV+GD0eLd 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. Based on an idea of Henning Schild. Signed-off-by: Jan Kiszka --- A first step towards simplifying kernel customization. I'm also planning to add some linux-custom.inc and related files to build a custom kernel recipe for a vanilla (non-debianized) kernel in a minute. BTW, doc/user_manual.md is now even more outdated, but I would only touch that once the kernel workflow is settled. 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 | 8 ++++++-- meta-isar/recipes-kernel/linux/linux-debian.bb | 12 ++++++++++++ 10 files changed, 30 insertions(+), 10 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..d845857 100644 --- a/meta-isar/recipes-core/images/isar-image-base.bb +++ b/meta-isar/recipes-core/images/isar-image-base.bb @@ -18,11 +18,15 @@ PV = "1.0" inherit image -DEPENDS += "${IMAGE_INSTALL}" +PREFERRED_PROVIDER_virtual/kernel ?= "linux-debian" + +DEPENDS += "${IMAGE_INSTALL} \ + virtual/kernel" IMAGE_PREINSTALL += "apt \ dbus \ - localepurge" + localepurge \ + ${@d.getVar("PREFERRED_PROVIDER_virtual/kernel", True)}" WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}" 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 -- 2.13.6