From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH 07/27] linux-module: Migrate to a bbclasss
Date: Mon,  3 Nov 2025 12:51:55 +0100	[thread overview]
Message-ID: <b54cc658f81da9891c9829a5b9a70e9bd49d394c.1762170735.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1762170735.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
"inherit linux-module" is shorter and a more common pattern compared to
OE/yocto. Keep the original .inc file as transitional helper, issuing a
warning when it's used with a migration suggestion.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../linux-module.bbclass}                     |  3 +-
 meta/recipes-kernel/linux-module/module.inc   | 85 ++-----------------
 2 files changed, 7 insertions(+), 81 deletions(-)
 copy meta/{recipes-kernel/linux-module/module.inc => classes-recipe/linux-module.bbclass} (97%)
diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/classes-recipe/linux-module.bbclass
similarity index 97%
copy from meta/recipes-kernel/linux-module/module.inc
copy to meta/classes-recipe/linux-module.bbclass
index d2a41766..57a5cf41 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/classes-recipe/linux-module.bbclass
@@ -5,8 +5,6 @@
 #
 # SPDX-License-Identifier: MIT
 
-FILESPATH:append := ":${FILE_DIRNAME}/files"
-
 DESCRIPTION ?= "Custom kernel module ${PN}"
 MAINTAINER ?= "isar-users <isar-users@googlegroups.com>"
 
@@ -35,6 +33,7 @@ DEB_BUILD_PROFILES += "${@'pkg.signwith' if bb.utils.to_boolean(d.getVar('KERNEL
 DEPENDS += "${@'module-signer secure-boot-secrets' if bb.utils.to_boolean(d.getVar('KERNEL_MODULE_SIGNATURES')) else ''}"
 DEBIAN_BUILD_DEPENDS .= "${@', module-signer, secure-boot-secrets' if bb.utils.to_boolean(d.getVar('KERNEL_MODULE_SIGNATURES')) else ''}"
 
+FILESPATH:append = ":${LAYERDIR_core}/recipes-kernel/linux-module/files"
 SRC_URI += "file://debian/"
 
 AUTOLOAD ?= ""
diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index d2a41766..52541a29 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -1,86 +1,13 @@
-# Custom kernel module recipe include
+# Transitional include for linux-module.bbclass
 #
 # This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2018
+# Copyright (c) Siemens AG, 2025
 #
 # SPDX-License-Identifier: MIT
 
-FILESPATH:append := ":${FILE_DIRNAME}/files"
+inherit linux-module
 
