From patchwork Fri Nov 6 17:32:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Ashfield X-Patchwork-Id: 103315 Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1483.1793986359018134951 for ; Fri, 06 Nov 2026 09:32:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=rWV+3T+K; spf=pass (domain: gmail.com, ip: 209.85.217.49, mailfrom: bruce.ashfield@gmail.com) Received: by mail-vs1-f49.google.com with SMTP id ada2fe7eead31-7ce645a1c6aso584311137.3 for ; Fri, 06 Nov 2026 09:32:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793986358; x=1794591158; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=GnqJ0mQFpzTUbPrfx4zr7w9MuHZfFBbWszmSPP2CqOk=; b=rWV+3T+KEaOLeLvalkTHGb0TvSM4QvypymxJAJckv/shTnSQNlKtB5i9iL65dfuuI5 7UE/K86pK50wm2pVcL+oTwd7Rxa4JHybIfzN+6Lf0zC89SADEW8kIPQtRWBnrlYtsxUT 3lP/FvDmDMhxo2aDqnBbYlExAXvRjW3rgqhigBui1emNebVmjaEuvGq0KXmKgR5J/y+r +J75fEXeQ/6/UiPYusXbYkH5FB09ba5Rt2gbpFNNNWZyRJkh+UCiHM7PFPkb/kR4sEBS 68sNi3Rdvi3a/uo/HUEL2MDpw4/SczSN4kkHK8A0jinqe/BCC+YFKalFLHTFbAtPwQyO 9dHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793986358; x=1794591158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=GnqJ0mQFpzTUbPrfx4zr7w9MuHZfFBbWszmSPP2CqOk=; b=KG5OQjzW+62GBfzPOWKyFN0utz9bu48ooN0T0f8lJE46k3p5hsOSwAKnoV8Qgg34Wf bEwc8fxAVOiNJc7TyomGdMgTUBy9+7icWtpO5BZlqVB99hI9uITrbTuhhgHQDhw5mA3O ZlEP05oXW2dBEYJErw2c9Npba3DhBZXq0ASr3gg2iyARhMro4nFrHnVqum8woG3RDimd Mu6OYK4IuxybW7EYP2bxYKYjx+t9AdnmOtXjjuaMUs9CHSh0X5qPOvHrYna1n1pApXeu rw1wPBoNN9YkrnCQp4YAtLGz7Q/G9X0zA2KJ7mIPy/v/bPdfI2zmQFV6IOAZ6PfvfD3s c1BA== X-Gm-Message-State: APuU4Z/sUyVop78r1lXfp8ashG9eQXbt1FXA/zhsXwOOoUWhhgJgQJo9 tkn1XEPTrTGdcYqt5strdTgQ9vbyjgVtU8INF08n0vWxuxgrqCeRGJlTH8l5mYNK X-Gm-Gg: AYBFou1jrNnCiDAYneJQKsV/YObidJTH5bZ8aI7q/NwCuvVsUeadFs+GtVOUgG1LFlV Kt+nse/eW9vObr0HfU1OMBYfBkVdciigHkVC9/g+82xrgEMhdgI0SS57vEPMa4VW94XYgP6KTpB 0EWqhuk0iLjuYBWeQOtOAai2g0Fadnw/XnwiZIg8zxlhryRrL1IIEgM8ymMXOS3xRJ3RWRTptOj 0jq3gGNcGqk3iFSTvpDPKGJiNW6izLxiQaF3+LIKWDRbIKhQf6bgw33jLCm8i4KruwbfRv9ifXS P9o3FG8YO8jwL66uiCnrKgIiQGfSjagbC7jjD2QluugB4vtNHbBAUdL/5ovW3eSvyzuOcCoxLMt fPoQU7ennXvxqGtvyzsGmRmHWGjBOPXtMpYOZB9SS8eEM75bGu9N+TQzyoad5AvsjMdQ4gQ98wh vIO1Jd/sjCkT7pXbc03rsezTYRiGd7zgBx496q2RRPGhgoV0gUlVEXWzyI8kdsAZ4VdX8h+jllT flLV5z8VZFZtzfZDgiwZ0akCqzuHq6L+zLrtLBhmr21aUCV6Iuhe7bI6YJy1ZpWBolGocxVXbAt dIn2m95PBqP91FnHETZJALKBDLTSZdk9ckOh6yCz7oWerJ4nxDt7W12y/pmcAjYhdREOoOIOH9h 4JvhTAEbAvoNa1zcSYZUPBVSCcGslhGYvdVgywpfHGS9bGKAvdVtHW7l9xmW2WBLkcYepflOpdV 4rIbTtOQ9zUkaW+c6sRcIzp3LEKMJLnQP64m/JS5z8PAHVEYjMPQYP/r7EKHBNgblppoc= X-Received: by 2002:a05:6102:94d:b0:7a7:19aa:8a88 with SMTP id ada2fe7eead31-7d2a16e219cmr1941276137.35.1793986357617; Fri, 06 Nov 2026 09:32:37 -0800 (PST) Return-Path: Received: from bruce-XPS-8940.localdomain (pool-174-112-35-248.cpe.net.cable.rogers.com. [174.112.35.248]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99ba74a6964sm2335848241.0.2026.11.06.09.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2026 09:32:37 -0800 (PST) From: bruce.ashfield@gmail.com To: Richard Purdie , Adrian Freihofer Cc: openembedded-core@lists.openembedded.org Subject: [OE-core][RFC PATCH 01/08] kernel.bbclass: map the kernel build directory to KERNEL_SRC_PATH Date: Fri, 6 Nov 2026 12:32:28 -0500 Message-ID: <20261106173235.4155305-2-bruce.ashfield@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261106173235.4155305-1-bruce.ashfield@gmail.com> References: <20261106173235.4155305-1-bruce.ashfield@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 06 Nov 2026 17:32:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/249701 From: Bruce Ashfield kernel-arch's KERNEL_CC maps STAGING_KERNEL_DIR and STAGING_KERNEL_BUILDDIR to KERNEL_SRC_PATH, but the kernel itself builds in ${B}, which isn't mapped. Sources generated there (*.mod.c, asn1 parsers, data tables, etc) fall through to the generic debug prefix map, so the kernel's debug info is split across two roots, and those files are the only content of the kernel's ${PN}-src package. Map ${B} to KERNEL_SRC_PATH too. All of the kernel's debug source paths are then under /usr/src/kernel, and no ${PN}-src package is created for the kernel. The generated sources aren't packaged anywhere. They aren't needed to debug the kernel, and those that are of any use can be regenerated from the kernel source, where they land at the path the debug info expects. This is only done in kernel.bbclass, since other kernel-arch users (module-base, perf, make-mod-scripts) have their own mapping. Signed-off-by: Bruce Ashfield --- meta/classes-recipe/kernel.bbclass | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index 46da867a63..ab064bb085 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -246,6 +246,12 @@ UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" # Some Linux kernel configurations need additional parameters on the command line KERNEL_EXTRA_ARGS ?= "" +# The kernel builds out of tree in ${B}, which kernel-arch does not remap. +# Map it to KERNEL_SRC_PATH as well, so generated sources are recorded under +# the same root as the rest of the kernel and are not collected into a +# ${PN}-src package. The last matching prefix map wins. +KERNEL_CC:append = " -ffile-prefix-map=${B}=${KERNEL_SRC_PATH}" + EXTRA_OEMAKE += ' ARCH="${@oe.kernel.map_kernel_arch(d)}"' EXTRA_OEMAKE += ' CC="${KERNEL_CC}" LD="${KERNEL_LD}" OBJCOPY="${KERNEL_OBJCOPY}" STRIP="${KERNEL_STRIP}"' EXTRA_OEMAKE += ' HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"' From patchwork Fri Nov 6 17:32:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Ashfield X-Patchwork-Id: 103316 Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1484.1793986360082248024 for ; Fri, 06 Nov 2026 09:32:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=z6uURdV1; spf=pass (domain: gmail.com, ip: 209.85.217.41, mailfrom: bruce.ashfield@gmail.com) Received: by mail-vs1-f41.google.com with SMTP id ada2fe7eead31-7ce6cb4c6faso459272137.0 for ; Fri, 06 Nov 2026 09:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793986359; x=1794591159; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kvE6KWUywlNLc5Q3YCQD0nbxnKpwXn8czgROVdoU6U8=; b=z6uURdV1gKv4kw9ejTmKOEqGV9LJeb+4/HH4Oa7HCdHOiTyM9/7Eq5o3pxB0lALGZh Tz4Rz9S3LvIGLgEB63tp3TO7OLJooyFo4jl0fLzdyfi31KvSD43CqdvcclBttMeZ+Lvf nLYGGtvdvmCgl6r/AHlu9OFA3I0Uy46WTS6dqgVLx+Uze99mpvVI4KP1yNRtf8KvgVRC 5MkDo/xW6qvkff8+HhX+HBJTGG3xhRSAhCSB2JlJi3VykUwEHNn2IKBxJBOSOCT6Fsn4 oYUsAxOdD4ZloM9cYs6nwL7+o/j0PBoiiRaUeUKXEdSVkYdD3WsbQOBzK/iOmWMobqnP yboA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793986359; x=1794591159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=kvE6KWUywlNLc5Q3YCQD0nbxnKpwXn8czgROVdoU6U8=; b=WxtmO9jQKJ9Q/5oXIBq85xa0k8zUecQOCDAf7PS2xqXswL/fqfu3YkqoksGYI/CXe/ azndHZ8pBfEuEtusWj7lIyn6uS3D/khNT4zJdVamxF3w/8U5A61laVCnKlLEkh3UUjpC yTdu71TR0gdRFQ4bv6bCydkrEi54BWtMLvzpdwGldtss4k2Nd7gJ56BeRs5grJ3g2ZiO V/1Cwj40kUlln5nhaeAx8ZicvcbZAD7UlWgQW/GlWW6l7PZXkk5fbROrk+EWF/8XpJFX DjLtUJlACEe2lu6BUVXLNQ8wgM3reduDuLnnV/qTxAGr2kx/7l6E0gByAskELbzk6qUT lQqA== X-Gm-Message-State: APuU4Z982xmCiBMKjv0TVO80/G1z9EqQTEVTKJ9oKdJ2UdoOALjlpefG 1GE6hTUynlJOkIaQAg9NrpiPs/buswnNQxSNRiI+APwwZhWCuXzunHQCmTHOe9P6 X-Gm-Gg: AYBFou0CGr5KDY/hnXA1NFLFhe2RfRMZeQMAcZTBpvJjlkY79WnOAWt1/c3Ub8rH3td HyofOp23LNfiNzCa7SKvOtu4GvMIZCj6OcpotxLNyKRyQC3V5JgXMXNVRckcw4GkwWqkb0lNIOu I6TkKOkG7IS44XlhGRG2fus1fUGnyc6Q4oP55tky8oByIhrQrRnW9WlUN8nWUIon7oErWyOQHmf 6BXqQ1oIxv4q6tJYRaBHXOoW9AHP1Q+ZKEk/wIGk+BCk1/zroEOoRLrkvuVWyfkt6ZyaxQ9qyq3 BSQGVHTcVXZFRRruGbIYPNEcTDhb/61do//+mMKGlWUMw+IO3o7Ejbe0hlH7Czi40StXZ2v5Rsq YttyTctHDB7xOPcn7jHlO8PSGgAAMys+dhQUsk4JyplK9O+g6Au/uC1ShDAE6vu0xhj+fSvDTtN 9t+S650aTPL6rnZ5q6mAjkZHI6bJfGMH5yOWBjkq3V37D6w5dLc/qTdyWRMtHTgRVCKEzH0hGPV e/H8+PvRJ4NnYuKiDUMpYwY+3OX9Jwp/XLUwYNieha0TEDZph6OL3LncQX2+4nlblvFLG0LMDL3 iaBsaeajKWsCL3pPduyAAw5DsBSp+ukfCWU4J0u5E2mhBIXCerrOndCGhIQkUVzccMIOX+OFD1/ lDQ//P7yDDBsBEJHEbo9r4jbfEAD0dge6ntGozb77Kd8lGx2jfuolNK3XsolHGyPzKCQ6S5oNyY scUdnC83RDQ0omScFRWvgjt5Z2unByb52w8xy1AaSJ7TChSQ== X-Received: by 2002:a05:6102:448a:b0:7cb:70ed:ff90 with SMTP id ada2fe7eead31-7d2a164e350mr2026643137.26.1793986358671; Fri, 06 Nov 2026 09:32:38 -0800 (PST) Return-Path: Received: from bruce-XPS-8940.localdomain (pool-174-112-35-248.cpe.net.cable.rogers.com. [174.112.35.248]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99ba74a6964sm2335848241.0.2026.11.06.09.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2026 09:32:38 -0800 (PST) From: bruce.ashfield@gmail.com To: Richard Purdie , Adrian Freihofer Cc: openembedded-core@lists.openembedded.org Subject: [OE-core][RFC PATCH 02/08] kernel.bbclass: stage a manifest of the source files the build read Date: Fri, 6 Nov 2026 12:32:29 -0500 Message-ID: <20261106173235.4155305-3-bruce.ashfield@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261106173235.4155305-1-bruce.ashfield@gmail.com> References: <20261106173235.4155305-1-bruce.ashfield@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 06 Nov 2026 17:32:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/249702 From: Bruce Ashfield kernel-devsrc packages from the shared work directories and can't see the kernel's ${B}, so it has no way to know which parts of the tree the kernel for a given MACHINE was built from. kbuild already records that: every .cmd file lists the source and headers the compiler read for its object. Collect those paths (relative to ${S}) in do_shared_workdir, after the build, into kernel-source-files in STAGING_KERNEL_BUILDDIR. kernel-devsrc can then package the source needed to debug a kernel built for a specific MACHINE, without copying the whole tree. The new kernel_source_manifest function does it in three steps, and leaves each intermediate list in the recipe's temporary directory, so a wrong manifest can be traced back: - the .cmd files whose savedcmd starts with ${HOST_PREFIX} (the target compiler, optionally through ccache). Host programs (scripts/mod, scripts/kconfig, objtool) are built with the host compiler, and are not part of the kernel. - every path under ${S} those files name. - the paths normalized with realpath, since some sources are included with ../ (kernel/bpf includes tools/lib/bpf), and kept only if they are regular files in ${S}. Signed-off-by: Bruce Ashfield --- meta/classes-recipe/kernel.bbclass | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index ab064bb085..f7910fbdee 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -538,6 +538,44 @@ emit_depmod_pkgdata() { PACKAGEFUNCS += "emit_depmod_pkgdata" +# Print, relative to ${S}, the source files the target compiler read, from +# kbuild's .cmd files. The intermediate lists are left in ${T}. +kernel_source_manifest() { + ( + cd ${B} + # The .cmd files hold millions of lines: a UTF-8 locale is ~40x slower + export LC_ALL=C + + cmds=${T}/kernel-source-cmds + paths=${T}/kernel-source-paths + + # The .cmd files of objects built with the target compiler, matching: + # savedcmd_kernel/fork.o := x86_64-poky-linux-gcc -fuse-ld=bfd ... + # savedcmd_kernel/fork.o := ccache x86_64-poky-linux-gcc ... + target_cc="^savedcmd_[^ ]+ := ([^ ]*ccache )?${HOST_PREFIX}" + find . -name '.*.cmd' -exec grep -l -E "$target_cc" {} + > $cmds + + # Every path under ${S} they name, matching (dedup before the regex): + # source_kernel/fork.o := ${S}/kernel/fork.c + # ${S}/include/linux/types.h + # ... -I${S}/include -include ${S}/include/linux/kconfig.h ... + # Directories and other non-files are dropped below. + xargs -r grep -hF "${S}/" < $cmds | sort -u | \ + grep -o "${S}/[^ ]*" | sort -u > $paths + + # Normalized relative to ${S}, for example: + # ${S}/arch/x86/boot/compressed/../../../../lib/ctype.c -> lib/ctype.c + # and kept only if they are regular files inside ${S}. + xargs -r realpath -m --relative-to=${S} < $paths | \ + grep -v '^\.\./' | sort -u | \ + while read f; do + if [ -f "${S}/$f" ]; then + echo "$f" + fi + done + ) +} + do_shared_workdir[cleandirs] += " ${STAGING_KERNEL_BUILDDIR}" do_shared_workdir () { cd ${B} @@ -605,6 +643,9 @@ do_shared_workdir () { fi fi + # The source files this kernel was built from, for kernel-devsrc + kernel_source_manifest > $kerneldir/kernel-source-files + # When building with CONFIG_MODVERSIONS=y and CONFIG_RANDSTRUCT=y we need # to copy the build assets generated for the randstruct seed to # STAGING_KERNEL_BUILDDIR, otherwise the out-of-tree modules build will From patchwork Fri Nov 6 17:32:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Ashfield X-Patchwork-Id: 103317 Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1485.1793986360893605479 for ; Fri, 06 Nov 2026 09:32:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=gHNCOs50; spf=pass (domain: gmail.com, ip: 209.85.222.43, mailfrom: bruce.ashfield@gmail.com) Received: by mail-ua1-f43.google.com with SMTP id a1e0cc1a2514c-9909e82513fso550383241.0 for ; Fri, 06 Nov 2026 09:32:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793986360; x=1794591160; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=e8LpKTU6it2L8eanVeCEE+/sIV0Elm5cOljaThuddZc=; b=gHNCOs50VnMfev5YOc2p1a5xpx2FON0NSm4xM54sOnbU4vkXQ8CSSjldkVPBdeXpvD 4mjKzu4siRkkLCU9vikRCx5xFNw1oNYm3KG4U64EnBZHgJsHlH+sBm/Zh07oicVoeeaT s2F8sgjQDJNxIMGnabsGGTks/72GtAcRKGcNvspbhU2qU+y+hSH0wBv3pC1RfP9K8lH1 hCFd5982m4jV0sY0xkLYfCFRFFgx10TXYyfXNHgduuCwuMl+D5036S0680ztFj+qZJzS CeMAk/0NoICPDgJHkDCofXMReXM6XleF5kngVyQITYUlRmwfHxgGyQTlX5aMtE0fzYR9 VNSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793986360; x=1794591160; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=e8LpKTU6it2L8eanVeCEE+/sIV0Elm5cOljaThuddZc=; b=oyFy0N6qEwihKrYg+yLISxDfVyjhMXqxmDrR5Oejw4TvP9HomjIrV8j1TiD11Z/gH1 JBdqOjXZsF9yUy2GTSeJTey2m/OWEomU6djpNHvjYU7P1yulyRfRbhb1BU0Hi0hG58uS ZvqJxtCAfzHBwOsQWVPhObePNDrk14Z79UJD8YnSGVcxrQ0dCmBWrzRZ6IzxEy865wd6 IdQPO+jLNyfXR9FMAwsz/+iiiDUozrxW3VKDOURoDW4//Y/MP9XsATPFWqxBgX7NRjzW sxLJAzkmoTybWiZFHfoSLZ9wY+erPgGUngATI1wdtecduRdDjie3/0gVGT5v7zpgXwJZ 8KPQ== X-Gm-Message-State: APuU4Z9VMoeX23Ia8Gwf3WAyz3lAs9TYLo2sKyhf4+xgIq0A36d/TqNX P+2ARvwi0IFjAQy0JYEkpRncG/CLp7mAmi7Vfmz7O3pvR8tjGz/s41d+ X-Gm-Gg: AYBFou2/zoEdjqk5b4NlrMFa6Np8QPLBpUZyE8BitEakLh08cZFuU8YwJBSln5k19uD O8ZOkDnqb1N/N/p9FsweX9vk8ApIb95UJoHBRv3CHaIisU/PbA+NkvVoYnoBMGkOVm8yGDo58Hf 0C9WJJhVDqiz1fzjOmNPSGcYvroBp/jP9vRMXGbGDvrlPWUW3EJd1ul1kmF9w5Muc+5yvkxXtTG e4Rrdr0QuCtB7Gq/neqYGM1nnlhzfko7dc7B/aqWplBLb6bfjOLFxBLp3rGlDP3Cknvla2NfJ4v q0hlNJ+a5zeXVZcwCe2jgm7lyYmaCO0nWyWWNUwKuKQN8rjS4J6ddbJ6XeRKBUlCg6UTNOplReZ XeTu77K8rQFwmjBR2DzpkOMdL30Gheqn2odiKoX3Hbb7hFg6ZZmxrKvRqWLtQFVbFY0wpO9jB7t AQ0uO9xRlkiuW3FW8wWC7KnQNWrihZpJrSEHedbhVkugTd9oWxtAcbvHYvdh6Z7jnV1s9mkdW8g IL1uVzSqHJgbp3bTn2BsFDx/YfwYd5D+sjQQDcRimS8WjWefIehHYZoTr50caTUYNoTZ135cUkB iZQXMVm0m23vOeQRvLAJf7+UH/WkcK6zG1nNN7sQjroL77a7VhMYNMSsNYmeopAL6h81Y8KKqid YFHE5jCfgUhwJ7Zakxy/J0pwYweqmJoyJFqgVF0kFY5qHHUZcnRP05nWY1qVF3CtSOqWLlJy91P ucdDTQb/5HIOXu3AnIVzqIbqCkmt7t4STWc1YfJTkcwaBtHFw= X-Received: by 2002:a05:6102:c94:b0:7ce:a873:731e with SMTP id ada2fe7eead31-7d286ae0c00mr2842727137.29.1793986359576; Fri, 06 Nov 2026 09:32:39 -0800 (PST) Return-Path: Received: from bruce-XPS-8940.localdomain (pool-174-112-35-248.cpe.net.cable.rogers.com. [174.112.35.248]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99ba74a6964sm2335848241.0.2026.11.06.09.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2026 09:32:39 -0800 (PST) From: bruce.ashfield@gmail.com To: Richard Purdie , Adrian Freihofer Cc: openembedded-core@lists.openembedded.org Subject: [OE-core][RFC PATCH 03/08] kernel-devsrc: add build and source PACKAGECONFIG levels Date: Fri, 6 Nov 2026 12:32:30 -0500 Message-ID: <20261106173235.4155305-4-bruce.ashfield@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261106173235.4155305-1-bruce.ashfield@gmail.com> References: <20261106173235.4155305-1-bruce.ashfield@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 06 Nov 2026 17:32:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/249703 From: Bruce Ashfield Debugging the kernel from a debug rootfs needs its source at /usr/src/kernel, where the debug info points, but kernel-devsrc only carries what is needed to build modules, and installing it pulls in the build tools (bc, bison, flex, gcc-plugins, openssl-dev, ...). Split the content of the one kernel-devsrc tree into PACKAGECONFIG levels instead of adding a second source package: build: today's content and RDEPENDS ('make scripts prepare' on target). The default, so nothing changes for existing users. source: a curated spine (KERNELDEV_SOURCE_SPINE plus arch/${ARCH}) and the drivers/sound files the kernel build read, taken from the kernel's kernel-source-files manifest. Only source files are copied, never scripts, so there are no runtime or file dependencies. The RDEPENDS are split out, so they are only added when the 'build' level is enabled. Signed-off-by: Bruce Ashfield --- meta/recipes-kernel/linux/kernel-devsrc.bb | 107 +++++++++++++++------ 1 file changed, 80 insertions(+), 27 deletions(-) diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb index 90bdbfc534..3b83fd145c 100644 --- a/meta/recipes-kernel/linux/kernel-devsrc.bb +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb @@ -28,30 +28,31 @@ B = "${STAGING_KERNEL_BUILDDIR}" PACKAGE_ARCH = "${MACHINE_ARCH}" +# The flags choose what goes in the kernel-devsrc tree: +# build: what is needed to build out of tree modules against the kernel +# ('make scripts prepare' on target). The default, and what +# kernel-devsrc has always been. +# source: the source needed to debug a kernel built for a specific +# MACHINE, see KERNELDEV_SOURCE_SPINE. No runtime dependencies, +# so it can go in a debug rootfs without the build tools. +PACKAGECONFIG ?= "build" +PACKAGECONFIG[build] = ",,,${KERNELDEV_BUILD_RDEPENDS}" +PACKAGECONFIG[source] = ",," + +# The curated part of the 'source' level, copied in full along with +# arch/${ARCH}. The rest (drivers, sound, samples, ...) is not curated: the +# files the kernel build read are discovered from the manifest the kernel +# stages in do_shared_workdir. The manifest could find the spine's files too, +# but the spine is listed so that 'source' always has a sane default. +KERNELDEV_SOURCE_SPINE ?= "block certs crypto fs include init io_uring ipc kernel lib mm net security virt" + KERNEL_BUILD_ROOT = "${nonarch_base_libdir}/modules/" -do_install() { +# The 'build' level: what is needed to build out of tree modules against the +# kernel ('make scripts prepare' on target), and what kernel-devsrc has +# always contained. +kernel_devsrc_install_build() { kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION} - install -d $kerneldir - - # create the directory structure - rm -f $kerneldir/build - rm -f $kerneldir/source - mkdir -p $kerneldir/build - - # for compatibility with some older variants of this package, we - # create a /usr/src/kernel symlink to /lib/modules//source - mkdir -p ${D}/usr/src - ( - cd ${D}/usr/src - ln -rs ${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}/source kernel - ) - - # for on target purposes, we unify build and source - ( - cd $kerneldir - ln -s build source - ) # first copy everything ( @@ -448,7 +449,58 @@ do_install() { sed -i 's,/usr/bin/env python2,/usr/bin/env python3,' "$ss" sed -i 's,/usr/bin/python$,/usr/bin/env python3,' "$ss" done +} + +# The 'source' level: the curated spine plus the files the kernel build read, +# from the manifest the kernel stages in do_shared_workdir. Only source files +# are copied, never scripts, so the package gets no interpreter dependencies. +kernel_devsrc_install_source() { + kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION} + if [ ! -s ${B}/kernel-source-files ]; then + bbfatal "${B}/kernel-source-files is missing, the kernel did not stage its source manifest" + fi + ( + cd ${S} + { + find ${KERNELDEV_SOURCE_SPINE} arch/${ARCH} -type f + cat ${B}/kernel-source-files + } | grep -E '\.([chS]|rs)$' | sort -u | cpio --quiet -pdlu $kerneldir/build + ) +} + +do_install() { + kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION} + install -d $kerneldir + + # create the directory structure + rm -f $kerneldir/build + rm -f $kerneldir/source + mkdir -p $kerneldir/build + + # for compatibility with some older variants of this package, we + # create a /usr/src/kernel symlink to /lib/modules//source + mkdir -p ${D}/usr/src + ( + cd ${D}/usr/src + ln -rs ${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}/source kernel + ) + + # for on target purposes, we unify build and source + ( + cd $kerneldir + ln -s build source + ) + + if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'build', '1', '', d)}" ]; then + kernel_devsrc_install_build + fi + + # The 'source' level goes in the same tree, at /usr/src/kernel, which is + # where the kernel's debug info points. + if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'source', '1', '', d)}" ]; then + kernel_devsrc_install_source + fi chown -R root:root ${D} } @@ -457,14 +509,15 @@ do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock" FILES:${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH}" -RDEPENDS:${PN} = "bc python3-core flex bison ${TCLIBC}-utils gawk" +# Added to RDEPENDS:${PN} by the 'build' PACKAGECONFIG +KERNELDEV_BUILD_RDEPENDS = "bc python3-core flex bison ${TCLIBC}-utils gawk" # 4.15+ needs these next two RDEPENDS -RDEPENDS:${PN} += "openssl-dev util-linux" +KERNELDEV_BUILD_RDEPENDS += "openssl-dev util-linux" # and x86 needs a bit more for 4.15+ -RDEPENDS:${PN} += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-dev', '', d)}" +KERNELDEV_BUILD_RDEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-dev', '', d)}" # powerpc needs elfutils on 6.3+ -RDEPENDS:${PN} += "${@bb.utils.contains('ARCH', 'powerpc', 'elfutils-dev', '', d)}" +KERNELDEV_BUILD_RDEPENDS += "${@bb.utils.contains('ARCH', 'powerpc', 'elfutils-dev', '', d)}" # 5.8+ needs gcc-plugins libmpc-dev -RDEPENDS:${PN} += "gcc-plugins libmpc-dev" +KERNELDEV_BUILD_RDEPENDS += "gcc-plugins libmpc-dev" # 5.13+ needs grep for powerpc -RDEPENDS:${PN}:append:powerpc = " grep" +KERNELDEV_BUILD_RDEPENDS:append:powerpc = " grep" From patchwork Fri Nov 6 17:32:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Ashfield X-Patchwork-Id: 103318 Received: from mail-vk1-f171.google.com (mail-vk1-f171.google.com [209.85.221.171]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1486.1793986361863078915 for ; Fri, 06 Nov 2026 09:32:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=IoRTrJio; spf=pass (domain: gmail.com, ip: 209.85.221.171, mailfrom: bruce.ashfield@gmail.com) Received: by mail-vk1-f171.google.com with SMTP id 71dfb90a1353d-5ecbfea5f51so323567e0c.2 for ; Fri, 06 Nov 2026 09:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793986361; x=1794591161; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=aDhEWO18MKU8WKrMKeMpDYCCVNLUn9W+bJyUoWa8RlI=; b=IoRTrJiovvIu+mAAbAwiDvTX0V0P5fsbwwYSO1yKqVVVLlwjM6mnrUaeXHaDd4j5yw S4v+F9qSFTQRqRS67232sKK+v72kwAGLWIDQJMbNXHHIaOVfBNQPHnfPnsHiKbu3Rj0U W1ntFGWrXjMLKNmBGe9WAf+VhQy+Hf5g8lJ1ZrRkll4/ObfJk+Fd9pMs14Vk9z/S0k6n dKUR1p/co5i+8NGmW4eJDMWL8IVFLxqS56vwVtg9AfOtVTsvhv2TG9N1QVKlYFVtBIWE tDvhzPwBYOgFBIZRoLsjFCKFaW0PwLnCGHB4cNeJzfh4FXpdG7z/LJcFSRatnQukKWCR i/Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793986361; x=1794591161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=aDhEWO18MKU8WKrMKeMpDYCCVNLUn9W+bJyUoWa8RlI=; b=vZ+zDrctkpv3GSigYjWL9NjDO+SNrQ0+DIz8EExGlX/ElpDKUegbwuIt1lWDYLGIo2 XcT+l0ha3kzAkMs6kih+is2IYE9h/IagZPjo82YEpdTPlyBdilBMYK1G9ld6iUqB1U9C Saq9FYue6G2G8ZxaruZt5GaYi9j99yKeeL0UMS4hYkAXaXQTecv7olM/gju5jm9ghIyq EV2TOg5r4LjTKrnbL/XsD9Bjqd0Au9NWHiaJ+TFwLR529whhj5RGVOOZSETFRSADbZoW CaJd5D0bC9YnZUUodsXJMIyQ0DbguCx2q7BmSF8avqtUluni9GncgDK0V/7wli3/uYXv aKvw== X-Gm-Message-State: APuU4Z9nBVwZB5/YF0xWD2zyZYLE8nLD6C3uWhJGovdETL6gwHV6urjC FWw/5goQqIorqp4DalEgycYTBqmm7Wsu88GxnSmMdhFSOSplOZ1m9k4n X-Gm-Gg: AYBFou3fekbuYeeiEn8D0T8cMuXASXvA0TM8I1iKQcVZS+5wJVs7PRHZzBXLGQyVn6a ikGQ2T2GXG8+RH0uKP7bbG9SWunWfEjlcyN1q1s4zaE4SJK7AVSRix2n6dciNqwhHqOM4zNKd8y gsMaxJw7Rwx09IyrJ+fVuImF02K/OXd1BI1zIMX9k5YznDGpE7JujmF1KLdfUjwIrKWsJMm+LNo VGJjShPw69LBSMuAjXuo0+PdquLMQz2Gv7eZ4YQ27/Olx3GbppeKjdnSHqbzethJ3owoz1IU/Dp oWVHibvAtcGIQ5rvPNeyMIwUyYbF7x3KBXgfX5Vk+9fF6ooHF9P8M3zX1AKcVcmJcYPfNYu4FXg Jo6eEdXi94QpIuRhaFbObSakyHnhHb9hwr9qjENaPnKuD3TsognBh0jqhn5gkJ0smfYhPDaUXti cr4XuOGh4H+NT96dy/KaAKuzVDM0J3ZG8/nJ5P6rOqvblGP7O0ah5UqYHuGAGZsRTtTRuMPIY58 sq4b8uy9Lq9CcaQw1th46QawtSu00BFNJsQEu2wt3svZXOLXhGZM/QInYPHdBffUr9MHvglR0RA KY+75k7MWYNOQG8XIq/dZCfAtvkGF5U4fQeBX4IXz33mjgLT1jGtkBa+sZqCXE1YWlXfbQ9VqsD X2onwRJxWT0kxx4inGr9t+Mj9dRsZonbbnQ4aFLVzIeqHXXIJ+/uqVWxMBNfHGwaOJoSeDjdLKi xdMEo4oEJf9UvrslKMYDVCYqWnh7t5Vp+NTRYHlVCwwFE4Ei4= X-Received: by 2002:a05:6122:2805:b0:5ea:fae8:e69e with SMTP id 71dfb90a1353d-5ecc43ed9d1mr1529079e0c.11.1793986360376; Fri, 06 Nov 2026 09:32:40 -0800 (PST) Return-Path: Received: from bruce-XPS-8940.localdomain (pool-174-112-35-248.cpe.net.cable.rogers.com. [174.112.35.248]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99ba74a6964sm2335848241.0.2026.11.06.09.32.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2026 09:32:40 -0800 (PST) From: bruce.ashfield@gmail.com To: Richard Purdie , Adrian Freihofer Cc: openembedded-core@lists.openembedded.org Subject: [OE-core][RFC PATCH 04/08] kernel-devsrc: add full and tarball PACKAGECONFIG levels Date: Fri, 6 Nov 2026 12:32:31 -0500 Message-ID: <20261106173235.4155305-5-bruce.ashfield@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261106173235.4155305-1-bruce.ashfield@gmail.com> References: <20261106173235.4155305-1-bruce.ashfield@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 06 Nov 2026 17:32:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/249704 From: Bruce Ashfield The 'source' PACKAGECONFIG packages what a debugger needs to debug a kernel built for a specific MACHINE. Other use cases need the entire tree, either installed in a rootfs or as a package on a feed. Add two more levels to the same kernel-devsrc tree: full: the whole source tree (without the git metadata), a superset of 'source', uncompressed at /usr/src/kernel. tarball: the whole tree as /usr/src/kernel-source-.tar.bz2 instead of uncompressed. It can't be debugged or built against, it is a copy to unpack elsewhere. The scripts in a 'full' tree are not run from it, so unless 'build' is also enabled, file dependencies are skipped for the package. Otherwise it pulls in perl, python3, make, etc, and can fail to install when an interpreter path isn't provided (/bin/awk on usrmerge). With 'build', the file dependencies are kept, so a few scripts in the tree that use #!/bin/awk or #!/bin/env (arm64 and x86 awk tools, selftests) would make kernel-devsrc uninstallable: no package provides those paths. Point them at ${bindir}, as the 'build' level already does for the arm64 awk tools. The package QA file-rdeps check doesn't catch this, since it is skipped for module-base recipes. With 'build' and the whole tree ('full', or 'tarball' unpacked on the target), more than 'make scripts prepare' can be built from it (the kernel itself, modules_install, compressed images and modules, module signing), so add the tools those run that aren't found by file dependencies: perl, kmod, cpio, tar, gzip, xz, zstd, lz4 and openssl. This is a fixed list, not derived from the kernel's configuration. pahole (for BTF) isn't in oe-core, so it isn't included. 'tarball' adds bzip2 on its own: unpacking the tarball is the only use of it, and tar runs bzip2 to do that. Signed-off-by: Bruce Ashfield --- meta/recipes-kernel/linux/kernel-devsrc.bb | 70 ++++++++++++++++++++-- 1 file changed, 66 insertions(+), 4 deletions(-) diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb index 3b83fd145c..46337bd79b 100644 --- a/meta/recipes-kernel/linux/kernel-devsrc.bb +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb @@ -35,9 +35,20 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" # source: the source needed to debug a kernel built for a specific # MACHINE, see KERNELDEV_SOURCE_SPINE. No runtime dependencies, # so it can go in a debug rootfs without the build tools. +# full: the whole source tree (a superset of 'source'). +# tarball: the whole source tree as /usr/src/kernel-source-.tar.bz2, +# in place of the uncompressed tree from 'full'. Not usable by +# debuggers or for building, it is a copy to unpack elsewhere. PACKAGECONFIG ?= "build" PACKAGECONFIG[build] = ",,,${KERNELDEV_BUILD_RDEPENDS}" PACKAGECONFIG[source] = ",," +PACKAGECONFIG[full] = ",," +PACKAGECONFIG[tarball] = ",,,bzip2" + +# The scripts in a 'full' tree are not run from it, so unless 'build' needs +# them, don't generate runtime dependencies from their interpreters (perl, +# python3, make, ...). +SKIP_FILEDEPS:${PN} = "${@'1' if bb.utils.contains('PACKAGECONFIG', 'full', True, False, d) and not bb.utils.contains_any('PACKAGECONFIG', 'build tarball', True, False, d) else '0'}" # The curated part of the 'source' level, copied in full along with # arch/${ARCH}. The rest (drivers, sound, samples, ...) is not curated: the @@ -469,6 +480,45 @@ kernel_devsrc_install_source() { ) } +# The files of the whole source tree, NUL separated, for 'full' and +# 'tarball'. Run from ${S}. The git metadata and kernel-meta are left out. +kernel_devsrc_tree_files() { + find . -type d -name '.git*' -prune -o -type d -name '.kernel-meta' -prune -o -type f -print0 +} + +# The 'full' level: the whole source tree, without the git metadata. +kernel_devsrc_install_full() { + kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION} + + # With 'build' also enabled, this runs after it and copies over the + # source files it installed (cpio -u). Most are identical, but the + # 'build' level's customizations are lost: scripts/package/debian/rules + # comes back, and the arm64 awk and python shebang fixups are undone (the + # awk ones are redone below). Generated files from ${B} aren't in ${S}, so + # they are kept. Skipping the files 'build' installed isn't worth the + # complexity: 'full' is meant to be the whole tree. + ( + cd ${S} + kernel_devsrc_tree_files | cpio --quiet --null -pdlu $kerneldir/build + ) + + # The whole tree brings in scripts the 'build' level doesn't copy, and + # some use #!/bin/awk or #!/bin/env, which no package provides. Point them + # at ${bindir}, keeping their arguments (awk -f). sed -i writes a new file, + # so the hardlinks into ${S} are not modified. + grep -rlZE '^#! */bin/(awk|env)( |$)' $kerneldir/build | \ + xargs -0 -r sed -i -E -e '1s,^#! */bin/(awk|env)( |$),#!${bindir}/\1\2,' +} + +# The 'tarball' level: the whole source tree, compressed. +kernel_devsrc_install_tarball() { + ( + cd ${S} + kernel_devsrc_tree_files | \ + tar --null --no-recursion -cjf ${D}/usr/src/kernel-source-${KERNEL_VERSION}.tar.bz2 --files-from - + ) +} + do_install() { kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION} install -d $kerneldir @@ -496,18 +546,25 @@ do_install() { kernel_devsrc_install_build fi - # The 'source' level goes in the same tree, at /usr/src/kernel, which is - # where the kernel's debug info points. - if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'source', '1', '', d)}" ]; then + # The source levels go in the same tree, at /usr/src/kernel, which is + # where the kernel's debug info points. 'full' is a superset of 'source', + # and 'tarball' replaces the uncompressed 'full' tree. + if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'full', '1', '', d)}" ] && + [ -z "${@bb.utils.contains('PACKAGECONFIG', 'tarball', '1', '', d)}" ]; then + kernel_devsrc_install_full + elif [ -n "${@bb.utils.contains('PACKAGECONFIG', 'source', '1', '', d)}" ]; then kernel_devsrc_install_source fi + if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'tarball', '1', '', d)}" ]; then + kernel_devsrc_install_tarball + fi chown -R root:root ${D} } # Ensure we don't race against "make scripts" during cpio do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock" -FILES:${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH}" +FILES:${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH} /usr/src/kernel-source-*.tar.bz2" # Added to RDEPENDS:${PN} by the 'build' PACKAGECONFIG KERNELDEV_BUILD_RDEPENDS = "bc python3-core flex bison ${TCLIBC}-utils gawk" @@ -521,3 +578,8 @@ KERNELDEV_BUILD_RDEPENDS += "${@bb.utils.contains('ARCH', 'powerpc', 'elfutils-d KERNELDEV_BUILD_RDEPENDS += "gcc-plugins libmpc-dev" # 5.13+ needs grep for powerpc KERNELDEV_BUILD_RDEPENDS:append:powerpc = " grep" +# With the whole tree as well ('full', or 'tarball' unpacked on target), more +# than 'make scripts prepare' can be built: a whole kernel, modules_install, +# compressed images and modules, module signing. +KERNELDEV_FULL_BUILD_RDEPENDS = "perl kmod cpio tar gzip xz zstd lz4 openssl" +KERNELDEV_BUILD_RDEPENDS += "${@bb.utils.contains_any('PACKAGECONFIG', 'full tarball', '${KERNELDEV_FULL_BUILD_RDEPENDS}', '', d)}" From patchwork Fri Nov 6 17:32:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Ashfield X-Patchwork-Id: 103319 Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.45]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1454.1793986362619698978 for ; Fri, 06 Nov 2026 09:32:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=vkyOiOhx; spf=pass (domain: gmail.com, ip: 209.85.217.45, mailfrom: bruce.ashfield@gmail.com) Received: by mail-vs1-f45.google.com with SMTP id ada2fe7eead31-7a6e560f580so641288137.1 for ; Fri, 06 Nov 2026 09:32:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793986361; x=1794591161; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=y90kFveby8FF6WuOtb+2jm9NE8wu830ZG3ljZvDpM/4=; b=vkyOiOhxV8b3sUGGMoCHVtyuf0ROeodxDeu4utClIQgtz2wOcMrTk2WpsrV8hxyDlA 1S5jLWQTnAOOLd9oFaaoHqnhDDWhs7sqanPLHhOsECx2yEWKSOXmHFgtRpMmt9B+7VgY /ZiQXEO45SIo54Xg1JEfx8hrrqWIPF3d7ME21lj9pkm5g13fVaRv+fxoRr9ffigLD7Tn KwuGnUg7Zdi1iFsJDw0gLbQGP6VV3JhQ7n3wLEtbEjD+xq3mjbaMX0/wbAU50Cw5/FEE gX1pK4GVpcFPP+KS3bpE5oDOTRWhyKUAjSpqI6eOp+Hu+EedwOVa9PlEeYWkB5bOlEyf miVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793986361; x=1794591161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=y90kFveby8FF6WuOtb+2jm9NE8wu830ZG3ljZvDpM/4=; b=AhUF5HXeYmk6S8MK5OfCaaEZGJILS1dRF/pqLunLRiQHzdMBBzzCKUEv+ER414NBhl j7O/FHXKzcjGXu6rzNdUn4mM+dSOx9I//aD3DD2cqJU1phe7glDjRQwYba1tCKSfeQ4r 9X77DsvvBXRtZHAykmjpAciDjztYdr7GA/ra8aAOIUmRMyCr2iNWL2DO6ydczJ4UEEIB gxf2sYg5lmScR5FvlPv/U/rYMOF5IqWirY/JTw9g/W+2wG+gNy/gde/ejZ8XtpkdmZ7I tJ12OBvF5jJxEL+ErvY1VI4mjdYCRCwh47U7d9yUEL11+RlcvAQ+WysJlHJnNJBmB1nF hcmg== X-Gm-Message-State: APuU4Z9vVGF6DJ86jEllihU15MLvH2cIQn7NwgK8tThv8ZWYG8hm8QS6 aLvtW9dV7iDA0CzZHZu0/SEuBhMu7OuudZuT0gZXObwB6+r25aQL/Ysc X-Gm-Gg: AYBFou1SPXxYoXOmt/sC6jBODafUHbEuZAnQjyn/IOvAfDc5gCNiY6tPaOXAudp2c6Q yOUNSEkIDlG8AVM+4kcAgw3Y8F9EXeg6mJlSnYdeq0hS8Gnm2I1F5H+4G5i8UYkO33MrvKB5B+R 3gdoea0V+eXw0Mmgl19x9O2VyKtk7VzmfMQU+u9oqrndrhj8+veksmLa1eQIWX1cpvv7KDpt5od JIkPvMz3tJ6NCF3q9J2FZGa/dbq2wwUpwjszC87onHlwvM66GNXEsnbT81tBpQzMWVqDIK2+k2e N/eUO6ZhX20UDlLLNn5owTWl9a7p6TzfaDnppAeTfRbFDUUiYqnmPQB6ZTiMv3CNgarC0Kt+als D6MjVz89pdvK1zHbPH8EF0AvdCuFOz+wtINtwbAulU5edKsuEglCZlJEAAD+HHOonqcPRjRAmeL dsUuFenWiSONfNpb1GHr2DroU+zdGTpWUKALlIuO1lK+uC9g9tI32T3w6wvpAJlZcjxIq2juTah M4sv0h3CeYwVg7kLpMvmvLfGchbDWL0AUbB7+5VnJhy6dZGtQL1sI5eGL/+ei+Dc3j4tOG9ufgq HjsVY3yZH1chdLvtkYM2BEZk4GLrluHF/f8BcaH7SjyL4ote8ei5sVtY2eFxrzfRMxav9Y9fJgS 1zpz7MlY7bY6w6uDgt6ILd1gukBRI/ikrTMOJlE0DJaXQCSv/2AePbLplZIPRm8B48vqTy2qnqq e87jA8CVubTG5+3IddcRwIxcjo1mb5gmYXWBFhIS45HheZgLTD30lF1fRH58RA1mgqYCeS X-Received: by 2002:a05:6102:5815:b0:7cc:1274:aba3 with SMTP id ada2fe7eead31-7d2a15ed551mr1782520137.22.1793986361150; Fri, 06 Nov 2026 09:32:41 -0800 (PST) Return-Path: Received: from bruce-XPS-8940.localdomain (pool-174-112-35-248.cpe.net.cable.rogers.com. [174.112.35.248]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99ba74a6964sm2335848241.0.2026.11.06.09.32.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2026 09:32:40 -0800 (PST) From: bruce.ashfield@gmail.com To: Richard Purdie , Adrian Freihofer Cc: openembedded-core@lists.openembedded.org Subject: [OE-core][RFC PATCH 05/08] kernel-devsrc: optionally version the package Date: Fri, 6 Nov 2026 12:32:32 -0500 Message-ID: <20261106173235.4155305-6-bruce.ashfield@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261106173235.4155305-1-bruce.ashfield@gmail.com> References: <20261106173235.4155305-1-bruce.ashfield@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 06 Nov 2026 17:32:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/249705 From: Bruce Ashfield kernel-devsrc is one package name for every kernel version, so the trees of two kernel versions can't be installed side by side (an upgrade replaces the old one). The tree itself is already versioned (/lib/modules//build), only the /usr/src/kernel link is shared. So add KERNELDEV_VERSIONED_PACKAGE. When it is "1", the tree is packaged as kernel-devsrc-, and kernel-devsrc keeps only the link and depends on the version it points at, the way the kernel's kernel-image and kernel-modules packages depend on their versioned packages. The link stays a packaged file, so installing or upgrading kernel-devsrc moves it with no postinst or postrm, and nothing has to run at rootfs time. The debug info always records /usr/src/kernel, so the link pointing at the current kernel is what debuggers expect; an older version installed directly is reached through its own /lib/modules//source. Anything that looks for kernel-devsrc by name (OEHasPackage in the kernelmodule and stap runtime tests, IMAGE_INSTALL, the SDK) still finds it. The 'build' RDEPENDS go on the versioned package too, so a tree installed on its own still has what it needs to build modules. Signed-off-by: Bruce Ashfield --- meta/recipes-kernel/linux/kernel-devsrc.bb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb index 46337bd79b..c2021002d4 100644 --- a/meta/recipes-kernel/linux/kernel-devsrc.bb +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb @@ -59,6 +59,14 @@ KERNELDEV_SOURCE_SPINE ?= "block certs crypto fs include init io_uring ipc kerne KERNEL_BUILD_ROOT = "${nonarch_base_libdir}/modules/" +# Set to "1" to package the tree as kernel-devsrc-, so the +# trees of two kernel versions can be installed side by side. kernel-devsrc +# then only holds the /usr/src/kernel link and depends on the version it +# points at, like the kernel's own kernel-image/kernel-modules packages. +# Installing or upgrading kernel-devsrc moves the link to that version, and +# anything that looks for kernel-devsrc by name still finds it. +KERNELDEV_VERSIONED_PACKAGE ?= "" + # The 'build' level: what is needed to build out of tree modules against the # kernel ('make scripts prepare' on target), and what kernel-devsrc has # always contained. @@ -566,6 +574,15 @@ do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock" FILES:${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH} /usr/src/kernel-source-*.tar.bz2" +# The versioned tree (KERNELDEV_VERSIONED_PACKAGE). It is ahead of ${PN} in +# PACKAGES, so it takes everything but the /usr/src/kernel link. +PACKAGES =+ "${@'${PN}-tree' if d.getVar('KERNELDEV_VERSIONED_PACKAGE') == '1' else ''}" +PKG:${PN}-tree = "${PN}-${@legitimize_package_name(d.getVar('KERNEL_VERSION') or '')}" +FILES:${PN}-tree = "${KERNEL_BUILD_ROOT} /usr/src/kernel-source-*.tar.bz2" +RDEPENDS:${PN}-tree = "${@bb.utils.contains('PACKAGECONFIG', 'build', '${KERNELDEV_BUILD_RDEPENDS}', '', d)}" +SKIP_FILEDEPS:${PN}-tree = "${SKIP_FILEDEPS:${PN}}" +RDEPENDS:${PN} += "${@'${PN}-tree (= ${EXTENDPKGV})' if d.getVar('KERNELDEV_VERSIONED_PACKAGE') == '1' else ''}" + # Added to RDEPENDS:${PN} by the 'build' PACKAGECONFIG KERNELDEV_BUILD_RDEPENDS = "bc python3-core flex bison ${TCLIBC}-utils gawk" # 4.15+ needs these next two RDEPENDS From patchwork Fri Nov 6 17:32:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Ashfield X-Patchwork-Id: 103312 Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1455.1793986363248744280 for ; Fri, 06 Nov 2026 09:32:43 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=pvg8Sncy; spf=pass (domain: gmail.com, ip: 209.85.217.49, mailfrom: bruce.ashfield@gmail.com) Received: by mail-vs1-f49.google.com with SMTP id ada2fe7eead31-7c03744ef27so329017137.1 for ; Fri, 06 Nov 2026 09:32:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793986362; x=1794591162; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=u5Z6YrLfxqocpjtXk8xLikFRsxudsx8noPdvGGWYODo=; b=pvg8SncyzEbHKFmVhjo/XYrUwCPcVDPXD8cbYqaFE7LnpqNjatO5LJ3mbnd3bXGq5t 5lT2nMkeij2X/kR6L9l9jW46cGWoRLr+D2HRS+ermKFZZ9A0FcaHs0lRNhbELkUG0Pi2 c6ypowxJJ9NhZ8W8pnxhSpgkMmC1RKNO4aDHN04A7TU6LuZOGnBaNZgiYe0DkL9aduVZ gQ1fgVE4Xc+uenhg+YN9fWFdLVSXOSggCJn7MdQikzVuq+7f/BOlPPQ7B950HQXZ5khm p8YRV+WK6KLSiMK8M8dtRrzciSq/z4Kki36Iz2SdIiTOGdo3rIh9w80FqruOittaaSuu rtWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793986362; x=1794591162; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=u5Z6YrLfxqocpjtXk8xLikFRsxudsx8noPdvGGWYODo=; b=K8JHv/AHZ/kXeb1gWi/P4sSRPJNrnyd48v+jQrgTpZvqZDpIcq4uih09LNldtXYsGy ubgMMLhJd2QDEv3lYJqH+x0+uwCPcKTEUl36bUOUkmUu2Z6fj0aZ5NbDBpezoxMArify LfGUfh4n8gJs5OC98O8m+R4XVB5hiQWhgl7CXxsvgo40rRx13LrYT1t6H9k8SC3dZVNs xwvZHuJ52sgDgbXFQYq/IjkQGDbamfu3Q/kjgFq2hcMA9mELHIr2xv+imG/RUyQfkipa f++sDrl9LBJUy5UyAUmtBuXclnH5v3lEJU6Heh0PZdyBNVwdt0VyKzE2zQGOj7dEifAg YvCA== X-Gm-Message-State: APuU4Z9+iIW0UCIsfr3QVewj4yKAW+Ary90G0NFDybo73qcjWhCSxdCc fUMsyKGwJuriZOgULtwrhx1M+jk2gtT35czxap3elrfh6P8NPQxI++MOM73qUkD6 X-Gm-Gg: AYBFou1mF/6dWAqeiFhjYCVEbBPlKrUuAQ9egWkY3ba1GME1a8xVHugo28a8JLzZFRZ 3opfEDZI6mgWHZbiNhMjS+FbyppQTkdwJsxaYZgjrrwzTFQQxvOYTDUNl2QQ2v4Shi4It0392C6 hv5cNgNi4nPmEA9186BwV0KbQVqfkgLEKkNN1b7ATokf24MwjtBHJX9V4SLHSbo4/llQv1MLYsT tdhAubHAV2eIeAMGC9FM6M/kJeu+1Z/HkD93GNAX6o2/CSf59YoxVEDSE1L6Cfup5i5vTjkKt/2 6bu9aq1d0I52thHVlMdZaBTdb8/oh/aSgsZ7EomlCR2mmqDEU3N9TGPJyB/95myJ9v5b/vbsU/A PcC4DnNjyr+LUUNz16v9UHyXXaGKmkgna4gey+HB8SDeP+4LqcT513vJshiCr+r/H7HWsn/e0Kr 3ndVnJg9i3E6dcjoPbrdvYbCKkfvN/uN82RmYJwSYPwEirQqfjL+UE7S5KetgY4b21D3+Nt0/Mc LoX2yCvSWS5q+5SveiREBu+I5s0uldqhOJJnW9urDcT5KYwYDGAuWpZO5naiyBD0YEVM5uFnnta urWGejRSz4IqA/2c74wwmMMSIqAw0XlR1RZU2WM+PeBdNbn/dCRO1H72Uwi66PFE5j78NhawTXG Mh+AUkzxmxqfzd5c2dMIx2VD4FoqZFMxXHWHVfyHcqTtPEw0FFjdHVqkQE0nO3sUsZSEFyQWH5p wrVcJAqaGMldofAmlpDBVNLLDuiGcRXDrN7UhutSy2FAeYPQ== X-Received: by 2002:a05:6102:148b:b0:7d0:b125:79c3 with SMTP id ada2fe7eead31-7d2a16545d1mr1565058137.26.1793986361889; Fri, 06 Nov 2026 09:32:41 -0800 (PST) Return-Path: Received: from bruce-XPS-8940.localdomain (pool-174-112-35-248.cpe.net.cable.rogers.com. [174.112.35.248]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99ba74a6964sm2335848241.0.2026.11.06.09.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2026 09:32:41 -0800 (PST) From: bruce.ashfield@gmail.com To: Richard Purdie , Adrian Freihofer Cc: openembedded-core@lists.openembedded.org Subject: [OE-core][RFC PATCH 06/08] kernel-devsrc: skip the recipe if no PACKAGECONFIG level is set Date: Fri, 6 Nov 2026 12:32:33 -0500 Message-ID: <20261106173235.4155305-7-bruce.ashfield@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261106173235.4155305-1-bruce.ashfield@gmail.com> References: <20261106173235.4155305-1-bruce.ashfield@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 06 Nov 2026 17:32:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/249706 From: Bruce Ashfield With none of build, source, full or tarball in PACKAGECONFIG, kernel-devsrc still builds and installs, but the package is only the /usr/src/kernel link to an empty tree. Nothing fails until someone tries to use it on target, and then it is not obvious why. Skip the recipe with a message instead, so an image that installs kernel-devsrc fails at parse time and says which PACKAGECONFIG is missing. Signed-off-by: Bruce Ashfield --- meta/recipes-kernel/linux/kernel-devsrc.bb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb index c2021002d4..621afb04de 100644 --- a/meta/recipes-kernel/linux/kernel-devsrc.bb +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb @@ -50,6 +50,13 @@ PACKAGECONFIG[tarball] = ",,,bzip2" # python3, make, ...). SKIP_FILEDEPS:${PN} = "${@'1' if bb.utils.contains('PACKAGECONFIG', 'full', True, False, d) and not bb.utils.contains_any('PACKAGECONFIG', 'build tarball', True, False, d) else '0'}" +# Without a level, kernel-devsrc would only be a /usr/src/kernel link to an +# empty tree. +python () { + if not bb.utils.contains_any('PACKAGECONFIG', 'build source full tarball', True, False, d): + raise bb.parse.SkipRecipe("PACKAGECONFIG needs at least one of build, source, full or tarball") +} + # The curated part of the 'source' level, copied in full along with # arch/${ARCH}. The rest (drivers, sound, samples, ...) is not curated: the # files the kernel build read are discovered from the manifest the kernel From patchwork Fri Nov 6 17:32:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Ashfield X-Patchwork-Id: 103313 Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1456.1793986364324316440 for ; Fri, 06 Nov 2026 09:32:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=Y5ypp0Jv; spf=pass (domain: gmail.com, ip: 209.85.217.51, mailfrom: bruce.ashfield@gmail.com) Received: by mail-vs1-f51.google.com with SMTP id ada2fe7eead31-7d06ecaf709so517767137.1 for ; Fri, 06 Nov 2026 09:32:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793986363; x=1794591163; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=8cwa+OMsOo1WZqeXoKAZgLo6QwEBedOoqawD4YF/Nio=; b=Y5ypp0Jvh4Sv98iAY5ANo1OV3wou8LZyY8/g9DYlB3p0n8pzKvajMKBtpkwpihTeFC KWjbP8MOHSnTA+YpZfRsQe3piOy1wT/Wl8JXm0wBC85dB0cCWRlpLNLIZCE1SeGbHFOG PYNfTQFBQSKzqttp105oAk9L7dT6rqvvmDHe8AiJgQzn2FEBUEsf4M9GS06ZlsDoNsgq Hnzfz+74DJT7gAHPYN+XN9mf+sKXaQoLrHGMF+6FHhrKA1cl16IccSxvC+wX6MrCK7wF S3VQiSFkcj2QyI/XmX2VHTG4GU1lu0AtOfVnB1BuQccq7QSNFfitWonR9NtbBCawFdWm 7J3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793986363; x=1794591163; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=8cwa+OMsOo1WZqeXoKAZgLo6QwEBedOoqawD4YF/Nio=; b=smUccYPx2KjlPEvd/V3P+5IKA6COS8L511Hk+C09zDjfYthb1aVht10tOKTEh80Csr Lo7HO9cQjDij76PT8k5ESKAZSzGUYNM83D9tPh6WVoR4tdgSLEi193V7dozIBXiQ5WQu 0j3jjMywQArlIHBdrZZ+aEz4LkuyQl+4WhZwQSDFIrf8wlrEDK/RYAl9xhvEgxsdjunz fS8/zVlxi93EIXOfhERN285+/uDcYmSbk7o5llhzkB+U9K2CbbSBRL5iSavNnPHzfOG6 X0I0a+h2hCClmjXTudlO/7Cjt1HWDykeYa9OfWkm2y4/U2m2Rte7a8BVWOkLCPUmWOKb zqmQ== X-Gm-Message-State: APuU4Z9fgm0enzpzhvT+hbh0jhgwLxzTUJ9ZWBYzGAKuHFldNoOzcJ+O Ja7zq63pQdgLZL7w/zHdvI8Ml8kIxESGst0ma7rCtIBbVq+A+uGmYods X-Gm-Gg: AYBFou2pB0dsUV3A252LRwXe5HTFjEzqBuGMnOeoW7gsv1WffYqPHlyvpiDtr49wyFm 9IiO/H5z2Uk6OL0ntKR1Gy1UfZMw8h+B/7Q2goDxPVT15FKKi+pRyRSjYRSqgJ5OYgZKVreufDx pTlmqceHzs4InAJ9M2BfCg/jXPXCp8s2XCm3g8+SDnrvb0PhxvUcSwIFOIv0x4Hip9OVByQm66v dC8gm3WBPDb/BezlcBG0YfbhhKEjVABRqEE4WKfQu2dzO85JfVyygBSghssjT9laYK2H6AI+knv g9NTgl8UEGHrEbpAQkBqXwPryQs7LhyUWEUEJsBtLxJfrN4GzQ3EeMsYTpj5v3f4NxcNEYmu6T+ 7OOG/XSJ1e8CebZjrWiPA/T9ulNlyKhBjSnZyIOWGdbfNJDG1Ir7s2z2hFq6zt6lerZlbNfy2Ug DiJlhgiIokB0Mak6ic672jmwsj4NUnA2/spDeF1+QtgmvlFZ9f4kfthrwp2Gig5mSnHsOg1ZZ5o nQUt6u204afJUGwYhL7vwDRP8QelVyBbSQbXlaYhIXCfqO41LSCmJDO+I+iIw4abFcLFQROi3wS qUBOrOFBqEkiaJH2f2nMtRHsKJLbzxzpC6CCHP12hha7cxVCOEJprHufCDF2TathsyJDFaWxS3X 0YIQhpX7CjzFtV41PAVAc6tg8mOEvDnLV73hG+JkRDh5y6vZY5hdZFeofOSU7klHDyNt2ucyckH mKzVyhxDTsG087b33s6J796O/VbtWWs0Zqnj8S2r2HYHuBSQ== X-Received: by 2002:a05:6102:2925:b0:7d0:5688:f4fd with SMTP id ada2fe7eead31-7d2a15a3388mr1818156137.17.1793986362986; Fri, 06 Nov 2026 09:32:42 -0800 (PST) Return-Path: Received: from bruce-XPS-8940.localdomain (pool-174-112-35-248.cpe.net.cable.rogers.com. [174.112.35.248]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99ba74a6964sm2335848241.0.2026.11.06.09.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2026 09:32:42 -0800 (PST) From: bruce.ashfield@gmail.com To: Richard Purdie , Adrian Freihofer Cc: openembedded-core@lists.openembedded.org Subject: [OE-core][RFC PATCH 07/08] rootfs: don't carry debug rootfs postinst registrations into the image Date: Fri, 6 Nov 2026 12:32:34 -0500 Message-ID: <20261106173235.4155305-8-bruce.ashfield@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261106173235.4155305-1-bruce.ashfield@gmail.com> References: <20261106173235.4155305-1-bruce.ashfield@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 06 Nov 2026 17:32:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/249707 From: Bruce Ashfield The debug rootfs is created in the image's rootfs directory, with the same package manager, so its package installs use the image's intercept scripts. Postinsts register their packages in those scripts, and the intercepts are only run once, for the image, after the debug rootfs has been moved aside. So a package that is only installed in the debug rootfs (from IMAGE_INSTALL_DEBUGFS) and has an on-target postinst is registered with delay_to_first_boot, and do_rootfs then tries to save its postinst from the image, where it isn't installed: ERROR: core-image-minimal-1.0-r0 do_rootfs: Could not invoke rpm. Command '.../rpm -q --root=.../rootfs --queryformat %{postin} ' returned 1: package is not installed Other intercepts get the debug packages added to their package lists in the same way. The debug rootfs is a debug sysroot, it isn't booted, so there is nothing to defer its postinsts to. Save the image's intercept scripts before the debug packages are installed, and put them back afterwards, so the intercepts only see what the image installed. Signed-off-by: Bruce Ashfield --- meta/lib/oe/rootfs.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index e0365da285..aac93dc42e 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py @@ -145,6 +145,16 @@ class Rootfs(object, metaclass=ABCMeta): shutil.copy(os.path.join(root, f), self.image_rootfs + relative_dir) + # The debug rootfs is installed with the image's intercept scripts, and + # postinsts register their packages in them (delay_to_first_boot, for + # example). The intercepts are only run for the image, so a package + # installed only in the debug rootfs would have its postinst saved + # against an image that doesn't contain it. Put the image's intercepts + # back once the debug packages are installed. + intercepts_dir = self.pm.intercepts_dir + bb.utils.remove(intercepts_dir + '-orig', True) + shutil.copytree(intercepts_dir, intercepts_dir + '-orig', symlinks=True) + bb.note(" Install complementary '*-dbg' packages...") self.pm.install_complementary('*-dbg') @@ -162,6 +172,9 @@ class Rootfs(object, metaclass=ABCMeta): bb.note(" Install extra debug packages...") self.pm.install(extra_debug_pkgs.split(), True) + bb.utils.remove(intercepts_dir, True) + bb.utils.rename(intercepts_dir + '-orig', intercepts_dir) + bb.note(" Removing package database...") for path in package_paths: if os.path.isdir(self.image_rootfs + path): From patchwork Fri Nov 6 17:32:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Ashfield X-Patchwork-Id: 103314 Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1457.1793986365214501572 for ; Fri, 06 Nov 2026 09:32:45 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=hFGU0rw7; spf=pass (domain: gmail.com, ip: 209.85.217.54, mailfrom: bruce.ashfield@gmail.com) Received: by mail-vs1-f54.google.com with SMTP id ada2fe7eead31-7cccb2c96d0so279287137.0 for ; Fri, 06 Nov 2026 09:32:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793986364; x=1794591164; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6NxZlANjrzQJJGGkjrlP+SUdlJFi1hRiCoykc1gIjs0=; b=hFGU0rw71i0tUKX4fOhRo4rsgsMpkDtiaU14yA90RjQrw2VwKnvEWY2QP2BxEdzagT lVdDX4ovsHEEAELeW4FFFatZ/LyIvX5dgMck6thK615Jhi43uH8wFVsSVQ5lhJvbbVRC 31MBSVN0ltlG/h6ZwxeoZXHZOTWP5jvVDkWvQL0hRuY8t2fe7U8oBxPthd6KqGjsL3Oy +OT+n/30qJ8WLgbJW9ifthE/vomuuPlKxFGDtkGbeNCXwN7s/y+I6av6UKc+fDiP7hX5 NI6WWxl1jjPj2y1fvRkmcDtq/omTg0D2axskNN8tIlplWZnfvAuvBzBAk5BPWkQULvCP 4FJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793986364; x=1794591164; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=6NxZlANjrzQJJGGkjrlP+SUdlJFi1hRiCoykc1gIjs0=; b=ASgKVXI77Ja2rb8Xe1the3aE6Ffyib8bO1J0A0BmVBrAS9hlKzvdBwxB57CfIr96+W 8ZY7r6/WlqReM9mV9KePDp6Bu1dde8GQv10DIPvKAtOZ4ToHqK4qLNRkSnylhxfxpVkY 8Ipagn14TWz03w0uKaXuMIu8LDK+AfFeqLhfiEOXa/k2KMHMkZrQAc9gnHJYtM5ul3l+ D2dgoplhq40ZEG/wRprBsTDWAeH7pzyy8mTTyzRF9GhO360xfgMDngeoCepbLdTzfNl6 NQ7fDBVgplSUfe13sK2CsHGe7pEmh3lTgbsL/6qrZxxf9VknUWzsQEtt8CPU/TK0jh7Q KHnA== X-Gm-Message-State: APuU4Z/xHHpXGuS8YkJn94a1FS4GQzxKKj//qcSOxqM4D5+SU4BXOKSJ /zGCYpPGn50brfetmAIdX+bNxfApcGqMiteSNi9rO1xgIVjmPj9e/gQy X-Gm-Gg: AYBFou3QlAu8OI1kHW5c7vqiWqRoIq12UF2xy2QUe7Bctk6EpNjwTsF8y1BvcbsxThN Mp8ngkl/BHvisqVPtx+qSVL63o/dnJWrm97JWzW649eHkpuLuOjS5P8Vl/Lx/qN+DN2zlz2y721 BYIv5O+baTSBUoixEl0aghFAmEnh5yraXKV7+MooOU61zlfpQwiAbDvtwE3ElnjdqQ7FP91J0Vb 0Ul/3aQ3ENSQBBsB75Y0Are+lPscC9PRdWqqldOlnBo573EHqvXoxj0GZLiTBNPN0OQyLSxiFth n/mlJORfnkq4ab28saEwU/DlQAhtHGrk9Tw2pjhMAxh88K7JOI4H8J46dAjlyjfdPta/4BUo+Zc 6cCkRKxU4xK/XGgI25tS/43KFlCcUjVhMm/+QMxGYhm4MSraarILViKRQxwpwtsaD5d3X2g8/Al dqYJriBGZhXy4d69Koyt99tG7uP/X6zx3vc04hmXLq1aA0ht5UPf63zP5Ql3YHO1qMLklcxvETu 5501ugrJbSnMHvD7WWL2cITIg0Aeb8Tow1M0FL4ZK5O6rtZ+3+3yvVp98udZ8dtOQJ8/lfqeYNO B3ry/OlDvR3BpXA9dRTRF2PrTlA37W0EWzvKpZ/LFpeC3U+WMGVaQRV+TwOSrDOnNvewLZHVlNb kzXocxXK2QdW9WjY4Z9Zl97cSUSaxcxdM2ux9j/ZbSyKIakdXQYbyRu9Vxk5LAMcGhc8CTXYHvm V687tfAU+mM926ykkrpftUk88aznne/br3lh+sYI+eKPLjTQ== X-Received: by 2002:a05:6102:94d:b0:7cc:ccb:ce5a with SMTP id ada2fe7eead31-7d2a165e180mr1684220137.28.1793986363855; Fri, 06 Nov 2026 09:32:43 -0800 (PST) Return-Path: Received: from bruce-XPS-8940.localdomain (pool-174-112-35-248.cpe.net.cable.rogers.com. [174.112.35.248]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99ba74a6964sm2335848241.0.2026.11.06.09.32.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2026 09:32:43 -0800 (PST) From: bruce.ashfield@gmail.com To: Richard Purdie , Adrian Freihofer Cc: openembedded-core@lists.openembedded.org Subject: [OE-core][RFC PATCH 08/08] rootfs: fail if an IMAGE_INSTALL_DEBUGFS package can't be installed Date: Fri, 6 Nov 2026 12:32:35 -0500 Message-ID: <20261106173235.4155305-9-bruce.ashfield@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261106173235.4155305-1-bruce.ashfield@gmail.com> References: <20261106173235.4155305-1-bruce.ashfield@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 06 Nov 2026 17:32:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/249708 From: Bruce Ashfield IMAGE_INSTALL_DEBUGFS packages are installed in attempt-only mode, so a package whose dependencies can't be met is skipped (dnf --skip-broken), the image builds, and the package is silently missing from the debug rootfs. The only trace is in log.do_rootfs: - nothing provides /usr/bin/foo needed by from oe-repo Skipping packages with broken dependencies: These packages are asked for by name, the same as IMAGE_INSTALL, which fails the build in this case. (A missing package already fails earlier, since the image RDEPENDS on them.) Install them normally, so a broken dependency is reported as an error rather than leaving a debug rootfs without the package that was requested. Signed-off-by: Bruce Ashfield --- meta/lib/oe/rootfs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index aac93dc42e..a28c888070 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py @@ -165,12 +165,14 @@ class Rootfs(object, metaclass=ABCMeta): """ Install additional debug packages. Possibility to install additional packages, which are not automatically installed as complementary package of - standard one, e.g. debug package of static libraries. + standard one, e.g. debug package of static libraries. They are asked + for by name, so like IMAGE_INSTALL, it is an error if they can't be + installed. """ extra_debug_pkgs = self.d.getVar('IMAGE_INSTALL_DEBUGFS') if extra_debug_pkgs: bb.note(" Install extra debug packages...") - self.pm.install(extra_debug_pkgs.split(), True) + self.pm.install(extra_debug_pkgs.split()) bb.utils.remove(intercepts_dir, True) bb.utils.rename(intercepts_dir + '-orig', intercepts_dir)