From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6599936908158042112 X-Received: by 2002:adf:8231:: with SMTP id 46-v6mr1793633wrb.12.1536667559928; Tue, 11 Sep 2018 05:05:59 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:2d41:: with SMTP id t62-v6ls593467wmt.11.canary-gmail; Tue, 11 Sep 2018 05:05:59 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYDGWJmNJsbbtLHp5CC1WsyGX1Hhj3t+GjUO4d4ubfSWB+AukqQW/g6M8rWwhj8P3wEzVBf X-Received: by 2002:a1c:48c6:: with SMTP id v189-v6mr142260wma.27.1536667559428; Tue, 11 Sep 2018 05:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536667559; cv=none; d=google.com; s=arc-20160816; b=TGT2nKk0rFLl+DYJhk2QByiJWpt4InOSClplrd+QsENGTUO8FmrFVr/CLmuueRmRx2 b6qDTN/3yIkwzUP6gJxx4o77WfFWPFFxYgTIG14D4EFCoNFn5B92a5P9E/USjBp4M813 GtkOS/GTHbwDeToC312WpdSLvqvNw66jZc+g606CqpqWeZb8GGdX7GdPamptQ1wPVvTn Er3ft0ZufVo/4oOzW/Z9V4cdEQWG0QO2qJxnzXlFEFCkWp8qXtZJCwTFgVEAeeQF7mMS LW42/2vHb6Fo/xaACej31QjcBC1Djy2jm7XfYUkgtzB6XAOMlvxG6iNxfRN+bgEV+dFt x1wA== 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; bh=RTbjqsIOArmat71E5tCeQV1ahyM5M3j8OYJllURhCbY=; b=VTRXsdFtf2OWdQzaZDeSDE05y+NNkkAK9FTLTLsKHtSJ6MI10GgOdSXAz8ujSNlTiD H7MoHfVSnshewPzweFLTkM+HdZPVWctRULESvxZC4KitlocxTlLez/FXE3S0cSB8QBUU qQwAutxVOEcq3m9LOyEcXaq+7CgNmiW6d6XI25Slj2EV1sWfvY1GtoP3a1z06n24Vf0x re2J5gRTKK72fbwRMneLm+cAnV6Bz9C6ti/gN4PYWjwQA4jp6kHPPnu5//jaXNirwIlt H7+WWjmwzZc0IXmSQ62iVntTVnjdae9EqYjAn8lZvzOiGTnhx34347Yx+pBv2odc9bx4 54mw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id 196-v6si387871wmx.1.2018.09.11.05.05.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 05:05:59 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w8BC5wep025570 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 11 Sep 2018 14:05:58 +0200 Received: from md1f2u6c.ad001.siemens.net (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id w8BC5vIY000884 for ; Tue, 11 Sep 2018 14:05:58 +0200 From: Jan Kiszka To: isar-users Subject: [PATCH 14/16] linux-custom: Simplify and clarify KERNEL_NAME-to-recipe matching Date: Tue, 11 Sep 2018 14:05:54 +0200 Message-Id: <71f8d0a9a81d5bd10cc8ddf9998542fbbc579db5.1536667556.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: References: In-Reply-To: References: X-TUID: UzzdE45sXVxm From: Jan Kiszka 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 --- 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