From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7366946388798603264 X-Received: by 2002:a05:6512:20cc:b0:51d:a541:733 with SMTP id 2adb3069b0e04-52210277f11mr10086887e87.66.1715696134420; Tue, 14 May 2024 07:15:34 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6402:3228:b0:572:512a:ed0b with SMTP id 4fb4d7f45d1cf-573332d9e6bls2040852a12.1.-pod-prod-08-eu; Tue, 14 May 2024 07:15:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUgQ7wqi+NnLhwqZEQOepqwRGaXrc+7v0dDXWsacrna7Y17C8d6lThGTeh96h3+qHota3d X-Received: by 2002:a50:c356:0:b0:572:a71e:b8fa with SMTP id 4fb4d7f45d1cf-5734d5cff03mr11235971a12.16.1715696132179; Tue, 14 May 2024 07:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715696132; cv=none; d=google.com; s=arc-20160816; b=cTqZ38DQIMntjXxdZB4byKJCil5u9IUD8kFTTbsmGoAHNKnhjOC6j95SH7BWg9xtA3 lI8ahAjVtUsFX8FRKfJXgg/DoGH46zkxeFA44pwfIuveIHFYeOta15pzCGyea8SY6ccb bsjQ0Xkc4SA0JHFw7Lw907AsZjd6jC/HiD/b8QA86ZWoi8xWfk2FFMbEcdqz2Dg6MrQ6 XlvVatdK1qSYh+oHksTtIOEhovuTvr/IXVRmv+5YV1G3mm+s5XlQKas/MppPwc0QTxkp SEV3Zd5y6gqdlNGrq6w5TaXtXlAXRqtMf3KRO0Xo1Mbg2vuKPpy1bSEBTY2lSyr1D80o AgMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=CSrG6yw27XuZ3fzzVBnH1MxqB0spZJJQd8+PijuWFQI=; fh=qxj0qH++O2CSqXuHk1zmqR74UpYndUvoWfavR7y1BqY=; b=wzeZJB8QWBjhiLcUpi6rGrJltd4Q+LYVmZkvWaseP+e59fH5/l6OEpDSmygC5HQ0mF ifX/LqwIZmy9duQP8kOjEOUrTzg9fP/xX6qd+zKq+ZL4F/XzceQSd+GaUFf4bm6ZchvE s898vEyQH/K8f1BceAYIsKhMJaNXuK/axFxmhjyJRoRHtblJJtsu3bI3aoU2x6x67lIp a4lsz+9gkp4IF38GgKdMcQSYKa+dxBv/T7dnfp9yvpnO/SmKSG/HjLe3J166ZKQxdO5J beNyLOTcCDRue+guogAJbTE8aUsyxFGHveCJ7wJcXi1elkNMIoIOeFL/rJDyRrknpVj7 /N+w==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="cnCsUYW/"; spf=pass (google.com: domain of fm-526363-2024051414153105f6d961a8dd5f99e1-wf1wzq@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-526363-2024051414153105f6d961a8dd5f99e1-wF1WzQ@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net. [185.136.64.228]) by gmr-mx.google.com with ESMTPS id 4fb4d7f45d1cf-574be5729e1si140512a12.0.2024.05.14.07.15.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2024 07:15:32 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-526363-2024051414153105f6d961a8dd5f99e1-wf1wzq@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) client-ip=185.136.64.228; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="cnCsUYW/"; spf=pass (google.com: domain of fm-526363-2024051414153105f6d961a8dd5f99e1-wf1wzq@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-526363-2024051414153105f6d961a8dd5f99e1-wF1WzQ@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 2024051414153105f6d961a8dd5f99e1 for ; Tue, 14 May 2024 16:15:31 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=adriaan.schmidt@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=CSrG6yw27XuZ3fzzVBnH1MxqB0spZJJQd8+PijuWFQI=; b=cnCsUYW/P54c7K6vzSaTgQdzjUHvBxoT41Q+bwJGofeAF4YuvliFR7/U6q5/dVyUbMbuCN fsA4u4tbcrGu+sSUpgeRXIzKPFCNN0TNESOVH2fMP5pMiuhpqCw0pSrUFxZ2DEodSHwoBiDZ kZPYY8et57mjticVwsH3tg4XAqFOE=; From: Adriaan Schmidt To: isar-users@googlegroups.com Cc: jan.kiszka@siemens.com, stefan-koch@siemens.com, Adriaan Schmidt Subject: [PATCH v4 1/3] module.inc: fix kbuild dependency Date: Tue, 14 May 2024 16:15:25 +0200 Message-Id: <20240514141527.1997170-2-adriaan.schmidt@siemens.com> In-Reply-To: <20240514141527.1997170-1-adriaan.schmidt@siemens.com> References: <20240514141527.1997170-1-adriaan.schmidt@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-526363:519-21489:flowmailer X-TUID: wujYzrAzZl63 This achieves two things: * Module builds now depend on linux-headers-*-native as build dependency. This is a minimal API change compared to the previous linux-headers-*. The dependency on the new linux-kbuild is kept hidden in linux-custom.inc * Remove the unconditional building of native kbuild when it is not needed, i.e. when we're not actually cross-building a module Signed-off-by: Jan Kiszka Signed-off-by: Adriaan Schmidt --- meta/recipes-kernel/linux-module/module.inc | 2 +- meta/recipes-kernel/linux/linux-custom.inc | 25 ++++++++++++++------- meta/recipes-kernel/linux/linux-distro.bb | 1 + 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc index eddbf177..229e6a5c 100644 --- a/meta/recipes-kernel/linux-module/module.inc +++ b/meta/recipes-kernel/linux-module/module.inc @@ -17,7 +17,7 @@ PN .= "-${KERNEL_NAME}" KERNEL_IMAGE_PKG ??= "linux-image-${KERNEL_NAME}" KERNEL_HEADERS_PKG ??= "linux-headers-${KERNEL_NAME}" -DEPENDS += "${KERNEL_HEADERS_PKG}" +DEPENDS += "${KERNEL_HEADERS_PKG}-native" DEBIAN_BUILD_DEPENDS = "${KERNEL_HEADERS_PKG}" SIGNATURE_KEYFILE ??= "" diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc index 0d222332..7b752f2b 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -116,11 +116,19 @@ HEADERS_DEPENDS:cross-profile = ", linux-kbuild-${KERNEL_NAME_PROVIDED}:${HOST_A # -native: kbuild package for host BUILD_PROFILES:class-native = "kbuild" -RECIPE_PROVIDES:class-native = "linux-kbuild-${KERNEL_NAME_PROVIDED}-native" +RECIPE_PROVIDES:class-native = " \ + linux-headers-${KERNEL_NAME_PROVIDED} \ + linux-kbuild-${KERNEL_NAME_PROVIDED}" +# Use pseudo target to pull in the base variant of the recipe. +# Will be auto-extended with -native by multiarch.bbclass. +RDEPENDS:class-native += "${BPN}-pseudo" # -kbuildtarget: kbuild package for target, enforcing non-cross-build BUILD_PROFILES:class-kbuildtarget = "kbuild" -RECIPE_PROVIDES:class-kbuildtarget = "linux-kbuild-${KERNEL_NAME_PROVIDED}" +RECIPE_PROVIDES:class-kbuildtarget = " \ + linux-headers-${KERNEL_NAME_PROVIDED} \ + linux-kbuild-${KERNEL_NAME_PROVIDED}" +RDEPENDS:class-kbuildtarget = "${BPN}" ISAR_CROSS_COMPILE:class-kbuildtarget = "0" # Make bitbake know we will be producing linux-image and linux-headers packages @@ -132,11 +140,15 @@ RECIPE_PROVIDES = " \ linux-libc-dev-${DISTRO_ARCH}-cross \ linux-image-${KERNEL_NAME_PROVIDED}-dbg \ linux-kbuild-${KERNEL_NAME_PROVIDED} \ + ${BPN}-pseudo-native \ " # When cross-profile is active: -# kbuild package is provided by -native or -kbuildtarget variant -# Otherwise it's provided by the default variant -RECIPE_PROVIDES:remove:cross-profile = "linux-kbuild-${KERNEL_NAME_PROVIDED}" +# kbuild package is provided by -native or -kbuildtarget variant. Also headers +# provisioning moves over to ensure those variants are pulled, although the +# package itself is still built by the base recipe. +RECIPE_PROVIDES:remove:cross-profile = " \ + linux-headers-${KERNEL_NAME_PROVIDED} \ + linux-kbuild-${KERNEL_NAME_PROVIDED}" # Append headers depends HEADERS_DEPENDS = ", linux-kbuild-${KERNEL_NAME_PROVIDED}" @@ -148,9 +160,6 @@ PROVIDES += "${RECIPE_PROVIDES}" # Append build profiles DEB_BUILD_PROFILES += "${BUILD_PROFILES}" -# Add dependency to build -kbuildtarget and -native automatically -RDEPENDS:append:cross-profile = " ${BPN}-native" - def get_kernel_arch(d): distro_arch = d.getVar("DISTRO_ARCH") if distro_arch in ["amd64", "i386"]: diff --git a/meta/recipes-kernel/linux/linux-distro.bb b/meta/recipes-kernel/linux/linux-distro.bb index bc43528c..13b8dc7e 100644 --- a/meta/recipes-kernel/linux/linux-distro.bb +++ b/meta/recipes-kernel/linux/linux-distro.bb @@ -10,6 +10,7 @@ python() { for kernel in distro_kernels.split(): d.appendVar('PROVIDES', ' linux-image-' + kernel) d.appendVar('PROVIDES', ' linux-headers-' + kernel) + d.appendVar('PROVIDES', ' linux-kbuild-' + kernel) if d.getVar('KERNEL_IMAGE_PKG'): d.appendVar('PROVIDES', ' ' + d.getVar('KERNEL_IMAGE_PKG')) if d.getVar('KERNEL_HEADERS_PKG'): -- 2.39.2