From patchwork Wed Mar 18 23:30:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Valla X-Patchwork-Id: 83791 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 4CA4E1088E5D for ; Wed, 18 Mar 2026 23:31:15 +0000 (UTC) Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.0]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.28201.1773876673682153106 for ; Wed, 18 Mar 2026 16:31:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@antispam.mailspamprotection.com header.s=default header.b=2D1yQCcL; dkim=pass header.i=@valla.it header.s=default header.b=cws5Rpwo; spf=pass (domain: valla.it, ip: 185.56.87.0, mailfrom: francesco@valla.it) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-q0dl.prod.antispam.mailspamprotection.com; s=arckey; t=1773876673; b=KxQpDTEsORLbv1UhUdcIk8Onont2e77UkuII7fC5hPPUsgMuAOBEKkAtpoaTxsTM+1hHzxw3va 9aTuFHUZZ6cnTA54WLOYgbZQh9VIoB1Bd4hU67lkUSA/dWdxkCnN4VKOHhWUtl6LfRITGzB9iB oi0h8LTc8Y5b7jKE4I0VV8qkO4zWaxC7VI32uDXTa+JXYuutOl3U0bFMvxdLn2CC9zCTDb0nhv P+gZPkuji+S2ZhTdv+HFDQNa5IKzrZqCYC8A9JNB7MSzCVUyDoM1zWHlltTCRda6c+gjbYZyA1 ARzlw4q9diIQdK75FcVrIKHgcD18Rq0Lt4Cmost1x3SNQg==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-q0dl.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-q0dl.prod.antispam.mailspamprotection.com; s=arckey; t=1773876673; bh=Vw9mGtbDOhJ329QqCYKT2+fJMnTnLr4YQNo5LgarFLs=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=dXIjm/cj4tpMbh/w/NTQFY7F8st30psTp0uixGVxDypzgE6TAWTGjBnLv8UO9RVzd8klYb/2B/ d2W3guxV+qCR9kzQ2N8oDtkLsaMFSnNkgnFB071VfyH8oJmIzBdFACfNXQ7yrqZDrf4P8chupm CaNIa88lBhSUaLmGE7qeY7ffp0pajYVxZHyEebFlviB47bLOs4Ji81vaGxj425yWc6ZyeBd5EA PBkOcMBkFbm0C6+NrMG8vvCpFJPwfQ12rOIMFJ+AAxXM/ZlBqU4b8WGo46bdZn+iGxIfqxTIo3 yppCEJyqc+cqudJDaeGTy/hUYANrcj6seK/2mBIIDNeJOA==; 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=hXSTLfHN7RA+qZbxOxhvqelSM6H625s5MZPQ6MLcb1c=; b=2D1yQCcL2IcA1oR2T38CKWhLIT txNSBRTTljYekp/HMx1QkNSOOE6cJJyGT2xzGwc1E4O3tk6frHjXt+BZBy9oarQ5HCOzz63qjj2B+ 5MVOnl2LUU08OT9rM08KoEpEf4V+k+45QCLMKH0T4VK5cEKKNot7cJbYwdmSfRxwUA/g=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-q0dl.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1w30Lx-00000002v0B-2BmE for openembedded-core@lists.openembedded.org; Wed, 18 Mar 2026 23:31:11 +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=hXSTLfHN7RA+qZbxOxhvqelSM6H625s5MZPQ6MLcb1c=; b=cws5RpworKRBWYQco6dM4GsviH xTAe9rlyx+RnAOzbBaCB3ij0OTvSA84fMiPSVghtyJUQo9xyy+2lVMbSy7IDcH9x5X3dd70PWpymN kVZ+9sDE8me0Dmms6xO/FDhlLkWE8oTXM0HAltRcfoyUFqtBr20L0iXeAAZO0JLqPYLA=; Received: from [82.57.88.19] (port=60381 helo=[192.168.178.43]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.1) (envelope-from ) id 1w30Lr-00000000OEU-2vzj; Wed, 18 Mar 2026 23:30:59 +0000 From: Francesco Valla Date: Thu, 19 Mar 2026 00:30:49 +0100 Subject: [PATCH RFC 1/4] bootconfig: add recipe MIME-Version: 1.0 Message-Id: <20260319-bootconfig-v1-1-a4d467c3f0ba@valla.it> References: <20260319-bootconfig-v1-0-a4d467c3f0ba@valla.it> In-Reply-To: <20260319-bootconfig-v1-0-a4d467c3f0ba@valla.it> To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer , Francesco Castagnotto , Francesco Valla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1756; i=francesco@valla.it; h=from:subject:message-id; bh=Vw9mGtbDOhJ329QqCYKT2+fJMnTnLr4YQNo5LgarFLs=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDJm7TTc1Pk95FhU498W2oP0nLIzWKu7a2Zao8V3ldSD7n pkLTQQvdZSyMIhxMciKKbKErLtxb89c829pGxgfwcxhZQIZwsDFKQATsfNg+Gfbqp64UZlJa9IO o4kbuja9z65ryPGcVX7onegFA421bNIMf6UTvpQuW2e5fmFIZMi30z+YQq7/sOpL1FK1s0qYdiM imhMA 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: 9a8a90d00fe595008f659b536e084428 X-AntiAbuse: ID - 9a8a90d00fe595008f659b536e084428 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1w30Lx-00000002v0B-2BmE-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-q0dl.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 ; Wed, 18 Mar 2026 23:31:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/233451 Add a new recipe for the bootconfig tool, with source coming directly from the kernel shared workdir. Signed-off-by: Francesco Valla --- meta/recipes-kernel/bootconfig/bootconfig.bb | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/meta/recipes-kernel/bootconfig/bootconfig.bb b/meta/recipes-kernel/bootconfig/bootconfig.bb new file mode 100644 index 0000000000000000000000000000000000000000..77ee70dd1839ef90a292cf829f4f3a4353f85c28 --- /dev/null +++ b/meta/recipes-kernel/bootconfig/bootconfig.bb @@ -0,0 +1,44 @@ +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 + +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} \ + CROSS=${TARGET_PREFIX} \ + CC="${CC} ${DEBUG_PREFIX_MAP} -ffile-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} ${CFLAGS}" \ + HOSTCC="${BUILD_CC} ${BUILD_CFLAGS}" \ + LD="${LD}" \ + AR=${AR} \ + ARCH=${ARCH} \ + V=1 \ + 'DESTDIR=${D}' \ + 'prefix=${prefix}' \ + 'bindir=${bindir}' \ +" + +do_compile() { + oe_runmake ${B}/bootconfig +} + +do_install() { + install -d ${D}${bindir} + oe_runmake install +} + + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +python do_package:prepend() { + d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) +} + +B = "${WORKDIR}/${BPN}-${PV}" + +BBCLASSEXTEND = "native nativesdk" From patchwork Wed Mar 18 23:30:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Valla X-Patchwork-Id: 83792 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 20A991088E5C for ; Wed, 18 Mar 2026 23:31:15 +0000 (UTC) Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.9]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.28202.1773876673988802525 for ; Wed, 18 Mar 2026 16:31:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@antispam.mailspamprotection.com header.s=default header.b=RGOttPym; dkim=pass header.i=@valla.it header.s=default header.b=iUyrdHLo; spf=pass (domain: valla.it, ip: 185.56.87.9, mailfrom: francesco@valla.it) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-jxsh.prod.antispam.mailspamprotection.com; s=arckey; t=1773876674; b=BHNp/0rbcJ+by3TsTuNOKe0WQR/67xi+m+97jT5cuMZ5ogfLmIkO2Kw/cPszEl4cT20wswnYOW bcJHvm6Psi0XcoWCKqf9ho7MPIlplw76G+gwfu93jMqbEjoXGq6Uy8998SDnq8ERv9CF/UTRBA EH4z7T3MnppQyepD8h54sGMRYUWdrcftSccxEvWbB6sKNKQBsHfwunGooOIIBC+8i13IMggRRQ DuDS15J+EL11yqKkMmKhOneWQZgSnP0x+e9ATksi/JfS3R4oJY+ozvG0nQQ06DIUBQegYvfpc/ jQeH/JI2a3ducFTwlLr7SX1Qgn3I2CWqetFq863zTG39sg==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-jxsh.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-jxsh.prod.antispam.mailspamprotection.com; s=arckey; t=1773876674; bh=ufKnjS6Nrw6tfuZfwT5mLqvpNhC8fqraIzVx4+SAFjA=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=tnmL20sc5n8ZBC2P8kygjhH069QwwqT1Dz5G7q0o82lUunoxTCcO1Kn6v9kANdbNqleCtzHZ7s 6DbQh0+tmTMWDRI2lu3lVIC/NSt0iUaWiK/I0e2Wmbk9cptMSyNd1Oi1nfKdVcYYQZdJZQDboy k1Zuber5VPvpvB1XW9qGAaXveJcGaq7a2Pc1td/r9N3r7ZM2MthtB+nmvV54QEW742ghA1bjqi wEQ97HJjjcQEA4KEpwikhWN+8ZBIn8xnFRY7CWLQcoi/+p08FglLKEJ/iNnmmiig0rHPBAaBMS fsCdLZCpwbTWFO85zLB8qeWz7owQSNheHbuFZHk7sv7O1g==; 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=Pc+tnRJ83ZyDrF5FXkdsoQ0oH7VketqCKMCDjLknofE=; b=RGOttPym2ZUAjhWeP6FYhtH7Do TmKqI997gR5yG5nWAmREDtxLcourD0ko7Pt4Lxkg9pn6YBbmRw7/IZIAjE765F0k/L7mu7EsD6ZBt 1PT3XFnvLngdnk5WCYrUw3ZuNcLVcAMcerLeTwA4BtAoiudQYDacmF6S331Ta9fD7TIw=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-jxsh.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1w30Lx-00000000hVV-3Bzy for openembedded-core@lists.openembedded.org; Wed, 18 Mar 2026 23:31:12 +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=Pc+tnRJ83ZyDrF5FXkdsoQ0oH7VketqCKMCDjLknofE=; b=iUyrdHLohIWB0KC9batsrrV130 AbYkhtExg8RWvwHED9z3RtKJTEd3lK/q69skryjJszWxtXIww5t3Z5EZ0KuWeRqo1CoFEFOzSlOit dRV+ZtEYqXdrNjmBvG8RuA1gkb2n3J1RLwZVQQ/d5ryFHkKmqUTRm8EU/Z/JByqTq/YU=; Received: from [82.57.88.19] (port=60381 helo=[192.168.178.43]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.1) (envelope-from ) id 1w30Lr-00000000OEU-3sn4; Wed, 18 Mar 2026 23:30:59 +0000 From: Francesco Valla Date: Thu, 19 Mar 2026 00:30:50 +0100 Subject: [PATCH RFC 2/4] image_types: add bootconfig conversion type MIME-Version: 1.0 Message-Id: <20260319-bootconfig-v1-2-a4d467c3f0ba@valla.it> References: <20260319-bootconfig-v1-0-a4d467c3f0ba@valla.it> In-Reply-To: <20260319-bootconfig-v1-0-a4d467c3f0ba@valla.it> To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer , Francesco Castagnotto , Francesco Valla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4249; i=francesco@valla.it; h=from:subject:message-id; bh=ufKnjS6Nrw6tfuZfwT5mLqvpNhC8fqraIzVx4+SAFjA=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDJm7TTdVr7u2fX1UbUi1ypL+nydSn32J3dLlXszu7X9UN rXgp8eqjlIWBjEuBlkxRZaQdTfu7Zlr/i1tA+MjmDmsTCBDGLg4BWAiUyYxMvx4Xn0v17mXp8Jg NfdtFmuxacuExQ1Tkj/v8Heeq73h4SeG/64Wu+e8tjQI4l+RIseSu+VQ1tnSDcs/SlXFlWm2Tf5 ezQAA 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: e38abe9fad07af3a65c519cbc7e149c7 X-AntiAbuse: ID - e38abe9fad07af3a65c519cbc7e149c7 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1w30Lx-00000000hVV-3Bzy-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-jxsh.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 ; Wed, 18 Mar 2026 23:31:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/233450 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_SRC: source file to be used as bootconfig, to be found inside DEPLOY_DIR_IMAGE; - BOOTCONFIG_TASK: task deploying the bootconfig source file specified in BOOTCONFIG_SRC to DEPLOY_DIR_IMAGE; an image using the bootconfig modifier will depend on it. Signed-off-by: Francesco Valla --- meta/classes-recipe/bootconfig-config.bbclass | 12 ++++++++++++ meta/classes-recipe/image_types.bbclass | 15 +++++++++++++-- 2 files changed, 25 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..3d34fc47a3a684aef1ecdbd5ed52c904611bf95d --- /dev/null +++ b/meta/classes-recipe/bootconfig-config.bbclass @@ -0,0 +1,12 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +# Name of the file to be used as bootconfig source, to be found inside DEPLOY_DIR_IMAGE +BOOTCONFIG_SRC ?= "" + +# Task deploying the bootconfig source to DEPLOY_DIR_IMAGE +# e.g.: BOOTCONFIG_TASK = "bootconfig-debug:do_deploy" +BOOTCONFIG_TASK ?= "" diff --git a/meta/classes-recipe/image_types.bbclass b/meta/classes-recipe/image_types.bbclass index e6ef0ce11e40c0f8388fb5547ab03943004bde2f..98c6d9e836f5c80f78e6f6f32aa923de66feb836 100644 --- a/meta/classes-recipe/image_types.bbclass +++ b/meta/classes-recipe/image_types.bbclass @@ -264,9 +264,18 @@ IMAGE_CMD:f2fs () { sload.f2fs -f ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}.f2fs } +oe_bootconfig() { + local src_image=$1 + if [ -z "${BOOTCONFIG_SRC}" ]; then + bbfatal "bootconfig image type requested but BOOTCONFIG_SRC is not set" + fi + cp ${src_image} ${src_image}.bootconfig + bootconfig -a ${DEPLOY_DIR_IMAGE}/${BOOTCONFIG_SRC} ${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 +342,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 +369,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 +390,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 = "bootconfig-native ${BOOTCONFIG_TASK}" RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4" RUNNABLE_MACHINE_PATTERNS ?= "qemu" From patchwork Wed Mar 18 23:30:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Valla X-Patchwork-Id: 83790 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 EE7861088E59 for ; Wed, 18 Mar 2026 23:31:14 +0000 (UTC) Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.13]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.28203.1773876674119473579 for ; Wed, 18 Mar 2026 16:31:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@antispam.mailspamprotection.com header.s=default header.b=VthXKHad; dkim=pass header.i=@valla.it header.s=default header.b=IeHbV1el; spf=pass (domain: valla.it, ip: 185.56.87.13, mailfrom: francesco@valla.it) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-q0dl.prod.antispam.mailspamprotection.com; s=arckey; t=1773876674; b=QglUueik1lqinZemiB953xs10T3xnb7Tk0mEEFXitM3znHH3s/FjXfEedcNrrGHaCMs+GUwuhB joScigyQ+kPOw3aCNl/3U/MZS7jDBVKgBpAi+vBY2lPwCoA1HwuxP+2XbqaOrvZAeFDGD7mUUZ t0h3ntTIfr/riVt8HNbXnkpH44CRRNzlwLVcEwmb/HnYsrpNCIeZS/HDQDBgBm/2NnfVUe4zmo f4omYDlhdq3j8P/3Hd8DjVEc/ocj7XSeJYkpJ9lulJI8obF2BYTLPHZyRq8BKAgH/R0lbBjhVi A25B99yMFYHrJ/Axow1ZRLg8MOVGuNgXLaDqeKPL7BCK9Q==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-q0dl.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-q0dl.prod.antispam.mailspamprotection.com; s=arckey; t=1773876674; 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=TKUEFlyhSCP3Sbtdj80KqsoalFA6drYArmkgCtnzvCzztHVhygdoJLTX8T+UbW2E8dXMFZ5WFr +37u+Vt47Wbcth/RVM4mSyM2SOS1E4NM4iEGflhtCDe0pgTpP4giGF9rdeI8f+29xHEoLk5Sgg zSqg7LzWOLIQFcQqmN1x+TGmO8/2i0J2wGI6O9Ptb0y/VRiXidJF5RugX0h5otjL9sZQMJdfg8 h7aHQZeCY2De+66Sx9X4R7zBj+F9zXPBy1ViuSROt/FLit5sl/qowMNw7LCqurqwkgvYjoRCbL ss88w/MoxuT4coXC8j0IXdRb3UCPk5TT3c9XPsfO3el6aw==; 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=VthXKHadPPA3evMNHeduISSfiY GvnkfUnUS8LLAPFWaSs/8U7S0+j+2sOC+BoILmlkJq1lacIAwjxqPO3fdwzE6k6Tkqx3Wd4L/7Q6I Rj4Yz3D1aaAfBJeZilO42gD9m6EdA0uOHL69Gvo9f7XcXrSeXr0KEwqHNwHPBEyYO3Ps=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-q0dl.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1w30Lx-00000002v0p-42Lu for openembedded-core@lists.openembedded.org; Wed, 18 Mar 2026 23:31:12 +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=IeHbV1elM45Ms/djQKAnkIbZ8t W/YHr7iVW4/68Gp6ubWatyO7HCFBXkRLQIbg1YEEC3tyO9dni9n0rRtBDfSRxTOKkILnh1USOQoBS YZjB2tgXzkXXDCf+S9GfLKlF+cpcDEgaHuShfyvvFOIlSI5jQKy5UbHWTs5wXe9khh+Q=; Received: from [82.57.88.19] (port=60381 helo=[192.168.178.43]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.1) (envelope-from ) id 1w30Ls-00000000OEU-0ddt; Wed, 18 Mar 2026 23:31:00 +0000 From: Francesco Valla Date: Thu, 19 Mar 2026 00:30:51 +0100 Subject: [PATCH RFC 3/4] recipes-test: add bootconfig-test recipe MIME-Version: 1.0 Message-Id: <20260319-bootconfig-v1-3-a4d467c3f0ba@valla.it> References: <20260319-bootconfig-v1-0-a4d467c3f0ba@valla.it> In-Reply-To: <20260319-bootconfig-v1-0-a4d467c3f0ba@valla.it> To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer , 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=owGbwMvMwCX2aH1OUIzHTgbG02pJDJm7TTctrRFPmuvoX7DJti7z5IZ2+3Pvd0l6hEZIznpwb U6AxpSLHaUsDGJcDLJiiiwh627c2zPX/FvaBsZHMHNYmUCGMHBxCsBEQkMZGfa83raIdfJ9Xq1j 6x998E6d90nmit+teTczlUPuHFhoM92c4X+t+Z//ibP3zA4PvjU97l+Kl1oXn2TK4YaEqFN3Alt nfWYCAA== 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: 9248a1904e893a0b8d21d0f90a482c2f X-AntiAbuse: ID - 9248a1904e893a0b8d21d0f90a482c2f AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1w30Lx-00000002v0p-42Lu-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-q0dl.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 ; Wed, 18 Mar 2026 23:31:14 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/233449 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 Wed Mar 18 23:30:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Valla X-Patchwork-Id: 83793 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 5B3CB1088E60 for ; Wed, 18 Mar 2026 23:31:15 +0000 (UTC) Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.2]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.28204.1773876674442824363 for ; Wed, 18 Mar 2026 16:31:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@antispam.mailspamprotection.com header.s=default header.b=mOjjRXc8; dkim=pass header.i=@valla.it header.s=default header.b=eJaSlLLz; spf=pass (domain: valla.it, ip: 185.56.87.2, mailfrom: francesco@valla.it) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-q0dl.prod.antispam.mailspamprotection.com; s=arckey; t=1773876674; b=cg6Kw7BbFVolFfqJN5ySLMSBMmt8/07cItuTHg8ViWaafvPsI6bBeCaaUaw60aHypzTlsqDzL/ y9VHg9beyeXDvywZxMW259KMZO1+9TOqyNurWOISbSVROvAuukUiY14vEQo15dhbG0MvTynRMo edVL4si3GfbzPvmlG3sG4zvwvh4N7THZcU0wIhrLYXHwi0lPvRZRJTK0iaJtDU1HWzz+2MaD1J RVHmfzN5Mynrlhsi7VrvkLhb8r5kmEVh2OZ9AR6GXFTZme+1kql0MR5kTGis0K3S/KfIJlLgYl wr5MdWAIFxIk1R8K2BGqvDOPqk/4eKL1ESI5ddTCmKyLyQ==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-q0dl.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-q0dl.prod.antispam.mailspamprotection.com; s=arckey; t=1773876674; bh=eyagR5ixnG4RlnxU64InA//I/XgeohFqLE956Rt/7U4=; h=Cc:To:In-Reply-To:References:Message-ID:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:DKIM-Signature:DKIM-Signature; b=iCfxHlJqacmBIkkOTSoR5i74rdXn3c7v47ilohWZdjdlYIOLNGcK/Ucj79shiqEEZ0HmBTs/lN 61WsJvgvqsXr6gwaswHuK4fS4I6fhwQ7T4CsGCBQYCJsH/Zf3aEFHcUaB4/Oy+kr3bhJ9FLtWr geA1Pq60qCLyJcWILg1e4zf1DpPHe3+3Wa53iEZc3az2H5GKy6aLSOly5/J9xpe0CrbeHJCw0T MJ9998LS0/5fwmJGjnpGeyUMf0OizFqTWl9P+CmqDf9Ps25G5QsA1trW4zcgHYAY9SKeFEANn9 GkCmQQInQ26mE1cm3+cvF/ewE64m2pKONZrPLY2azUImfA==; 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=pJM+cQtBC7J6curDWgu+s4XFLODNQqRmkdyVgCdnD+I=; b=mOjjRXc8BsCajfPBb8qdWlpdxh eK3roBQ4CEXk8YEgfVRaPbYIYDQOQCgylOjLL04V6QbOL8fy8xfqZ3UqNeWbkaU7tTX5aIHL8GlWM 1eCloYPwC/nClVXz6Mqr+9meLSfsk7eso/S1CnmzW9jU8e2B0UnbDbTycCYvUA3TA7qM=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-q0dl.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1w30Ly-00000002v1J-0Ms1 for openembedded-core@lists.openembedded.org; Wed, 18 Mar 2026 23:31:12 +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=pJM+cQtBC7J6curDWgu+s4XFLODNQqRmkdyVgCdnD+I=; b=eJaSlLLzCbYMJABn2nNvsHizJJ DCy11RZq5SHdYLilJQclB6/zPD14TwVO55g0SPTYY6zdI1R3xtBR5C2WkLTNmjaimer6fxQWHxtMb fR3AfNH29kuRsbOK56FFMyJRob5aSYWFIqpH06i5c8NCl1O8qe53lZOXZCoX1chkgIF4=; Received: from [82.57.88.19] (port=60381 helo=[192.168.178.43]) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.1) (envelope-from ) id 1w30Ls-00000000OEU-1aIF; Wed, 18 Mar 2026 23:31:00 +0000 From: Francesco Valla Date: Thu, 19 Mar 2026 00:30:52 +0100 Subject: [PATCH RFC 4/4] kernel-fit-image: add bootconfig support MIME-Version: 1.0 Message-Id: <20260319-bootconfig-v1-4-a4d467c3f0ba@valla.it> References: <20260319-bootconfig-v1-0-a4d467c3f0ba@valla.it> In-Reply-To: <20260319-bootconfig-v1-0-a4d467c3f0ba@valla.it> To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer , Francesco Castagnotto , Francesco Valla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=14658; i=francesco@valla.it; h=from:subject:message-id; bh=eyagR5ixnG4RlnxU64InA//I/XgeohFqLE956Rt/7U4=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDJm7TTevet64enNABP+RhtKLEkG1L2/PbP/W+u/RqXbvF xeemcSxdJSyMIhxMciKKbKErLtxb89c829pGxgfwcxhZQIZwsDFKQATCd7N8E/Lw0syLICVfX6x //H9py1OGiZ+S930O/PkhpvSs854TeBmZGjKvH4zNbLTeCHbOuuQ7IczMved1PuSq9Rtbzz11mP zDfwA 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: da7a393fc58a44cad08d8f0c3def8f23 X-AntiAbuse: ID - da7a393fc58a44cad08d8f0c3def8f23 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1w30Ly-00000002v1J-0Ms1-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-q0dl.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 ; Wed, 18 Mar 2026 23:31:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/233452 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 specified in BOOTCONFIG_SRC 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 | 44 +++++++++++++++++-- meta/conf/image-fitimage.conf | 3 ++ meta/lib/oeqa/selftest/cases/fitimage.py | 63 ++++++++++++++++++++++++---- 3 files changed, 98 insertions(+), 12 deletions(-) diff --git a/meta/classes-recipe/kernel-fit-image.bbclass b/meta/classes-recipe/kernel-fit-image.bbclass index 367bc9bcfd3a4cd237e466269fa143941a02031a..9188723252912f2db6c9952798f66798cfe32b78 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 ''} \ + ${@'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_TASK') and d.getVar('FIT_INCLUDE_BOOTCONFIG') == '1': + d.appendVarFlag('do_compile', 'depends', ' ${BOOTCONFIG_TASK}') + #check if there are any dtb providers providerdtb = d.getVar("PREFERRED_PROVIDER_virtual/dtb") if providerdtb: @@ -54,8 +58,24 @@ FIT_KERNEL_SIGN_ENABLE ?= "${UBOOT_SIGN_ENABLE}" FIT_KERNEL_SIGN_KEYNAME ?= "${UBOOT_SIGN_KEYNAME}" FIT_KERNEL_SIGN_KEYDIR ?= "${UBOOT_SIGN_KEYDIR}" +create_bootconfig_bin() { + if [ ! -e ${DEPLOY_DIR_IMAGE}/${BOOTCONFIG_SRC} ]; then + bbfatal "Did not find bootconfig source file: ${DEPLOY_DIR_IMAGE}/${BOOTCONFIG_SRC}" + fi + + # Create empty file + dd if=/dev/zero of=bootconfig.bin count=0 + + # Add bootconfig to file + bootconfig -a ${DEPLOY_DIR_IMAGE}/${BOOTCONFIG_SRC} 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 +155,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 +180,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..3d3f7cc036253c6ecffa86d844a7113504447912 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_SRC', + 'BOOTCONFIG_TASK', '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_SRC = "bootconfig-test.txt" +BOOTCONFIG_TASK = "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_SRC': "", + 'BOOTCONFIG_TASK': "", # kernel-uboot.bbclass 'FIT_KERNEL_COMP_ALG': "gzip", 'FIT_KERNEL_COMP_ALG_EXTENSION': ".gz",