From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7325384040194768896 X-Received: by 2002:a92:b70b:0:b0:360:7244:6089 with SMTP id k11-20020a92b70b000000b0036072446089mr715567ili.43.1705573881409; Thu, 18 Jan 2024 02:31:21 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a92:6f0c:0:b0:361:a069:dba5 with SMTP id k12-20020a926f0c000000b00361a069dba5ls146832ilc.2.-pod-prod-03-us; Thu, 18 Jan 2024 02:31:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqAu4kjGFdTJ5aNol/dsMQYXmPMIodC1LfquZQfOwuZlfCcRlRL6fwKFhsEWraVecWvpJE X-Received: by 2002:a92:cb8e:0:b0:361:8a14:9607 with SMTP id z14-20020a92cb8e000000b003618a149607mr617495ilo.73.1705573880515; Thu, 18 Jan 2024 02:31:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705573880; cv=none; d=google.com; s=arc-20160816; b=YqtjXMkrBYP+EVkomYMyEQh0XaNfPwmWkBHdRdPTuN5uI+UyAWCljUklj7fI3ZLTAT 1rYjDLa09Eo9aJUHS30dDRmtCz74eApIE9QGhhwYxhO4MOaASW6I+d8vGiEIJPs6wMwQ AHyI3z6Abt2SyhVv8iOHD0rzWvhC+kq46NLCieKoL6TYzYzCBGZ9a5A5sFryAdXMnSVA h2FpxWlIa7jw29EK7j1jm78FdgFAwJ+fhDtd+v/pzbDob6d25FTvs9Kk5gmreQMoA6Ov 9cDCcXkwrjpLN0pMaLrrrZ3k/j4lVgAyi5t4XQIPjewgW1d7Zx6t9YcY7tSRZBVqPjHL XuaA== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=mkJBUpsBWrUNlrAT4xJzYW4pJRN5XmyPdzVUx/l8HdA=; fh=2vPEtVRFZgJExMSCfX53nKBFsjiPYp/60rbGy5S5Mwo=; b=QQSf5+0ejaLpQPzBtlnlwT0pXGzJ4aeQYRx6VMDJd4FkPlobH6KSTtbwhoFFWxi27n Zt9R6neI06K02hQiRC1BmCuUrfK4ozKq4DsUsZu9UwcCMnTqEayRdCG+VRf/LvEFQ0vK Nk3rsrBHUuhhDxOqynEluHRg4BaBA7cqD2rWvb8sf5bMAsT5wYz7RmlBvaEnxiKPje9b LeiCBRho1OisntrA5pg5GtKYjH9JuoVNOAY+fk0HU63iT1YzOzwJRaTC7bDGalYY6NEU WgHESCflgiihbHK11SFiUWwXPjHbXQ95i2vzI3qdQFZi3W4NcofAmEVD7PpQzoP63sHV AEDg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=UY0ooAoD; spf=pass (google.com: domain of fm-1321639-20240118103118177c89a60598eeb2f0-uya5vx@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) smtp.mailfrom=fm-1321639-20240118103118177c89a60598eeb2f0-UyA5vx@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net. [185.136.65.225]) by gmr-mx.google.com with ESMTPS id n8-20020a056e0208e800b00361928c606dsi306496ilt.2.2024.01.18.02.31.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 02:31:20 -0800 (PST) Received-SPF: pass (google.com: domain of fm-1321639-20240118103118177c89a60598eeb2f0-uya5vx@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) client-ip=185.136.65.225; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=UY0ooAoD; spf=pass (google.com: domain of fm-1321639-20240118103118177c89a60598eeb2f0-uya5vx@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) smtp.mailfrom=fm-1321639-20240118103118177c89a60598eeb2f0-UyA5vx@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 20240118103118177c89a60598eeb2f0 for ; Thu, 18 Jan 2024 11:31:18 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=felix.moessbauer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=mkJBUpsBWrUNlrAT4xJzYW4pJRN5XmyPdzVUx/l8HdA=; b=UY0ooAoDdqMY5ipeZZh0rh0Nobs3BpRUb3awwT+0kfrRF6FUGZYlWgzLBwBCZQDcLcU+ci y/bmOodkdmq9Ut19CCEejwe4N7RR72idhjdWeqa3iTiZavWRz0g7hWIgu8Smfm5SxTkFWyWa BTjzh+AOBqL1t4g8Y6p1XWShdluMc=; From: Felix Moessbauer To: isar-users@googlegroups.com Cc: jan.kiszka@siemens.com, Felix Moessbauer Subject: [PATCH 1/1] auto disable cross for kmod build against distro kernels Date: Thu, 18 Jan 2024 11:31:02 +0100 Message-Id: <20240118103102.658035-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1321639:519-21489:flowmailer X-TUID: 6HYFrza5xBaZ Cross compiling kernel modules for distro kernels is not supported in debian. To simplify downstream kernel module builds, we automatically turn off cross compilation for a user-provided module when building it for a distro kernel. This patch further replaces the hard-coded list of distro kernels with the DISTRO_KERNELS variable to avoid code duplication. Signed-off-by: Felix Moessbauer --- RECIPE-API-CHANGELOG.md | 6 +++++ .../example-module/example-module.bb | 22 ------------------- meta/recipes-kernel/linux-module/module.inc | 10 +++++++++ 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md index bea12871..b1e5a5ab 100644 --- a/RECIPE-API-CHANGELOG.md +++ b/RECIPE-API-CHANGELOG.md @@ -566,3 +566,9 @@ supported, but a warning is issued when it is used. Future versions will drop When building a custom kernel module, the `KBuild` file might be located in a subdirectory. To support this use-case, set `MODULE_DIR=$(PWD)/subdir` in the module build recipe. + +### Automatically disable cross for kmod builds against distro kernels + +Cross compiling kernel modules for distro kernels is not supported in debian. +To simplify downstream kernel module builds, we automatically turn of cross +compilation for a user-provided module when building it for a distro kernel. diff --git a/meta-isar/recipes-kernel/example-module/example-module.bb b/meta-isar/recipes-kernel/example-module/example-module.bb index 5ebed102..22f3cc47 100644 --- a/meta-isar/recipes-kernel/example-module/example-module.bb +++ b/meta-isar/recipes-kernel/example-module/example-module.bb @@ -5,28 +5,6 @@ # # SPDX-License-Identifier: MIT -# Cross-compilation is not supported for the default Debian kernels. -# For example, package with kernel headers for ARM: -# linux-headers-armmp -# has hard dependencies from linux-compiler-gcc-4.8-arm, what -# conflicts with the host binaries. -python() { - if d.getVar('KERNEL_NAME') in [ - 'armmp', - 'arm64', - 'rpi-rpfv', - 'amd64', - '686-pae', - '4kc-malta', - 'riscv64', - 'kernel', - 'kernel7', - 'kernel7l', - 'kernel8', - ]: - d.setVar('ISAR_CROSS_COMPILE', '0') -} - require recipes-kernel/linux-module/module.inc SRC_URI += "file://src" diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc index 269da6ae..eddbf177 100644 --- a/meta/recipes-kernel/linux-module/module.inc +++ b/meta/recipes-kernel/linux-module/module.inc @@ -28,6 +28,16 @@ SRC_URI += "file://debian/" AUTOLOAD ?= "" +# Cross-compilation is not supported for the default Debian kernels. +# For example, package with kernel headers for ARM: +# linux-headers-armmp +# has hard dependencies from linux-compiler-gcc-4.8-arm, what +# conflicts with the host binaries. +python() { + if d.getVar('KERNEL_NAME') in d.getVar('DISTRO_KERNELS').split(): + d.setVar('ISAR_CROSS_COMPILE', '0') +} + inherit dpkg TEMPLATE_FILES = "debian/control.tmpl \ -- 2.39.2