-DESCRIPTION ?= "Custom kernel module ${PN}"
-MAINTAINER ?= "isar-users <isar-users@googlegroups.com>"
-
-KERNEL_NAME ?= ""
-# directory with KBuild file (M=${MODULE_DIR})
-MODULE_DIR ?= "$(PWD)"
-
-PN .= "-${KERNEL_NAME}"
-
-KERNEL_IMAGE_PKG ??= "linux-image-${KERNEL_NAME}"
-KERNEL_HEADERS_PKG ??= "linux-headers-${KERNEL_NAME}"
-DEPENDS += "${KERNEL_HEADERS_PKG}-native"
-DEBIAN_BUILD_DEPENDS = "${KERNEL_HEADERS_PKG}"
-# Do not generate debug symbols packages, as not supported for modules
-DEB_BUILD_OPTIONS += "noautodbgsym"
-
-SIGNATURE_KEYFILE ??= "/usr/share/secure-boot-secrets/secure-boot.key"
-SIGNATURE_CERTFILE ??= "/usr/share/secure-boot-secrets/secure-boot.pem"
-SIGNATURE_HASHFN ??= "sha256"
-SIGNATURE_SIGNWITH ??= "/usr/bin/sign-module.sh"
-
-KERNEL_MODULE_SIGNATURES ??= ""
-
-# Define signing profile and dependencies if KERNEL_MODULE_SIGNATURES is set to "1"
-DEB_BUILD_PROFILES += "${@'pkg.signwith' if bb.utils.to_boolean(d.getVar('KERNEL_MODULE_SIGNATURES')) else ''}"
-DEPENDS += "${@'module-signer secure-boot-secrets' if bb.utils.to_boolean(d.getVar('KERNEL_MODULE_SIGNATURES')) else ''}"
-DEBIAN_BUILD_DEPENDS .= "${@', module-signer, secure-boot-secrets' if bb.utils.to_boolean(d.getVar('KERNEL_MODULE_SIGNATURES')) else ''}"
-
-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
-inherit per-kernel
-
-TEMPLATE_FILES = "debian/control.tmpl \
-                  debian/rules.tmpl"
-TEMPLATE_VARS += " \
-    KERNEL_NAME \
-    KERNEL_TYPE \
-    KERNEL_IMAGE_PKG \
-    KERNEL_HEADERS_PKG \
-    KCFLAGS \
-    KAFLAGS \
-    MODULE_DIR \
-    DEBIAN_BUILD_DEPENDS \
-    SIGNATURE_KEYFILE \
-    SIGNATURE_CERTFILE \
-    SIGNATURE_HASHFN \
-    SIGNATURE_SIGNWITH \
-    PN \
-    DEBIAN_COMPAT"
-
-# Add custom cflags to the kernel build
-KCFLAGS ?= "-fdebug-prefix-map=${CURDIR}=. -fmacro-prefix-map=${CURDIR}=."
-KAFLAGS ?= "-fdebug-prefix-map=${CURDIR}=."
-
-do_prepare_build() {
-    rm -rf ${S}/debian
-    cp -r ${WORKDIR}/debian ${S}/
-
-    deb_add_changelog
-
-    for module in ${AUTOLOAD}; do
-        echo "echo $module >> /etc/modules" >> ${S}/debian/postinst
-    done
+do_warn_custom_inc() {
+    bbwarn "Please migrate from \"require recipes-kernel/linux-module/module.inc\" to \"inherit linux-module\""
 }
+addtask warn_custom_inc before do_unpack
-- 
2.51.0
-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/b54cc658f81da9891c9829a5b9a70e9bd49d394c.1762170735.git.jan.kiszka%40siemens.com.
next prev parent reply	other threads:[~2025-11-03 11:52 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 11:51 [PATCH 00/27] Use more classes! 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 01/27] linux-custom: Drop redundant template inheritance 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 02/27] meta: Move INHERIT'ed classes into classes-global 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 03/27] meta: Move recipe-pulled classes into classes-recipe 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 04/27] meta-isar: " 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 05/27] linux-custom: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 06/27] meta-isar: Switch to linux-kernel class 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` 'Jan Kiszka' via isar-users [this message]
2025-11-03 11:51 ` [PATCH 08/27] meta-isar: Switch to linux-module class 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 09/27] kselftest: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 10/27] meta-isar: Switch to kselftest class 'Jan Kiszka' via isar-users
2025-11-03 11:51 ` [PATCH 11/27] u-boot-custom: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 12/27] meta-isar: Switch to u-boot class 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 13/27] optee-os[-tadevkit]-custom: Migrate to bbclass'es 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 14/27] meta-isar: Switch to optee-os[-tadevkit] classes 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 15/27] optee-client: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 16/27] meta-isar: Switch to optee-client class 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 17/27] trusted-firmware-a: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 18/27] meta-isar: Switch to trusted-firmware-a class 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 19/27] barebox: Add SPDX license identifiers 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 20/27] barebox: Move inherit dpkg into common .inc 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 21/27] barebox: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 22/27] meta-isar: Switch to barebox class 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 23/27] initramfs-hook: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 24/27] meta[-isar]: Switch to initramfs-hook class 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 25/27] container-loader: Migrate to bbclass'es 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 26/27] meta-isar: Switch to {docker,podman}-loader classes 'Jan Kiszka' via isar-users
2025-11-03 11:52 ` [PATCH 27/27] RECIPES-API-CHANGELOG: Document include to class conversion 'Jan Kiszka' via isar-users
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=b54cc658f81da9891c9829a5b9a70e9bd49d394c.1762170735.git.jan.kiszka@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.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