From patchwork Fri Mar 27 16:49:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Valla X-Patchwork-Id: 84670 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D245E10F2850 for ; Fri, 27 Mar 2026 16:49:47 +0000 (UTC) Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.5]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.78050.1774630178452013269 for ; Fri, 27 Mar 2026 09:49:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@antispam.mailspamprotection.com header.s=default header.b=p/TJeMDG; dkim=pass header.i=@valla.it header.s=default header.b=g8JcK/Z+; spf=pass (domain: valla.it, ip: 185.56.87.5, mailfrom: francesco@valla.it) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-5jp4.prod.antispam.mailspamprotection.com; s=arckey; t=1774630178; b=GM4RDaUHJjGyzWbtXvUJkPAiPFPEeQ1suqa2NqV5aMO/3cPzpjVrNoDXjq+DDfz2eW4xvULJoh js35Pbi8KZgBhV7SuCDjGv6xUHIpwZ0z2w0zo8tIGiIltByRx/bxKQilEauAP6e4+ibWAAIFto reQBMKvLZAgjJ5fZ8yEszGORbOnCJwLZCoB3wzZFBhM3RTGyX3sRFyzuKgT0ZM96FRwehX+LcC 7q3YTYEvVKqN30hnH5JDZmKYw1ktBqOdJOoz1SrZ7RISxuDp8Fby59dGUoga5A7QgwNPZjAn+L vEyL55gAZpWz7lFWEOvFcY83+P/t6GpIWw5DFnIQzE//VA==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-5jp4.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-5jp4.prod.antispam.mailspamprotection.com; s=arckey; t=1774630178; bh=c7+UMOGw6WvoBCQhAOgAcHI5zhCmXPdMUXfMGx4VRvo=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=F6BwY8GoDTUn1HBrG7/Z9xEWrZrrI/FPl2rY80eXA8dm1IquxSQ0c+q5RGxF4/LBe5UXV/ZTxK r+K+Oh6rDSK74SU/cyM4OgL+0wA8yIBVoMbZq3ivd9xKdRHJWxCl+10St6QsXxy4IoTrIZlOfT LqQZSJ84Qg9A6r75M4fHEsR/FTnJ9QQUSqwbeIHx0WwbdMqQ5n7tmMvidT4Woomdm3LOWwQciX k/Enkwof8KN135Fe25V1O+8/cmFpR5eqP8vAd+nfYUmJQIzc+Qklb9ua2hWj4EDfHZQGTrhIv7 VZxCYGl079vyYCCX+N+ooxMTJ7hGZCo10TnwRhwnzwwfrQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=IfZDfT2r50mFuSrVFJZ5XbNRr077o3yFPYtpUwFpAn8=; b=p/TJeMDGwpHLRDHhstG4E99rFb XJQQ7EdA4ul2J8LWx+j4/8TDJU8X7NWWjuZJChepWVg9/XazF137MN45LZ8HLt1PugXAIRaPNukU6 6NhcU1viWJwwsJpnnTcm3beUABO/BqtCL4Hx4kuXqInOk7Fa+IiH0M4s/GAPBuQF1zZE=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-5jp4.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1w6ANK-000000098U4-0nJM for openembedded-core@lists.openembedded.org; Fri, 27 Mar 2026 16:49:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=IfZDfT2r50mFuSrVFJZ5XbNRr077o3yFPYtpUwFpAn8=; b=g8JcK/Z+foRj4KmGFwxC8TcKAu clCZd0IBJwWhj59pK9CWJ+XEjqmAweV5UTg/sGskyCAlljrpNafDKOU4sxBY87FbSH6hJ2HL1Wz0I i7VWUQnvJDtC13BgcndF0YR5wvG+GMPc0fttB5raPKQtQkT5KchBcv1R4Gh83mr8Cvzw=; Received: from [95.248.129.24] (port=61428 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.1) (envelope-from ) id 1w6AND-000000007CG-2Ozw; Fri, 27 Mar 2026 16:49:27 +0000 From: Francesco Valla Date: Fri, 27 Mar 2026 17:49:13 +0100 Subject: [PATCH RFC v2 1/4] linux-bootconfig-native: add recipe MIME-Version: 1.0 Message-Id: <20260327-bootconfig-v2-1-891975014056@valla.it> References: <20260327-bootconfig-v2-0-891975014056@valla.it> In-Reply-To: <20260327-bootconfig-v2-0-891975014056@valla.it> To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer , Bruce Ashfield , Francesco Castagnotto , Francesco Valla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1629; i=francesco@valla.it; h=from:subject:message-id; bh=c7+UMOGw6WvoBCQhAOgAcHI5zhCmXPdMUXfMGx4VRvo=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDJnHtoot+3H2oJGe1bbKmj0c/2VZ+9iedtl4X3DQLD56M 1r67pfWjlIWBjEuBlkxRZaQdTfu7Zlr/i1tA+MjmDmsTCBDGLg4BWAiz7YyMuzb728RWvgwpePL v52hLxkkHL4l2Nn8Cclmcc/52n9zkTwjw0qmTxrHN6+brNI/Q2bBQa0UFeWlH0XO6m8+vlJh12W FrWwA X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - lists.openembedded.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: d2d9dc618cc027abf1f1605181f7e67e X-AntiAbuse: ID - d2d9dc618cc027abf1f1605181f7e67e AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1w6ANK-000000098U4-0nJM-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-5jp4.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 27 Mar 2026 16:49:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234097 Add a new recipe for the bootconfig tool, with source coming directly from the Linux kernel shared workdir. Signed-off-by: Francesco Valla --- .../linux-bootconfig/linux-bootconfig-native.bb | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/meta/recipes-kernel/linux-bootconfig/linux-bootconfig-native.bb b/meta/recipes-kernel/linux-bootconfig/linux-bootconfig-native.bb new file mode 100644 index 0000000000000000000000000000000000000000..f4aeb0ce413def5eed8b7ce98075e1f32061de02 --- /dev/null +++ b/meta/recipes-kernel/linux-bootconfig/linux-bootconfig-native.bb @@ -0,0 +1,31 @@ +SUMMARY = "Apply, delete or show boot config" +DESCRIPTION = "bootconfig is a tool that can be used to add a boot config block \ +at the end of a kernel initramfs, as well as remove it or show its content." +LICENSE = "GPL-2.0-only" + +inherit kernelsrc kernel-arch native + +do_populate_lic[depends] += "virtual/kernel:do_shared_workdir" +do_configure[depends] += "virtual/kernel:do_shared_workdir" + +EXTRA_OEMAKE = "\ + -C ${S}/tools/bootconfig O=${B} \ + CC="${KERNEL_CC}" LD="${KERNEL_LD}" STRIP="${KERNEL_STRIP}" \ + HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" \ + 'DESTDIR=${D}' 'prefix=${prefix}' 'bindir=${bindir}' \ +" + +do_compile() { + oe_runmake ${B}/bootconfig V=1 +} + +do_install() { + install -d ${D}${bindir} + oe_runmake install +} + +python do_package:prepend() { + d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) +} + +B = "${WORKDIR}/${BPN}-${PV}" From patchwork Fri Mar 27 16:49:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Valla X-Patchwork-Id: 84668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2081C10F2853 for ; Fri, 27 Mar 2026 16:49:48 +0000 (UTC) Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.6]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.77240.1774630178850148027 for ; Fri, 27 Mar 2026 09:49:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@antispam.mailspamprotection.com header.s=default header.b=swtbtPdn; dkim=pass header.i=@valla.it header.s=default header.b=eWXBDSOU; spf=pass (domain: valla.it, ip: 185.56.87.6, mailfrom: francesco@valla.it) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-1d9v.prod.antispam.mailspamprotection.com; s=arckey; t=1774630179; b=IzocybYCUCvoF2pZ8ZeeACjqtOoaw+hL3/VgPU+8Awo55U8Hftt7M3p79NhHWvsqbDWw++FiNd wWC47Raid2NFqHojqoA4EH5U859rhEFrIQ6RR/k6a0JQXTD41fNrnnpWRqZTOdADQlhqreNJ3W uROyAsqtbVUybbiAFOaNxU6wj/iOIVthpnyhjFSltDtNyy6gO3maDskdXSifnLMUSHfAZ4meYZ GhTNIqQ/ViKP93mB0Rhqhj96fF21At+L+QeJqYSYct5qIg420orZXbEyXSolciitXrOF3UqwZP 8a9B/QhlsXMmsk0H9D8K6AIqwhYLy3gYS5X/oRR+bDnPiQ==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-1d9v.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-1d9v.prod.antispam.mailspamprotection.com; s=arckey; t=1774630179; bh=95+gSABo5RJ3gmWsf04dAGel55k71jsoXIAS39JtEAM=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=IcC6X0fDZC+ecX2msP62XQCgcgIu11BRJqkWy7jDBwZLbfvbMWAPwJBx5URb8mj4kWvVmU+PTt mWbmU94OAjSFdinPx04/FFzExdUVfFVm4ejzSqi6rj43jS4W8vvX5cBJLxZ3ihvjpEpU9YkurG HcDLNl9aMHSfbbmEo1Gr5bhbtaeS/GWi0lH/TbunVrvMZkaKxtbPGEnx2xCqJfpMNNx7/PiZ8z DGOWjYDc971S2UmrtzFI/FCdxJGum1ZLGnJXIitflPjp/2Y+YiO9lC9WRUTC6BYaEt0oEwFIEH u8jRjjGQ6fcFE6XrorgCOyz3+6vQ54md19T5smGzTHr5fw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=bAgOgMoA9i+FqB4LjqCr4CguDP3ATvhCc8SKTehJoYU=; b=swtbtPdnoxWLHwb0Q7YwSmqyTj rqZgqLR8Ayou8iv6l9BtzLSb6EPVxLMKSrhAiXnuUm5yD7io6l+6v4MWg985IXtzN0OS+p7TxsEaa 7x1OOJrvYuOxi/xfL5hH/w0HfKXnle3SBodfnHlumSnETZ/9soH0ELGFM+lPUNyZ+yJM=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-1d9v.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1w6ANK-000000094eS-3Rni for openembedded-core@lists.openembedded.org; Fri, 27 Mar 2026 16:49:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=bAgOgMoA9i+FqB4LjqCr4CguDP3ATvhCc8SKTehJoYU=; b=eWXBDSOUTKJzsQRdMF3h0Wo2m9 64+/6QZmzOAz4YAbpV/7o7aLOG6BkVBBi2BsZWp/pDMAljyA6WE6cUDrfbBl6jmL/MqnrHGTYIx5c yfZsTPeZaA0J/Qj/nYTwIDhTLKSEDvhM5cVbWCe8kwmjxHm+89YsdjpUmMqDpWeUkSIM=; Received: from [95.248.129.24] (port=61428 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.1) (envelope-from ) id 1w6ANE-000000007CG-0iz2; Fri, 27 Mar 2026 16:49:28 +0000 From: Francesco Valla Date: Fri, 27 Mar 2026 17:49:14 +0100 Subject: [PATCH RFC v2 2/4] image_types: add bootconfig conversion type MIME-Version: 1.0 Message-Id: <20260327-bootconfig-v2-2-891975014056@valla.it> References: <20260327-bootconfig-v2-0-891975014056@valla.it> In-Reply-To: <20260327-bootconfig-v2-0-891975014056@valla.it> To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer , Bruce Ashfield , Francesco Castagnotto , Francesco Valla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4549; i=francesco@valla.it; h=from:subject:message-id; bh=95+gSABo5RJ3gmWsf04dAGel55k71jsoXIAS39JtEAM=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDJnHtoo1B/DcKdDq0L1l7PfaQcZmptbpnOMX5q21i1ZLu Zuzb9e9jlIWBjEuBlkxRZaQdTfu7Zlr/i1tA+MjmDmsTCBDGLg4BWAi0tMY/ldE2x6+GKK1PEh7 8YPplm7zMwPF/l/66J9wRa/NbIvKXW+GPzxevIX7P32TMpT/3D/pudvblVPajgn+jbm6WrN099P mQHYA X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - lists.openembedded.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 51478490fbed00cb7a111e743f78593b X-AntiAbuse: ID - 51478490fbed00cb7a111e743f78593b AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1w6ANK-000000094eS-3Rni-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-1d9v.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 27 Mar 2026 16:49:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234098 Add the addition of a bootconfig block at the end of an image as a conversion type; while a bootconfig is mostly used in conjuntion with an initramfs (i.e.: a cpio image or one of its compressed forms), having it as a generic conversion type simplifies the implemntation and is ready for future modifications at kernel side. The following configurations variables are introduced (in a separate bbclass, for further usage by other components): - BOOTCONFIG_SOURCES: list of source files to be used as bootconfig, to be found inside DEPLOY_DIR_IMAGE; - BOOTCONFIG_TASKS: list of tasks deploying the bootconfig source files specified in BOOTCONFIG_SOURCES to DEPLOY_DIR_IMAGE; an image using the bootconfig modifier will depend on them. Signed-off-by: Francesco Valla --- meta/classes-recipe/bootconfig-config.bbclass | 12 ++++++++++++ meta/classes-recipe/image_types.bbclass | 28 +++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/bootconfig-config.bbclass b/meta/classes-recipe/bootconfig-config.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..79e6a915eefb28164cc414f65875b4386764ce5a --- /dev/null +++ b/meta/classes-recipe/bootconfig-config.bbclass @@ -0,0 +1,12 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +# Name of the file(s) to be used as bootconfig source, to be found inside DEPLOY_DIR_IMAGE +BOOTCONFIG_SOURCES ?= "" + +# Task deploying the bootconfig source to DEPLOY_DIR_IMAGE +# e.g.: BOOTCONFIG_TASKS = "bootconfig-debug:do_deploy" +BOOTCONFIG_TASKS ?= "" diff --git a/meta/classes-recipe/image_types.bbclass b/meta/classes-recipe/image_types.bbclass index e6ef0ce11e40c0f8388fb5547ab03943004bde2f..7d0120e6cd56c9a08fb3c2ac8ea6edb56602aa53 100644 --- a/meta/classes-recipe/image_types.bbclass +++ b/meta/classes-recipe/image_types.bbclass @@ -264,9 +264,31 @@ IMAGE_CMD:f2fs () { sload.f2fs -f ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}.f2fs } +oe_bootconfig() { + local src_image=$1 + + if [ -z "${BOOTCONFIG_SOURCES}" ]; then + bbfatal "bootconfig image type requested but BOOTCONFIG_SOURCES is not set" + fi + + cp ${src_image} ${src_image}.bootconfig + + # Add bootconfig(s) to file + rm -f bootconfig.txt + for src in ${BOOTCONFIG_SOURCES}; do + cat ${DEPLOY_DIR_IMAGE}/${src} >> bootconfig.txt + done + + bootconfig -a bootconfig.txt ${src_image}.bootconfig + rm bootconfig.txt + + # Re-read bootconfig + bootconfig -l ${src_image}.bootconfig +} + EXTRA_IMAGECMD = "" -inherit siteinfo kernel-arch image-artifact-names +inherit siteinfo kernel-arch image-artifact-names bootconfig-config JFFS2_ENDIANNESS ?= "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-l', '-b', d)}" JFFS2_ERASEBLOCK ?= "0x40000" @@ -333,7 +355,7 @@ IMAGE_TYPES:append:x86-64 = " hddimg iso" # CONVERSION_CMD/DEPENDS. COMPRESSIONTYPES ?= "" -CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip 7zip zst sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap u-boot vmdk vhd vhdx vdi qcow2 base64 gzsync zsync ${COMPRESSIONTYPES}" +CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip 7zip zst sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap u-boot vmdk vhd vhdx vdi qcow2 base64 gzsync zsync bootconfig ${COMPRESSIONTYPES}" CONVERSION_CMD:lzma = "lzma -k -f -7 ${IMAGE_NAME}.${type}" CONVERSION_CMD:gz = "gzip -f -9 -n -c --rsyncable ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.gz" CONVERSION_CMD:bz2 = "pbzip2 -f -k ${IMAGE_NAME}.${type}" @@ -360,6 +382,7 @@ CONVERSION_CMD:qcow2 = "qemu-img convert -O qcow2 ${IMAGE_NAME}.${type} ${IMAGE_ CONVERSION_CMD:base64 = "base64 ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.base64" CONVERSION_CMD:zsync = "zsyncmake_curl ${IMAGE_NAME}.${type}" CONVERSION_CMD:gzsync = "zsyncmake_curl -z ${IMAGE_NAME}.${type}" +CONVERSION_CMD:bootconfig = "oe_bootconfig ${IMAGE_NAME}.${type}" CONVERSION_DEPENDS_lzma = "xz-native" CONVERSION_DEPENDS_gz = "pigz-native" CONVERSION_DEPENDS_bz2 = "pbzip2-native" @@ -380,6 +403,7 @@ CONVERSION_DEPENDS_vhdx = "qemu-system-native" CONVERSION_DEPENDS_vhd = "qemu-system-native" CONVERSION_DEPENDS_zsync = "zsync-curl-native" CONVERSION_DEPENDS_gzsync = "zsync-curl-native" +CONVERSION_DEPENDS_bootconfig = "linux-bootconfig-native ${BOOTCONFIG_TASKS}" RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4" RUNNABLE_MACHINE_PATTERNS ?= "qemu" From patchwork Fri Mar 27 16:49:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Valla X-Patchwork-Id: 84667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DB3E10F2855 for ; Fri, 27 Mar 2026 16:49:48 +0000 (UTC) Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.7]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.78051.1774630179345973812 for ; Fri, 27 Mar 2026 09:49:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@antispam.mailspamprotection.com header.s=default header.b=wI8Ka7MF; dkim=pass header.i=@valla.it header.s=default header.b=ZHAnJaob; spf=pass (domain: valla.it, ip: 185.56.87.7, mailfrom: francesco@valla.it) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-j8h9.prod.antispam.mailspamprotection.com; s=arckey; t=1774630179; b=biqXqe2Ld/nc40M1RReWs5i1zFKZz/PaQ5+0spfnGCWi2W5Y0mFxHweZBS80piUv1J7rgU0mab NZ4UQl+nJo6xdo4yoeiFoGYiZtIO/nVopqGgvQbUJUGK7sCwB6mS/Oe57gfdN3UEEV6rrHA9hT 1De5kcq+mCw39GGp9ZiZdktmV1bUUaM5dPxeCmOhVrNxP3ToGclHLPS73Jx0i+qsmS6qg0AnK6 zFkKsqYVlIS+nmQqLDQ5nD9gudmcmLUtOBF3C0polpUa7PvBzAVhc8gWUnyVndOnC8yUDxmbwQ hidzuwOTRmT6/ATreJTIFUyQQrzJKet9HqK0KQPQ7qlDow==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-j8h9.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-j8h9.prod.antispam.mailspamprotection.com; s=arckey; t=1774630179; bh=XnwhN8nBQEQvPGAop2qSXD069+U9GM/OieiHxzF0Zsg=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=e+svC/LVb5ycH2CLXEv1hFQqKdXLvTW8gB3VtqKqw4q8PZX4CzNQcYX5LiQlLKOMLcWj19UYHS o4Pn/P/iOkMBAZznXKdDNzLqIFCdYPJgk5Ps6kK3Q+lsk6mltp7FG4pMpHn3U3gCF0uI/yeHN/ rSathhgMvmllNyDYp15x1nXdUvEzOTeLqtZQywId934PBcAd8I70ZGWdhBxohC3Ym/mt+wKW2d pR2Ws/oA3Qx+LaeDiM5AQNYuoj4fCt1wAvKASRCcT02uQRoxyxqyb3jMJ4nhBYLT/4M2HTvvgi iLEj1R9AFSB7iYDOA0aOPd6kHUbV0p4X18PvGW+rET7wYg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=phKlSbE6Ix2kPngK6PvnqbX74RU/qo6blhBEpSsaX+E=; b=wI8Ka7MFNGof+v0NQkMYaPffcq 6caxBNmUb+VU3jYJsQaZrmdnbMwInpdddyfTJeqnaqIp7KwOoJZWMmmBWo1QKHH4NQqmcLDH9ozFJ prVnCEkhei9kpT1cCt3C2t1oyQPyZnFjkW5u4Kjr0TeFKova9Pyjoxqzgvzw+qVhYyI8=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-j8h9.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1w6ANL-000000096zx-0yQZ for openembedded-core@lists.openembedded.org; Fri, 27 Mar 2026 16:49:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=phKlSbE6Ix2kPngK6PvnqbX74RU/qo6blhBEpSsaX+E=; b=ZHAnJaobvr2U2lxHoGi38Wew+Q Q1Ed+amrlDaBAr7HTUbXwGg7Y4kjfu3ce5G/LzbaqN4pM/U+gmjmN7qetEai5nOEflwW0rYM02LDc SbU+TpzXIywOa9JUik2418JPW5vn/URzCa4WMzd6mkctF5OPAWHDuB0FORmmOeRrYnI4=; Received: from [95.248.129.24] (port=61428 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.1) (envelope-from ) id 1w6ANE-000000007CG-3DyO; Fri, 27 Mar 2026 16:49:28 +0000 From: Francesco Valla Date: Fri, 27 Mar 2026 17:49:15 +0100 Subject: [PATCH RFC v2 3/4] recipes-test: add bootconfig-test recipe MIME-Version: 1.0 Message-Id: <20260327-bootconfig-v2-3-891975014056@valla.it> References: <20260327-bootconfig-v2-0-891975014056@valla.it> In-Reply-To: <20260327-bootconfig-v2-0-891975014056@valla.it> To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer , Bruce Ashfield , Francesco Castagnotto , Francesco Valla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1747; i=francesco@valla.it; h=from:subject:message-id; bh=XnwhN8nBQEQvPGAop2qSXD069+U9GM/OieiHxzF0Zsg=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDJnHtoodvP73p/6TjPSL9eoVcyW+3jjn8/GJ1qF1B9MS9 rSEvT67t6OUhUGMi0FWTJElZN2Ne3vmmn9L28D4CGYOKxPIEAYuTgGYiHU+wz+1mw5TS1+dsOiW Kgvo0Pq74RPPZ7Nt87ziYifmBd7Z1sHJ8M/way5vSXTq+TKuU8aLPvw9eODoHs+Z0TuChYrTN6W rXGUCAA== X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - lists.openembedded.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 1c739b0ec835f3e29c6c456c25e1c711 X-AntiAbuse: ID - 1c739b0ec835f3e29c6c456c25e1c711 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1w6ANL-000000096zx-0yQZ-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-j8h9.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 27 Mar 2026 16:49:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234099 Add a test recipe deploying a fixed bootconfig source file to DEPLOY_DIR_IMAGE, to be used in tests that expect a bootconfig to be available. Signed-off-by: Francesco Valla --- .../recipes-test/bootconfig/bootconfig-test.bb | 20 ++++++++++++++++++++ .../bootconfig/bootconfig-test/bootconfig-test.txt | 6 ++++++ 2 files changed, 26 insertions(+) diff --git a/meta-selftest/recipes-test/bootconfig/bootconfig-test.bb b/meta-selftest/recipes-test/bootconfig/bootconfig-test.bb new file mode 100644 index 0000000000000000000000000000000000000000..0cf74fa93652009466220f21001923a81d628a2e --- /dev/null +++ b/meta-selftest/recipes-test/bootconfig/bootconfig-test.bb @@ -0,0 +1,20 @@ +SUMMARY = "Test bootconfig" +DESCRIPTION = "This generates a dummy bootconfig to be used to for testing." +LICENSE = "MIT" + +SRC_URI = "file://bootconfig-test.txt" + +EXCLUDE_FROM_WORLD = "1" + +inherit deploy nopackages + +do_configure[noexec] = "1" +do_compile[noexec] = "1" +deltask do_stash_locale +deltask do_install +deltask do_populate_sysroot + +do_deploy() { + install -m0664 ${UNPACKDIR}/bootconfig-test.txt ${DEPLOYDIR}/bootconfig-test.txt +} +addtask deploy after do_unpack before do_build diff --git a/meta-selftest/recipes-test/bootconfig/bootconfig-test/bootconfig-test.txt b/meta-selftest/recipes-test/bootconfig/bootconfig-test/bootconfig-test.txt new file mode 100644 index 0000000000000000000000000000000000000000..c194018b0bd0e225aaf01a49dff78fcaebe8a7d4 --- /dev/null +++ b/meta-selftest/recipes-test/bootconfig/bootconfig-test/bootconfig-test.txt @@ -0,0 +1,6 @@ +kernel { + root = 01234567-89ab-cdef-0123-456789abcd +} +init { + splash +} From patchwork Fri Mar 27 16:49:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Valla X-Patchwork-Id: 84669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C63E710F2857 for ; Fri, 27 Mar 2026 16:49:48 +0000 (UTC) Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.10]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.77241.1774630180230077025 for ; Fri, 27 Mar 2026 09:49:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@antispam.mailspamprotection.com header.s=default header.b=Yz3LrRBz; dkim=pass header.i=@valla.it header.s=default header.b=es1LRQrn; spf=pass (domain: valla.it, ip: 185.56.87.10, mailfrom: francesco@valla.it) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-qr20.prod.antispam.mailspamprotection.com; s=arckey; t=1774630180; b=dKjggt4jnuU91FKpVs6h7zT5cgNwVKrHPiwEzBljUWIe4GVISiz0mHx1BFopRYJoqjwDdS0n3P hcFteFjuaIEeYAxsMTQCpOyZKkrvPs1QBLKXa3zpfda1L3TZUxs64DwdHs72GJ8FxapYKCzB3t ReEEKwkCAvFp6oz8OymHAzszEqbY4Leyo3EaIdzZq/cNVEgabHgj2421Ry4ycx/SFDqBg4fRF6 UMoiDzYyKcOYm7PyG4J0INUPzIo59MzTcqK5Of6zCaKbl9v5Pk9NCiI8AvG4W7+PXASBrRAOCE Mcjij9E1aSH/D5eUXrqkaotkRD/IK7oEC1kpEQGlmyITTw==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-qr20.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-qr20.prod.antispam.mailspamprotection.com; s=arckey; t=1774630180; bh=2kixU5odA4cyHQ4KF4R4WUULVw2eipMTVqWPg01jMIM=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=fxVV2Vv6OFI9kl1VF2E+5Cd64ISzzT2HlPvjtYZaShYfBfGnIEOyXDE6Ctb2TB3SDUaHV1yMAl z3Wf3MyJUA4RuadljcBDFyTYzcp33zeYcn2h3N5dM/X9hX3OkFUYXBnUHAI6HU5QnrpzOmqraF y56f9vIkqVn+Qic8BbG67EWtMXgchUqwH4lsMHUSxdJARySM4bGPIKmzGOYZYTWADvQCFjvIve koO+tNsPqbIUPm1eQBAgg94h6bFZOSfnLGUwh/HzoT7acInia76mxSPq6Wzod4AiqC/qE4fpxt WxkWeNRrj/6imyAmz3EwVyiliwTRMDrgXb4Mrl1xz7fO6Q==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject :Date:From:Reply-To:List-Unsubscribe; bh=ULfIRGa53kpDKuvnr9Z3BGVJ0skO45Mv0771C0tTNOU=; b=Yz3LrRBz9wBYVEMmDIaF17dqhA 1Rc5f/DFVnmuJd12s6n0o7jZ+FWyYn7DDSGRLwRkDMVdWOdCYkU747Jhi9Bv8BDTfNb3dlizRQ1Z3 tJGsg+JDNQ+tJkVUWbiEny4WxpXDPAfGdi81lN9Wm+bMwz1biCabdelzkdlFRs8gzm90=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-qr20.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1w6ANM-0000000997n-0O2J for openembedded-core@lists.openembedded.org; Fri, 27 Mar 2026 16:49:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Subject:Date:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=ULfIRGa53kpDKuvnr9Z3BGVJ0skO45Mv0771C0tTNOU=; b=es1LRQrnPEIH0+MFh6e3qG2hih azvyyO+zLMifci3Jv2q0aOs3k0R+eB/NtDs7UvZ8MjHCQSQOgi6iOfwgmyAbmKgQdRUauuOG8NyJx HfbTTiq5G5n6cotjW1+zkAWTCuZzm9aphQi1V3gyRKFasB8wPl7AuGaFkqnqkbJ3EIpE=; Received: from [95.248.129.24] (port=61428 helo=[192.168.178.175]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.1) (envelope-from ) id 1w6ANF-000000007CG-1Ulu; Fri, 27 Mar 2026 16:49:29 +0000 From: Francesco Valla Date: Fri, 27 Mar 2026 17:49:16 +0100 Subject: [PATCH RFC v2 4/4] kernel-fit-image: add bootconfig support MIME-Version: 1.0 Message-Id: <20260327-bootconfig-v2-4-891975014056@valla.it> References: <20260327-bootconfig-v2-0-891975014056@valla.it> In-Reply-To: <20260327-bootconfig-v2-0-891975014056@valla.it> To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer , Bruce Ashfield , Francesco Castagnotto , Francesco Valla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=14801; i=francesco@valla.it; h=from:subject:message-id; bh=2kixU5odA4cyHQ4KF4R4WUULVw2eipMTVqWPg01jMIM=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDJnHtoo1Rc2bXMIkLNxodJP3z+7vjUnft0dmnudwv/quS WCNKpNARykLgxgXg6yYIkvIuhv39sw1/5a2gfERzBxWJpAhDFycAjAR66mMDPNiuxdJz3qUwVGX fPFHWtKhqK2/ghzeXVg4bdvpwju1J+wZ/ufIX4+xOWS++MmzO4nt2+5cOMaRqr+7anuWxZo6m76 mLSwA X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - lists.openembedded.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 9bf5e10d7406028265776b975a6c049a X-AntiAbuse: ID - 9bf5e10d7406028265776b975a6c049a AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1w6ANM-0000000997n-0O2J-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-qr20.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 27 Mar 2026 16:49:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234100 Support for bootconfig is added to generated FITs in two forms, both depending on the FIT_INCLUDE_BOOTCONFIG being set to 1 to be enabled: - if INITRAMFS_IMAGE is set, a .bootconfig image will be searched instead of the plain or compressed cpio archives; - if INITRAMFS_IMAGE is not set, a dummy initramfs will be generated and the bootconfig(s) specified in BOOTCONFIG_SOURCES will be attached to it. The case where both FIT_INCLUDE_BOOTCONFIG and INITRAMFS_IMAGE_BUNDLE are set to '1' is not supported, as it wouldn't work as expected on the target device. Signed-off-by: Francesco Valla --- meta/classes-recipe/kernel-fit-image.bbclass | 48 +++++++++++++++++++-- meta/conf/image-fitimage.conf | 3 ++ meta/lib/oeqa/selftest/cases/fitimage.py | 63 ++++++++++++++++++++++++---- 3 files changed, 102 insertions(+), 12 deletions(-) diff --git a/meta/classes-recipe/kernel-fit-image.bbclass b/meta/classes-recipe/kernel-fit-image.bbclass index 367bc9bcfd3a4cd237e466269fa143941a02031a..3e3d5b3cbc9f69800da16fe41eb982da2abfca38 100644 --- a/meta/classes-recipe/kernel-fit-image.bbclass +++ b/meta/classes-recipe/kernel-fit-image.bbclass @@ -1,5 +1,5 @@ -inherit kernel-arch kernel-artifact-names uboot-config deploy +inherit kernel-arch kernel-artifact-names uboot-config bootconfig-config deploy require conf/image-fitimage.conf S = "${UNPACKDIR}" @@ -12,6 +12,7 @@ EXCLUDE_FROM_WORLD = "1" DEPENDS += "\ u-boot-tools-native dtc-native \ ${@'kernel-signing-keys-native' if d.getVar('FIT_GENERATE_KEYS') == '1' else ''} \ + ${@'linux-bootconfig-native' if (d.getVar('FIT_INCLUDE_BOOTCONFIG') == '1' and not d.getVar("INITRAMFS_IMAGE")) else ''} \ " python () { @@ -23,6 +24,9 @@ python () { else: d.appendVarFlag('do_compile', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') + if not image and d.getVar('BOOTCONFIG_TASKS') and d.getVar('FIT_INCLUDE_BOOTCONFIG') == '1': + d.appendVarFlag('do_compile', 'depends', ' ${BOOTCONFIG_TASKS}') + #check if there are any dtb providers providerdtb = d.getVar("PREFERRED_PROVIDER_virtual/dtb") if providerdtb: @@ -54,8 +58,28 @@ FIT_KERNEL_SIGN_ENABLE ?= "${UBOOT_SIGN_ENABLE}" FIT_KERNEL_SIGN_KEYNAME ?= "${UBOOT_SIGN_KEYNAME}" FIT_KERNEL_SIGN_KEYDIR ?= "${UBOOT_SIGN_KEYDIR}" +create_bootconfig_bin() { + # Create empty file + dd if=/dev/zero of=bootconfig.bin count=0 + + # Add bootconfig(s) to file + rm -f bootconfig.txt + for src in ${BOOTCONFIG_SOURCES}; do + if [ ! -e ${DEPLOY_DIR_IMAGE}/${src} ]; then + bbfatal "Did not find bootconfig source file: ${DEPLOY_DIR_IMAGE}/${src}" + fi + cat ${DEPLOY_DIR_IMAGE}/${src} >> bootconfig.txt + done + + bootconfig -a bootconfig.txt bootconfig.bin + + # Re-read bootconfig + bootconfig -l bootconfig.bin +} + python do_compile() { import shutil + import subprocess import oe.fitimage itsfile = "fit-image.its" @@ -135,10 +159,18 @@ python do_compile() { # Prepare a ramdisk section. initramfs_image = d.getVar('INITRAMFS_IMAGE') - if initramfs_image and d.getVar("INITRAMFS_IMAGE_BUNDLE") != '1': + if initramfs_image and d.getVar("INITRAMFS_IMAGE_BUNDLE") == '1': + bb.note("Initramfs is bundled with kernel image, not including it as ramdisk") + if d.getVar("FIT_INCLUDE_BOOTCONFIG") == '1': + bb.warn("FIT_INCLUDE_BOOTCONFIG not supported if INITRAMFS_IMAGE_BUNDLE is set. Bootconfig won't be included in the FIT image.") + elif initramfs_image: # Find and use the first initramfs image archive type we find + fstypes = d.getVar("FIT_SUPPORTED_INITRAMFS_FSTYPES").split() + if d.getVar("FIT_INCLUDE_BOOTCONFIG") == '1': + bb.note("Including initramfs with bootconfig") + fstypes = [ "%s.bootconfig" % f for f in fstypes ] found = False - for img in d.getVar("FIT_SUPPORTED_INITRAMFS_FSTYPES").split(): + for img in fstypes: initramfs_path = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), "%s.%s" % (d.getVar('INITRAMFS_IMAGE_NAME'), img)) if os.path.exists(initramfs_path): bb.note("Found initramfs image: " + initramfs_path) @@ -152,7 +184,15 @@ python do_compile() { bb.note("Did not find initramfs image: " + initramfs_path) if not found: - bb.fatal("Could not find a valid initramfs type for %s, the supported types are: %s" % (d.getVar('INITRAMFS_IMAGE_NAME'), d.getVar('FIT_SUPPORTED_INITRAMFS_FSTYPES'))) + bb.fatal("Could not find a valid initramfs type for %s, the supported types are: %s" % (d.getVar('INITRAMFS_IMAGE_NAME'), " ".join(fstypes))) + elif d.getVar("FIT_INCLUDE_BOOTCONFIG") == '1': + # Include bootconfig also without an initramfs, emitting a dedicated ramdisk section + bb.build.exec_func('create_bootconfig_bin', d) + + root_node.fitimage_emit_section_ramdisk("ramdisk-1", "bootconfig.bin", + "bootconfig", + d.getVar("UBOOT_RD_LOADADDRESS"), + d.getVar("UBOOT_RD_ENTRYPOINT")) # # Prepare loadables sections diff --git a/meta/conf/image-fitimage.conf b/meta/conf/image-fitimage.conf index 2fdb816d556c786dcc2c14cb149446eaddc2ff4b..b2178853f388e320710b3c0117799145795bf8f4 100644 --- a/meta/conf/image-fitimage.conf +++ b/meta/conf/image-fitimage.conf @@ -37,6 +37,9 @@ FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name" FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio" +# Include bootconfig (either with or without initramfs) +FIT_INCLUDE_BOOTCONFIG ?= "0" + # Allow user to support special use cases where the kernel binary is # not included in the FIT image itself. # This is particularly useful for UKI-based setups, where the kernel diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 3541c07520a8ee3f212471430792c31334d54278..29c9531fa8b9cbb6adfcda08c87e85313133dc23 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py @@ -419,12 +419,15 @@ class KernelFitImageBase(FitImageTestCase): Call the get_bb_vars function once and get all variables needed by the test case. """ internal_used = { + 'BOOTCONFIG_SOURCES', + 'BOOTCONFIG_TASKS', 'DEPLOY_DIR_IMAGE', 'FIT_CONF_DEFAULT_DTB', 'FIT_CONF_MAPPINGS', 'FIT_CONF_PREFIX', 'FIT_DESC', 'FIT_HASH_ALG', + 'FIT_INCLUDE_BOOTCONFIG', 'FIT_KERNEL_COMP_ALG', 'FIT_LOADABLES', 'FIT_LOADABLE_ENTRYPOINT', @@ -528,6 +531,7 @@ class KernelFitImageBase(FitImageTestCase): ] """ dtb_files, dtb_symlinks = FitImageTestCase._get_dtb_files(bb_vars) + fit_include_bootconfig = bb_vars['FIT_INCLUDE_BOOTCONFIG'] fit_sign_individual = bb_vars['FIT_SIGN_INDIVIDUAL'] fit_uboot_env = bb_vars['FIT_UBOOT_ENV'] initramfs_image = bb_vars['INITRAMFS_IMAGE'] @@ -552,7 +556,8 @@ class KernelFitImageBase(FitImageTestCase): else: not_images.append('setup-1') - if initramfs_image and initramfs_image_bundle != "1": + if (initramfs_image and initramfs_image_bundle != "1") or \ + (fit_include_bootconfig == "1" and not initramfs_image): images.append('ramdisk-1') else: not_images.append('ramdisk-1') @@ -627,6 +632,7 @@ class KernelFitImageBase(FitImageTestCase): return (req_its_paths, not_req_its_paths) def _get_req_its_fields(self, bb_vars): + fit_include_bootconfig = bb_vars['FIT_INCLUDE_BOOTCONFIG'] initramfs_image = bb_vars['INITRAMFS_IMAGE'] initramfs_image_bundle = bb_vars['INITRAMFS_IMAGE_BUNDLE'] uboot_rd_loadaddress = bb_vars.get('UBOOT_RD_LOADADDRESS') @@ -643,7 +649,8 @@ class KernelFitImageBase(FitImageTestCase): 'load = <' + str(bb_vars['UBOOT_LOADADDRESS']) + '>;', 'entry = <' + str(bb_vars['UBOOT_ENTRYPOINT']) + '>;', ] - if initramfs_image and initramfs_image_bundle != "1": + if (initramfs_image and initramfs_image_bundle != "1") or \ + (fit_include_bootconfig == "1" and not initramfs_image): its_field_check.append('type = "ramdisk";') if uboot_rd_loadaddress: its_field_check.append("load = <%s>;" % uboot_rd_loadaddress) @@ -666,11 +673,13 @@ class KernelFitImageBase(FitImageTestCase): # Works only for tests were the symlink is with -alias suffix its_field_check.append('fdt = "fdt-%s";' % dtb.replace('-alias', '')) - if initramfs_image and initramfs_image_bundle != "1": + if (initramfs_image and initramfs_image_bundle != "1") or \ + (fit_include_bootconfig == "1" and not initramfs_image): its_field_check.append('ramdisk = "ramdisk-1";') else: its_field_check.append('kernel = "kernel-1";') - if initramfs_image and initramfs_image_bundle != "1": + if (initramfs_image and initramfs_image_bundle != "1") or \ + (fit_include_bootconfig == "1" and not initramfs_image): its_field_check.append('ramdisk = "ramdisk-1";') return its_field_check @@ -680,7 +689,8 @@ class KernelFitImageBase(FitImageTestCase): if bb_vars.get('UBOOT_SIGN_ENABLE') != "1": return {} sign_images = '"kernel", "fdt"' - if bb_vars['INITRAMFS_IMAGE'] and bb_vars['INITRAMFS_IMAGE_BUNDLE'] != "1": + if (bb_vars['INITRAMFS_IMAGE'] and bb_vars['INITRAMFS_IMAGE_BUNDLE'] != "1") or \ + (bb_vars['FIT_INCLUDE_BOOTCONFIG'] == "1" and not bb_vars['INITRAMFS_IMAGE']): sign_images += ', "ramdisk"' if bb_vars['FIT_UBOOT_ENV']: sign_images += ', "bootscr"' @@ -705,6 +715,7 @@ class KernelFitImageBase(FitImageTestCase): """Generate a dictionary of expected sections in the output of dumpimage""" dtb_files, dtb_symlinks = FitImageTestCase._get_dtb_files(bb_vars) fit_hash_alg = bb_vars['FIT_HASH_ALG'] + fit_include_bootconfig = bb_vars['FIT_INCLUDE_BOOTCONFIG'] fit_sign_alg = bb_vars['FIT_SIGN_ALG'] fit_sign_individual = bb_vars['FIT_SIGN_INDIVIDUAL'] fit_uboot_env = bb_vars['FIT_UBOOT_ENV'] @@ -732,7 +743,8 @@ class KernelFitImageBase(FitImageTestCase): if fit_uboot_env: req_sections['bootscr-' + fit_uboot_env] = { "Type": "Script" } # Add the initramfs - if initramfs_image and initramfs_image_bundle != "1": + if (initramfs_image and initramfs_image_bundle != "1") or \ + (fit_include_bootconfig == "1" and not initramfs_image): req_sections['ramdisk-1'] = { "Type": "RAMDisk Image", "Load Address": bb_vars['UBOOT_RD_LOADADDRESS'], @@ -762,7 +774,8 @@ class KernelFitImageBase(FitImageTestCase): "Kernel": "kernel-1", "FDT": 'fdt-' + real_dtb, } - if initramfs_image and initramfs_image_bundle != "1": + if (initramfs_image and initramfs_image_bundle != "1") or \ + (fit_include_bootconfig == "1" and not initramfs_image): req_sections[conf_name]['Init Ramdisk'] = "ramdisk-1" if loadables: req_sections[conf_name]['Loadables'] = ",".join(loadables) @@ -771,7 +784,8 @@ class KernelFitImageBase(FitImageTestCase): req_sections[conf_name] = { "Kernel": "kernel-1" } - if initramfs_image and initramfs_image_bundle != "1": + if (initramfs_image and initramfs_image_bundle != "1") or \ + (fit_include_bootconfig == "1" and not initramfs_image): req_sections[conf_name]['Init Ramdisk'] = "ramdisk-1" if loadables: req_sections[conf_name]['Loadables'] = ",".join(loadables) @@ -886,6 +900,36 @@ FIT_LOADABLE_TYPE[loadable1] = "firmware" FIT_LOADABLE_FILENAME[loadable2] = "linux.bin" FIT_LOADABLE_LOADADDRESS[loadable2] = "0x87000000" FIT_LOADABLE_TYPE[loadable2] = "firmware" +""" + config = self._config_add_kernel_classes(config) + self.write_config(config) + bb_vars = self._fit_get_bb_vars() + self._test_fitimage(bb_vars) + + def test_fit_image_bootconfig(self): + """ + Summary: Verifies the content of the ramdisk node in the FIT Image Tree Source (its) + The FIT settings are set by the test case. + Expected: 1. The ITS is generated with bootconfig but without initramfs + 2. The ramdisk node is present in the its file with the + expected load and entrypoint + + Product: oe-core + Author: Francesco Valla + """ + + config = """ +KERNEL_IMAGETYPE = "Image" + +INITRAMFS_IMAGE = "" +INITRAMFS_SCRIPTS = "" +UBOOT_RD_LOADADDRESS = "0x88000000" +UBOOT_RD_ENTRYPOINT = "0x88000000" +UBOOT_LOADADDRESS = "0x80080000" +UBOOT_ENTRYPOINT = "0x80080000" +BOOTCONFIG_SOURCES = "bootconfig-test.txt" +BOOTCONFIG_TASKS = "bootconfig-test:do_deploy" +FIT_INCLUDE_BOOTCONFIG = "1" """ config = self._config_add_kernel_classes(config) self.write_config(config) @@ -1156,6 +1200,7 @@ class FitImagePyTests(KernelFitImageBase): 'FIT_CONF_PREFIX': "conf-", 'FIT_DESC': "Kernel fitImage for a dummy distro", 'FIT_GENERATE_KEYS': "0", + 'FIT_INCLUDE_BOOTCONFIG': "0", 'FIT_HASH_ALG': "sha256", 'FIT_KEY_GENRSA_ARGS': "-F4", 'FIT_KEY_REQ_ARGS': "-batch -new", @@ -1173,6 +1218,8 @@ class FitImagePyTests(KernelFitImageBase): 'UBOOT_LOADADDRESS': "0x20008000", 'INITRAMFS_IMAGE': "", 'INITRAMFS_IMAGE_BUNDLE': "", + 'BOOTCONFIG_SOURCES': "", + 'BOOTCONFIG_TASKS': "", # kernel-uboot.bbclass 'FIT_KERNEL_COMP_ALG': "gzip", 'FIT_KERNEL_COMP_ALG_EXTENSION': ".gz",