public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH 14/16] linux-custom: Simplify and clarify KERNEL_NAME-to-recipe matching
Date: Tue, 11 Sep 2018 14:05:54 +0200	[thread overview]
Message-ID: <71f8d0a9a81d5bd10cc8ddf9998542fbbc579db5.1536667556.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1536667556.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1536667556.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

The old mechanism tried to be too smart my deriving missing elements
when defining the PROVIDES of a custom kernel recipe from the currently
selected target KERNEL_NAME. But that broke when there was both a
linux-foo and a linux-foo-bar.

Let's make it straight and simple: A custom kernel recipe can control
the suffix "[-featureset]-flavor" of the generated linux-{image,headers}
meta packages by

 a) calling itself "linux-featureset-flavor"
 b) setting the variable KERNEL_NAME_PRODVIDED to "featureset-flavor"

Effectively, KERNEL_NAME is now matched against KERNEL_NAME_PRODVIDED
(in practice, the meta package names are matched). Actually, this is the
same logic that was already used for distro kernels.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 RECIPE-API-CHANGELOG.md                    |  8 ++++++++
 meta/recipes-kernel/linux/linux-custom.inc | 10 ++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 69c36fa..8d93ef4 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -64,3 +64,11 @@ These variables can be removed from own machine.conf or multiconfig files.
 
 If you want to enable support for QEMU in your config (start_vm), specify the
 `QEMU_ROOTFS_DEV` and `QEMU_DISK_ARGS` instead.
+
+### KERNEL_NAME_PROVIDED replaces KERNEL_FLAVOR in custom kernels
+
+The matching logic for custom kernel recipes to the selected kernel was
+reworked and simplified. If your kernel recipe is called `linux-foo_4.18.bb`,
+you now have to set `KERNEL_NAME = "foo"` in order to select that kernel.
+Alternatively, a recipe with a different naming scheme can set
+`KERNEL_NAME_PROVIDED = "foo"` in order to match as well.
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 4144b67..10a50c3 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -9,15 +9,13 @@ FILESPATH =. "${LAYERDIR_core}/recipes-kernel/linux/files:"
 
 DESCRIPTION ?= "Custom kernel"
 
-KERNEL_FLAVOR ?= "${@ d.getVar('PN', True).partition('linux-')[2]}"
+KERNEL_NAME_PRODVIDED ?= "${@ d.getVar('PN', True).partition('linux-')[2]}"
 KERNEL_DEFCONFIG ?= "defconfig"
 
 python() {
-    kernel = d.getVar("KERNEL_NAME", True)
-    flavor = d.getVar("KERNEL_FLAVOR", True)
-    if kernel and flavor and kernel.startswith(flavor + "-"):
-        d.setVar('PROVIDES', 'linux-image-' + kernel + ' ' + \
-                             'linux-headers-' + kernel)
+    kernel_name = d.getVar("KERNEL_NAME_PRODVIDED", True)
+    d.setVar('PROVIDES', 'linux-image-' + kernel_name + ' ' + \
+                         'linux-headers-' + kernel_name)
 }
 
 inherit dpkg-base
-- 
2.16.4


  parent reply	other threads:[~2018-09-11 12:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
2018-09-11 12:05 ` [PATCH 01/16] meta-isar: Adjust kernel params in sdimage-efi.wks Jan Kiszka
2018-09-11 12:05 ` [PATCH 02/16] meta-isar: Reduce grub timeout to 3 seconds Jan Kiszka
2018-09-11 12:05 ` [PATCH 03/16] meta-isar: Fix bananapi root disk specification Jan Kiszka
2018-09-12  8:57   ` Henning Schild
2018-09-12  8:59     ` Henning Schild
2018-09-11 12:05 ` [PATCH 04/16] meta-isar: Remove "=" after wic parameters Jan Kiszka
2018-09-11 12:05 ` [PATCH 05/16] u-boot-script: Become independent of target /etc/fstab Jan Kiszka
2018-09-11 12:05 ` [PATCH 06/16] isar-image-base: Disable rootfs check by default Jan Kiszka
2018-09-11 12:05 ` [PATCH 07/16] isar-image-base: Use generic parameters for rootfs entry in fstab Jan Kiszka
2018-09-11 12:05 ` [PATCH 08/16] meta: Remove ROOTFS_TYPE Jan Kiszka
2018-09-11 12:05 ` [PATCH 09/16] start_vm: Rename QEMU_ROOTFS_DEV to QEMU_DISK_ARGS Jan Kiszka
2018-09-11 12:05 ` [PATCH 10/16] start_vm: Rename ROOTFS_DEV to QEMU_ROOTFS_DEV Jan Kiszka
2018-09-11 12:05 ` [PATCH 11/16] RECIPE-API-CHANGELOG: Add ROOTFS_DEV/TYPE removal Jan Kiszka
2018-09-11 12:05 ` [PATCH 12/16] meta: Add expand-on-first-boot support package Jan Kiszka
2018-09-12 13:46   ` Henning Schild
2018-09-13  8:33     ` Jan Kiszka
2018-09-13  9:30       ` Henning Schild
2018-09-13 13:17         ` Jan Kiszka
2018-09-11 12:05 ` [PATCH 13/16] image: Limit ROOTFS_EXTRA to non-wic image type Jan Kiszka
2018-09-11 12:05 ` Jan Kiszka [this message]
2018-09-11 12:05 ` [PATCH 15/16] meta-isar: Move init preinstallation into distro conf Jan Kiszka
2018-09-11 12:05 ` [PATCH 16/16] meta: Add enable-fsck helper recipe Jan Kiszka
2018-09-25 11:27 ` [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Maxim Yu. Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=71f8d0a9a81d5bd10cc8ddf9998542fbbc579db5.1536667556.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox