From patchwork Thu Jul 4 07:09:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45974 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 9D0CAC3271F for ; Thu, 4 Jul 2024 07:10:23 +0000 (UTC) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.groups.io with SMTP id smtpd.web11.4915.1720077022495875510 for ; Thu, 04 Jul 2024 00:10:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=duA8hbyY; spf=pass (domain: gmail.com, ip: 209.85.128.53, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-42122ac2f38so1709095e9.1 for ; Thu, 04 Jul 2024 00:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077021; x=1720681821; 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; bh=biYJs5eXheKm9DiAQNapPuCwj3pEhHbiXPaFy0LvGNc=; b=duA8hbyYI5dmGAzKyMR6CaqQxHvbxdP8zTmLrzWVhgr9YMPfadDQJX9+MKbCgLjTT+ /4f48VwqUsD+1POgXHyZTo7gE2Gwjcv/Q9SjG6FOlBiR+ZxFMH9RDIk8EupvuxGVLEh9 OX3pvuKqoQ3ORvtwA2J2Ou1WKo3LAhcqndbDcDHEAdyOJdpjQe1XVhkKCsU5CuNJVP6E BvsF1osqYreMM9r/owMk/tDED5SItWdW3XXBjNshnViXU5vWSl9PAkHweLAphFJwAL8i xomB+as2BeGs9xi/HlXzaxg9tmRyu4EXDMKOoetkTGbNCdef5RKtmTRuYf9KquRIvkXE 8jHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077021; x=1720681821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=biYJs5eXheKm9DiAQNapPuCwj3pEhHbiXPaFy0LvGNc=; b=OG0riKdfIBO7jgN+Ap3IvN6rFnqkQejn1TNnrsxShHVP30m+Of0c21fV5UujVJPIwl BH6jgFuWjrLK9stWsrFrOT7YkIZTK0IXZGbnpX/bKwoqcJKbF6JWRtElL1uEnQYmVd2b 901A8DYh8X1FM187XFghjUFsg5Ay9GNUXlKzSON5B/pv/Gb+M0EBxo3vLxVIcH4gVMD4 8KGY7xvP+XpxF2FU5B9HRdrXQNeXtv8fQKwCx7mSVesWnMQYWw5ZGq5JpaHFSctarpxu QAE1kWdlXg4WwKYkgxmEWAbo+fd5by4Bkzubyb7MVKuo2lr9b1O35Z9Snp7WQBU71Hmd bRAQ== X-Gm-Message-State: AOJu0YwdbDBsPt2l7QxL2FFcR5ztDkFD/MUlFECE3U/TCNUws3SUPDTx sUjmn+RDwfohGh1Le9S35DTMl4byu0ysp/FHNKUi06K9KXx+NvsA/mPvFw== X-Google-Smtp-Source: AGHT+IEdHgWdEO5gRPGOAQ9dwUHJrHZPRfOtTbY1bKpX1trUG4ZhYyWIj28kruC0HwWVtBTMVMwcaQ== X-Received: by 2002:a05:600c:2150:b0:425:7c42:d24b with SMTP id 5b1f17b1804b1-4264b181dbemr4275825e9.18.1720077020409; Thu, 04 Jul 2024 00:10:20 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:20 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 01/14] oe-selftest: wic fix deps of test_efi_plugin_unified_kernel_image_qemu Date: Thu, 4 Jul 2024 09:09:37 +0200 Message-ID: <20240704071013.2982700-2-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201505 From: Adrian Freihofer oe-selftest wic.Wic2.test_efi_plugin_unified_kernel_image_qemu failed with: AssertionError: Command 'bitbake core-image-minimal core-image-minimal-initramfs ovmf' returned non-zero exit status 1: bitbake reported: FileNotFoundError: [Errno 2] No such file or directory: '.../build-st-242167/tmp/deploy/images/qemux86-64/core-image-minimal-initramfs-qemux86-64.cpio.gz' WARNING: .../build-st-242167/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/temp/run.do_image_wic.986859:162 exit 1 from 'BUILDDIR="/home/adrian/projets/oss/poky/build-st-242167" PSEUDO_UNLOAD=1 wic create "$wks" --vars ".../build-st-242167/tmp/sysroots/qemux86-64/imgdata/" -e "core-image-minimal" -o "$build_wic/" -w "$tmp_wic"' Creating a configuration as the test does and calling bitbake -g core-image-minimal does not show a dependency from core-image-minimal:do_image_wic on core-image-minimal-initramfs:do_image_complete. Adding the dependency directly to the test case resolves the issue. Since the dependency is basically created by the wks file solving this in a more generic way, e.g. by handling the dependency in image_types_wic.bbclass does not look like simple. Signed-off-by: Adrian Freihofer --- meta/lib/oeqa/selftest/cases/wic.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index b616759209a..b1315c5b432 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1294,7 +1294,11 @@ class Wic2(WicTestCase): 'WKS_FILE = "test_efi_plugin.wks"\n'\ 'MACHINE_FEATURES:append = " efi"\n' self.append_config(config) - bitbake('core-image-minimal core-image-minimal-initramfs ovmf') + # Rather than creating a special image which adds the dependency which is needed by the wks file + # core-image-minimal:do_image_wic[depends] += "core-image-minimal-initramfs:do_image_complete" + # core-image-minimal-initramf is built before it is used by core-image-minimal. + bitbake('core-image-minimal-initramfs') + bitbake('core-image-minimal ovmf') self.remove_config(config) with runqemu('core-image-minimal', ssh=False, From patchwork Thu Jul 4 07:09:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45976 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 7ED0BC30653 for ; Thu, 4 Jul 2024 07:10:33 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.groups.io with SMTP id smtpd.web11.4917.1720077023126824171 for ; Thu, 04 Jul 2024 00:10:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WoGO2RyA; spf=pass (domain: gmail.com, ip: 209.85.221.43, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-3678aa359b7so879458f8f.1 for ; Thu, 04 Jul 2024 00:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077021; x=1720681821; 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; bh=M7o8et+Cj/JsBgxSKbRMLY9RJBx4VeDQyfVPIwUOdoM=; b=WoGO2RyAzAljjkhjbEUZ2aNegMN//P+HBpt3ryRrpUrRDLmZcn+UxMcpUb66m8VdSm ghp11yw1rOq6hssSZVciizJ5FpUlqx6W7gsgTZR+TxAQD+l6Sib04qcSEcz45ZWciTfE K2pv2Z35mPkUZBHJSBV7NHr5fZEMibuPKmKirn5qP8hOuLDGYFFWWwNoDyDRAfC8bGmw xI61hmmgAjAn+/+2d2MmJWYLo8GUrXCxHAzOhPBi56M2N8uar5stG3SEvqzREMWTCLiS exReObmwYtFHrf8+GX8OaLUM48eokunqccbtRHioPDrsqHC/beIe0dm80veyY0iiFLyf 3PZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077021; x=1720681821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M7o8et+Cj/JsBgxSKbRMLY9RJBx4VeDQyfVPIwUOdoM=; b=h92LcHFa93mG1wBxQgsaEPObW1VtqzKHj3QYRJhspfp6dOXs9NqTy7QflV+J5G6/6/ xCdTwfkXXHuL/E/F3if8k7eF3GHS5zWDuH1jsEcpYvCLwNRGqV+pfSms8Aqk8O4ShxJh hmBM9+62zUllfX4QGuKNm+/b7eFgIN+wWFjtyrDbmBRTXkK8f4Ncp+FvWiG01VLOij42 zv/CaiGZz+1vi1y7+OdMOGtbh1BGZ7bJuz246y6vX1bxZZhTNKX9fsY8shWzLg7UiHv0 rxsa62ZMxIGHnk9WwYNHAYnBt8PRtyYZ+QpiHNrZETKmW8m2ot3UD3Lxj8kip/iKUc7o OFpA== X-Gm-Message-State: AOJu0Yw5PIHtagM+PFWhm5tkfNxR8XuE755+1xMwg+CvECLIYTZC1dWY zQtrazS2z5Y34w/1ySBJDjfTdOTDroZlbJDutfw9GGD/6Di5eyamgtS/1g== X-Google-Smtp-Source: AGHT+IF2kSj/OHcWjrqfdxCTJTOy7QWnX381p590yOwnhg6NShYQyZx0uPOa8DxsEWxC+Pr/NmPj2g== X-Received: by 2002:a05:6000:a82:b0:367:89ae:c204 with SMTP id ffacd0b85a97d-3679f6e5592mr493573f8f.12.1720077021053; Thu, 04 Jul 2024 00:10:21 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:20 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 02/14] oe-selftest: fitimage refactor u-boot-tools-native Date: Thu, 4 Jul 2024 09:09:38 +0200 Message-ID: <20240704071013.2982700-3-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201507 From: Adrian Freihofer Eliminate code duplication with a new function. Use get_bb_var instead of bitbake -e | grep. Signed-off-by: Adrian Freihofer --- meta/lib/oeqa/selftest/cases/fitimage.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 347c0653776..15baf3b2392 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py @@ -11,6 +11,11 @@ import re class FitImageTests(OESelftestTestCase): + def _setup_uboot_tools_native(self): + """build u-boot-tools-native and return RECIPE_SYSROOT_NATIVE""" + bitbake("u-boot-tools-native -c addto_recipe_sysroot") + return get_bb_var('RECIPE_SYSROOT_NATIVE', 'u-boot-tools-native') + def test_fit_image(self): """ Summary: Check if FIT image and Image Tree Source (its) are built @@ -195,10 +200,8 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" self.assertEqual(value, reqvalue) # Dump the image to see if it really got signed - bitbake("u-boot-tools-native -c addto_recipe_sysroot") - result = runCmd('bitbake -e u-boot-tools-native | grep ^RECIPE_SYSROOT_NATIVE=') - recipe_sysroot_native = result.output.split('=')[1].strip('"') - dumpimage_path = os.path.join(recipe_sysroot_native, 'usr', 'bin', 'dumpimage') + uboot_tools_sysroot_native = self._setup_uboot_tools_native() + dumpimage_path = os.path.join(uboot_tools_sysroot_native, 'usr', 'bin', 'dumpimage') result = runCmd('%s -l %s' % (dumpimage_path, fitimage_path)) in_signed = None signed_sections = {} @@ -516,10 +519,8 @@ UBOOT_FIT_HASH_ALG = "sha256" self.assertEqual(value, reqvalue) # Dump the image to see if it really got signed - bitbake("u-boot-tools-native -c addto_recipe_sysroot") - result = runCmd('bitbake -e u-boot-tools-native | grep ^RECIPE_SYSROOT_NATIVE=') - recipe_sysroot_native = result.output.split('=')[1].strip('"') - dumpimage_path = os.path.join(recipe_sysroot_native, 'usr', 'bin', 'dumpimage') + uboot_tools_sysroot_native = self._setup_uboot_tools_native() + dumpimage_path = os.path.join(uboot_tools_sysroot_native, 'usr', 'bin', 'dumpimage') result = runCmd('%s -l %s' % (dumpimage_path, fitimage_path)) in_signed = None signed_sections = {} @@ -671,10 +672,8 @@ FIT_SIGN_INDIVIDUAL = "1" self.assertEqual(value, reqvalue) # Dump the image to see if it really got signed - bitbake("u-boot-tools-native -c addto_recipe_sysroot") - result = runCmd('bitbake -e u-boot-tools-native | grep ^RECIPE_SYSROOT_NATIVE=') - recipe_sysroot_native = result.output.split('=')[1].strip('"') - dumpimage_path = os.path.join(recipe_sysroot_native, 'usr', 'bin', 'dumpimage') + uboot_tools_sysroot_native = self._setup_uboot_tools_native() + dumpimage_path = os.path.join(uboot_tools_sysroot_native, 'usr', 'bin', 'dumpimage') result = runCmd('%s -l %s' % (dumpimage_path, fitimage_path)) in_signed = None signed_sections = {} From patchwork Thu Jul 4 07:09:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45979 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 8ACC9C41513 for ; Thu, 4 Jul 2024 07:10:33 +0000 (UTC) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.groups.io with SMTP id smtpd.web10.5043.1720077023634939455 for ; Thu, 04 Jul 2024 00:10:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OEcTtxM7; spf=pass (domain: gmail.com, ip: 209.85.128.46, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4256aee6e4dso1886305e9.1 for ; Thu, 04 Jul 2024 00:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077022; x=1720681822; 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; bh=i4kYEv4+Ia1Yc0EMof7AFIkGmXmCTtrt6tBMU0SZbM0=; b=OEcTtxM7me8INfVbHhDcwk27XByj4yVCNMxKzIy/IoYaTGN+ODPDz0Yez/7MJSfLNN IkxLPMQkWputkYclbhaZZ6BnzKPz5RRlib+n1R2ridYP8tCbv75TJbTDDLcCiI2k8IOL Ehk7eKwNJFsVOLJGKbDDxwClhwhW3ol2fvOD+uSqOLVwUnonjZem/xY74PynZ1wIZ4eN /StZAgv6x2ViQhXE7fM2rhNL3FpzPMdTbwZtI3YXgRhuMiUJN4tewcpq8Tl6RsNL/chQ 9yB/sqjH9fdp5HTM5tc+NSxfsfesl/MZ+TAi4xiwvS2jD/EFNSaoUSDTkC13eAbL2rSr nRqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077022; x=1720681822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i4kYEv4+Ia1Yc0EMof7AFIkGmXmCTtrt6tBMU0SZbM0=; b=j3XqKnzk/iRRKoEZGCzdwLKocS+QxRKOhImn7lzliLQkxEJDktZzkSb+cgkrDX+WK6 w4ZpeqYhGEqhsYAgVskHR1GQFxwwVOVZoWr6J9lFidREsrm1lFtOQ5l4NSSWVogtrZ86 C8llnG4CjTiBNQFhyyu6pjC0wZLWF+LD1IZxs+VYPoVC8S3I4XfR6o9FUgOmwcUUA1R0 QYVJbdbDry+Gu62L88yU6ke/AULqDUtY53c878dC9KulTBzR3laaNca5paTb+rUzOKtH 1QV96h1rOJoq3CqF2/iQ/IMda/wjqzsMZsx7gtTWRDm5aWtRP8iZZ9ehqrREdfePwSbW 48CQ== X-Gm-Message-State: AOJu0YwbRrDlX9LmCjNfTIsNIevd7sOfL3D01YjP6juBORpKmznI70LM EoSL2rn57gC6EXcpUM8ULMT8IhVZp+J2/UBE50o5bMKKwMYjXvp6OihHOA== X-Google-Smtp-Source: AGHT+IGMlB9NdD1cGVCNccFSV9ZvAMhINOQ4Dv4Dw6nbi+z1UR1p0U1BxP0Cq6hbTPJGTdK4NbiaaQ== X-Received: by 2002:a05:600c:4616:b0:424:eeca:6bd0 with SMTP id 5b1f17b1804b1-4264a3d76ccmr5206995e9.13.1720077021651; Thu, 04 Jul 2024 00:10:21 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:21 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 03/14] oe-selftest: fitimage drop test-mkimage-wrapper Date: Thu, 4 Jul 2024 09:09:39 +0200 Message-ID: <20240704071013.2982700-4-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201508 From: Adrian Freihofer Rather than writing hints into log files and verify the hints can be found, the tests should verify that the artifacts in the deploy folder are correctly signed. This is a much better test. u-boot-tools provide a utility fit_check_sign which can verify the signatures in fit images. Lets use it. grepping in temp/run. or temp/log. files also does not work if the tasks runs from sstate and the corresponding run file is not even generated. Signed-off-by: Adrian Freihofer --- .../classes/test-mkimage-wrapper.bbclass | 19 --- meta/lib/oeqa/selftest/cases/fitimage.py | 118 ++++++++++++------ 2 files changed, 77 insertions(+), 60 deletions(-) delete mode 100644 meta-selftest/classes/test-mkimage-wrapper.bbclass diff --git a/meta-selftest/classes/test-mkimage-wrapper.bbclass b/meta-selftest/classes/test-mkimage-wrapper.bbclass deleted file mode 100644 index 7c98d7b71e4..00000000000 --- a/meta-selftest/classes/test-mkimage-wrapper.bbclass +++ /dev/null @@ -1,19 +0,0 @@ -# Class to test UBOOT_MKIMAGE and UBOOT_MKIMAGE_SIGN -# (in conjunction with kernel-fitimage.bbclass) -# -# SPDX-License-Identifier: MIT -# - -UBOOT_MKIMAGE = "test_mkimage_wrapper" -UBOOT_MKIMAGE_SIGN = "test_mkimage_signing_wrapper" - -test_mkimage_wrapper() { - echo "### uboot-mkimage wrapper message" - uboot-mkimage "$@" -} - -test_mkimage_signing_wrapper() { - echo "### uboot-mkimage signing wrapper message" - uboot-mkimage "$@" -} - diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 15baf3b2392..4891ac8010b 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py @@ -16,6 +16,46 @@ class FitImageTests(OESelftestTestCase): bitbake("u-boot-tools-native -c addto_recipe_sysroot") return get_bb_var('RECIPE_SYSROOT_NATIVE', 'u-boot-tools-native') + def _verify_fit_image_signature(self, uboot_tools_sysroot_native, fitimage_path, dtb_path, conf_name=None): + """Verify the signature of a fit contfiguration + + The fit_check_sign utility from u-boot-tools-native is called. + uboot-fit_check_sign -f fitImage -k $dtb_name -c conf-$dtb_name + """ + fit_check_sign_path = os.path.join(uboot_tools_sysroot_native, 'usr', 'bin', 'uboot-fit_check_sign') + cmd = '%s -f %s -k %s' % (fit_check_sign_path, fitimage_path, dtb_path) + if conf_name: + cmd += ' -c %s' % conf_name + result = runCmd(cmd) + self.logger.debug("%s\nreturned: %s\n%s", cmd, str(result.status), result.output) + self.assertIn("Signature check OK", result.output) + + @staticmethod + def _find_string_in_bin_file(file_path, search_string): + """find stings in a binary file + + Shell equivalent: strings "$1" | grep "$2" | wc -l + return number of matches + """ + found_positions = 0 + with open(file_path, 'rb') as file: + byte = file.read(1) + current_position = 0 + current_match = 0 + while byte: + char = byte.decode('ascii', errors='ignore') + if char == search_string[current_match]: + current_match += 1 + if current_match == len(search_string): + found_positions += 1 + current_match = 0 + else: + current_match = 0 + current_position += 1 + byte = file.read(1) + return found_positions + + def test_fit_image(self): """ Summary: Check if FIT image and Image Tree Source (its) are built @@ -113,19 +153,21 @@ FIT_DESC = "A model description" Author: Paul Eggleton based upon work by Usama Arif """ + a_comment = "a smart comment" config = """ # Enable creation of fitImage MACHINE = "beaglebone-yocto" KERNEL_IMAGETYPES += " fitImage " -KERNEL_CLASSES = " kernel-fitimage test-mkimage-wrapper " +KERNEL_CLASSES = " kernel-fitimage " UBOOT_SIGN_ENABLE = "1" FIT_GENERATE_KEYS = "1" UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" FIT_SIGN_INDIVIDUAL = "1" -UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" -""" +UBOOT_MKIMAGE_SIGN_ARGS = "-c '%s'" +""" % a_comment + self.write_config(config) # fitImage is created as part of linux recipe @@ -227,17 +269,15 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" value = values.get('Sign value', None) self.assertEqual(len(value), 512, 'Signature value for section %s not expected length' % signed_section) - # Check for UBOOT_MKIMAGE_SIGN_ARGS - result = runCmd('bitbake -e virtual/kernel | grep ^T=') - tempdir = result.output.split('=', 1)[1].strip().strip('') - result = runCmd('grep "a smart comment" %s/run.do_assemble_fitimage' % tempdir, ignore_status=True) - self.assertEqual(result.status, 0, 'UBOOT_MKIMAGE_SIGN_ARGS value did not get used') + # Search for the string passed to mkimage: 1 kernel + 3 DTBs + config per DTB = 7 sections + # Looks like mkimage supports to add a comment but does not support to read it back. + found_comments = FitImageTests._find_string_in_bin_file(fitimage_path, a_comment) + self.assertEqual(found_comments, 7, "Expected 7 signed and commented section in the fitImage.") - # Check for evidence of test-mkimage-wrapper class - result = runCmd('grep "### uboot-mkimage wrapper message" %s/log.do_assemble_fitimage' % tempdir, ignore_status=True) - self.assertEqual(result.status, 0, 'UBOOT_MKIMAGE did not work') - result = runCmd('grep "### uboot-mkimage signing wrapper message" %s/log.do_assemble_fitimage' % tempdir, ignore_status=True) - self.assertEqual(result.status, 0, 'UBOOT_MKIMAGE_SIGN did not work') + # Verify the signature for all configurations = DTBs + for dtb in ['am335x-bone.dtb', 'am335x-boneblack.dtb', 'am335x-bonegreen.dtb']: + self._verify_fit_image_signature(uboot_tools_sysroot_native, fitimage_path, + os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], dtb), 'conf-' + dtb) def test_uboot_fit_image(self): """ @@ -354,7 +394,6 @@ UBOOT_ENTRYPOINT = "0x80080000" UBOOT_FIT_DESC = "A model description" KERNEL_IMAGETYPES += " fitImage " KERNEL_CLASSES = " kernel-fitimage " -INHERIT += "test-mkimage-wrapper" UBOOT_SIGN_ENABLE = "1" FIT_GENERATE_KEYS = "1" UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" @@ -428,6 +467,7 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'" work by Paul Eggleton and Usama Arif """ + a_comment = "a smart U-Boot comment" config = """ # There's no U-boot deconfig with CONFIG_FIT_SIGNATURE yet, so we need at # least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set @@ -437,7 +477,6 @@ SPL_BINARY = "MLO" # The kernel-fitimage class is a dependency even if we're only # creating/signing the U-Boot fitImage KERNEL_CLASSES = " kernel-fitimage" -INHERIT += "test-mkimage-wrapper" # Enable creation and signing of the U-Boot fitImage UBOOT_FITIMAGE_ENABLE = "1" SPL_SIGN_ENABLE = "1" @@ -449,17 +488,17 @@ UBOOT_LOADADDRESS = "0x80000000" UBOOT_DTB_LOADADDRESS = "0x82000000" UBOOT_ARCH = "arm" SPL_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000" -SPL_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'" +SPL_MKIMAGE_SIGN_ARGS = "-c '%s'" UBOOT_EXTLINUX = "0" UBOOT_FIT_GENERATE_KEYS = "1" UBOOT_FIT_HASH_ALG = "sha256" -""" +""" % a_comment + self.write_config(config) # The U-Boot fitImage is created as part of the U-Boot recipe bitbake("virtual/bootloader") - image_type = "core-image-minimal" deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') machine = get_bb_var('MACHINE') fitimage_its_path = os.path.join(deploy_dir_image, @@ -543,16 +582,14 @@ UBOOT_FIT_HASH_ALG = "sha256" self.assertEqual(len(value), 512, 'Signature value for section %s not expected length' % signed_section) # Check for SPL_MKIMAGE_SIGN_ARGS - result = runCmd('bitbake -e virtual/bootloader | grep ^T=') - tempdir = result.output.split('=', 1)[1].strip().strip('') - result = runCmd('grep "a smart U-Boot comment" %s/run.do_uboot_assemble_fitimage' % tempdir, ignore_status=True) - self.assertEqual(result.status, 0, 'SPL_MKIMAGE_SIGN_ARGS value did not get used') + # Looks like mkimage supports to add a comment but does not support to read it back. + found_comments = FitImageTests._find_string_in_bin_file(fitimage_path, a_comment) + self.assertEqual(found_comments, 2, "Expected 2 signed and commented section in the fitImage.") + + # Verify the signature + self._verify_fit_image_signature(uboot_tools_sysroot_native, fitimage_path, + os.path.join(deploy_dir_image, 'u-boot-spl.dtb')) - # Check for evidence of test-mkimage-wrapper class - result = runCmd('grep "### uboot-mkimage wrapper message" %s/log.do_uboot_assemble_fitimage' % tempdir, ignore_status=True) - self.assertEqual(result.status, 0, 'UBOOT_MKIMAGE did not work') - result = runCmd('grep "### uboot-mkimage signing wrapper message" %s/log.do_uboot_assemble_fitimage' % tempdir, ignore_status=True) - self.assertEqual(result.status, 0, 'UBOOT_MKIMAGE_SIGN did not work') def test_sign_cascaded_uboot_fit_image(self): """ @@ -574,6 +611,7 @@ UBOOT_FIT_HASH_ALG = "sha256" work by Paul Eggleton and Usama Arif """ + a_comment = "a smart cascaded U-Boot comment" config = """ # There's no U-boot deconfig with CONFIG_FIT_SIGNATURE yet, so we need at # least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set @@ -589,7 +627,7 @@ UBOOT_DTB_BINARY = "u-boot.dtb" UBOOT_ENTRYPOINT = "0x80000000" UBOOT_LOADADDRESS = "0x80000000" UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000" -UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart cascaded Kernel comment'" +UBOOT_MKIMAGE_SIGN_ARGS = "-c '%s'" UBOOT_DTB_LOADADDRESS = "0x82000000" UBOOT_ARCH = "arm" SPL_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000" @@ -599,20 +637,18 @@ UBOOT_FIT_GENERATE_KEYS = "1" UBOOT_FIT_HASH_ALG = "sha256" KERNEL_IMAGETYPES += " fitImage " KERNEL_CLASSES = " kernel-fitimage " -INHERIT += "test-mkimage-wrapper" UBOOT_SIGN_ENABLE = "1" FIT_GENERATE_KEYS = "1" UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" FIT_SIGN_INDIVIDUAL = "1" -""" +""" % a_comment self.write_config(config) # The U-Boot fitImage is created as part of the U-Boot recipe bitbake("virtual/bootloader") - image_type = "core-image-minimal" deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') machine = get_bb_var('MACHINE') fitimage_its_path = os.path.join(deploy_dir_image, @@ -696,17 +732,13 @@ FIT_SIGN_INDIVIDUAL = "1" self.assertEqual(len(value), 512, 'Signature value for section %s not expected length' % signed_section) # Check for SPL_MKIMAGE_SIGN_ARGS - result = runCmd('bitbake -e virtual/bootloader | grep ^T=') - tempdir = result.output.split('=', 1)[1].strip().strip('') - result = runCmd('grep "a smart cascaded U-Boot comment" %s/run.do_uboot_assemble_fitimage' % tempdir, ignore_status=True) - self.assertEqual(result.status, 0, 'SPL_MKIMAGE_SIGN_ARGS value did not get used') - - # Check for evidence of test-mkimage-wrapper class - result = runCmd('grep "### uboot-mkimage wrapper message" %s/log.do_uboot_assemble_fitimage' % tempdir, ignore_status=True) - self.assertEqual(result.status, 0, 'UBOOT_MKIMAGE did not work') - result = runCmd('grep "### uboot-mkimage signing wrapper message" %s/log.do_uboot_assemble_fitimage' % tempdir, ignore_status=True) - self.assertEqual(result.status, 0, 'UBOOT_MKIMAGE_SIGN did not work') + # Looks like mkimage supports to add a comment but does not support to read it back. + found_comments = FitImageTests._find_string_in_bin_file(fitimage_path, a_comment) + self.assertEqual(found_comments, 2, "Expected 2 signed and commented section in the fitImage.") + # Verify the signature + self._verify_fit_image_signature(uboot_tools_sysroot_native, fitimage_path, + os.path.join(deploy_dir_image, 'u-boot-spl.dtb')) def test_initramfs_bundle(self): @@ -843,3 +875,7 @@ FIT_HASH_ALG = "sha256" test_passed = True self.assertTrue(test_passed == True,"Initramfs bundle test success") + + # Verify the signature + uboot_tools_sysroot_native = self._setup_uboot_tools_native() + self._verify_fit_image_signature(uboot_tools_sysroot_native, fitimage_path, os.path.join(deploy_dir_image, 'am335x-bone.dtb')) From patchwork Thu Jul 4 07:09:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45983 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 D5969C3DA45 for ; Thu, 4 Jul 2024 07:10:33 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.groups.io with SMTP id smtpd.web10.5044.1720077024292021717 for ; Thu, 04 Jul 2024 00:10:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nnvpKQw0; spf=pass (domain: gmail.com, ip: 209.85.128.45, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4257a390a4eso1936255e9.0 for ; Thu, 04 Jul 2024 00:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077022; x=1720681822; 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; bh=fzq3d6kETZy30b4iI2tfq3hMg9IUQRnT5d1OuvD11hw=; b=nnvpKQw024Vx8k5JnWJjb48iut3F7ezgdZrpQSdnk9hHDPJiCLtXN3N7ZzFkf10P9s 7g9xbjKO4v3fGjdcdfDZVGdCLq2bScr/sGFHDOOGP/PDswAH1+1ZIeECR6w/M6jZFIt+ RFNOMM4woIXq/cRFjGEHkOa8jJzLV42HKgPZEkvCJPeUtN/kgLCyzowK6HYCmxN4Hj0t FJX7lGZ0uMh8wzBx3hlvcpsDSQcTDwLS5tG02lkBkiJodr/INarUOk6vv3QQqR7Z3cm/ fEl6UVMa54zEQk7WG0QaWrlKv+1+Q/d3xhDt8DKh/5SFXdvYrqVRUB+C6tYq1uunoDM5 bj+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077022; x=1720681822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fzq3d6kETZy30b4iI2tfq3hMg9IUQRnT5d1OuvD11hw=; b=oiD/yZYiilGVoG3uVSnMFwVOd/p/iXE2t90wJyluguSeLwLi1YCSbQ1SuUHZ1E1/hv i7P6Mc2crpzxidFvOMFXKwlNIQePiuQ2WCnNebQlzYnPQz6H8aS/RaJRWk9tb0mdjLNP Grf/66YLEvFkmAOHCknPk6eJeVDN0e7lv/bYZaI5Pqbc59R94FTg5gm3XWDv8SX5MCJ/ qE4Sz+waFb/F6mpy4mPoaOWUv6bmE9bFcgKIHNWlr10pxiA19/a/iid9h4iPIRKzphF7 aXXda72mIPi4vLK/lcNX9DMITI3rhwS8pPM7qlCJzkChY3aVIvwzly2PVo5zQWrnh0xg MfXw== X-Gm-Message-State: AOJu0Yxgm7Kfj63JnTRGQXIVfJzI1V3PJ0KzWGTAYzoVQGhVxqUofjbH VF9jspFRO4/Xgz9C8eeAcZHYHv3PyjAGagPXpG3CxSmRJo736bS5tBvQ/Q== X-Google-Smtp-Source: AGHT+IHUw0RAyqG5OW+P2hJ+xTGdPs7eU0OuIvJsDQsknWIqPWwXpJ03K04xO/VyPd4Z9+QmR2lKYw== X-Received: by 2002:a05:600c:887:b0:425:7784:56e8 with SMTP id 5b1f17b1804b1-4264a4319f9mr4753305e9.28.1720077022292; Thu, 04 Jul 2024 00:10:22 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:21 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 04/14] oe-selftest: fitimage cleanup asserts Date: Thu, 4 Jul 2024 09:09:40 +0200 Message-ID: <20240704071013.2982700-5-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201509 From: Adrian Freihofer Use more specific assert statements to make the code more readable and the error messages more verbose. Cleanup the asserts of the test case test_initramfs_bundle. Signed-off-by: Adrian Freihofer --- meta/lib/oeqa/selftest/cases/fitimage.py | 76 +++++++----------------- 1 file changed, 21 insertions(+), 55 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 4891ac8010b..ee688c79099 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py @@ -98,10 +98,8 @@ FIT_DESC = "A model description" fitimage_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "fitImage-%s-%s" % (bb_vars['INITRAMFS_IMAGE_NAME'], bb_vars['KERNEL_FIT_LINK_NAME'])) - self.assertTrue(os.path.exists(fitimage_its_path), - "%s image tree source doesn't exist" % (fitimage_its_path)) - self.assertTrue(os.path.exists(fitimage_path), - "%s FIT image doesn't exist" % (fitimage_path)) + self.assertExists(fitimage_its_path, "%s image tree source doesn't exist" % (fitimage_its_path)) + self.assertExists(fitimage_path, "%s FIT image doesn't exist" % (fitimage_path)) # Check that the type, load address, entrypoint address and default # values for kernel and ramdisk in Image Tree Source are as expected. @@ -180,10 +178,8 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c '%s'" fitimage_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "fitImage-%s.bin" % (bb_vars['KERNEL_FIT_LINK_NAME'])) - self.assertTrue(os.path.exists(fitimage_its_path), - "%s image tree source doesn't exist" % (fitimage_its_path)) - self.assertTrue(os.path.exists(fitimage_path), - "%s FIT image doesn't exist" % (fitimage_path)) + self.assertExists(fitimage_its_path, "%s image tree source doesn't exist" % (fitimage_its_path)) + self.assertExists(fitimage_path, "%s FIT image doesn't exist" % (fitimage_path)) req_itspaths = [ ['/', 'images', 'kernel-1'], @@ -330,10 +326,8 @@ FIT_SIGN_INDIVIDUAL = "1" fitimage_path = os.path.join(deploy_dir_image, "u-boot-fitImage-%s" % (machine,)) - self.assertTrue(os.path.exists(fitimage_its_path), - "%s image tree source doesn't exist" % (fitimage_its_path)) - self.assertTrue(os.path.exists(fitimage_path), - "%s FIT image doesn't exist" % (fitimage_path)) + self.assertExists(fitimage_its_path, "%s image tree source doesn't exist" % (fitimage_its_path)) + self.assertExists(fitimage_path, "%s FIT image doesn't exist" % (fitimage_path)) # Check that the type, load address, entrypoint address and default # values for kernel and ramdisk in Image Tree Source are as expected. @@ -414,10 +408,8 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'" fitimage_path = os.path.join(deploy_dir_image, "u-boot-fitImage-%s" % (machine,)) - self.assertTrue(os.path.exists(fitimage_its_path), - "%s image tree source doesn't exist" % (fitimage_its_path)) - self.assertTrue(os.path.exists(fitimage_path), - "%s FIT image doesn't exist" % (fitimage_path)) + self.assertExists(fitimage_its_path, "%s image tree source doesn't exist" % (fitimage_its_path)) + self.assertExists(fitimage_path, "%s FIT image doesn't exist" % (fitimage_path)) # Check that the type, load address, entrypoint address and default # values for kernel and ramdisk in Image Tree Source are as expected. @@ -506,10 +498,8 @@ UBOOT_FIT_HASH_ALG = "sha256" fitimage_path = os.path.join(deploy_dir_image, "u-boot-fitImage-%s" % (machine,)) - self.assertTrue(os.path.exists(fitimage_its_path), - "%s image tree source doesn't exist" % (fitimage_its_path)) - self.assertTrue(os.path.exists(fitimage_path), - "%s FIT image doesn't exist" % (fitimage_path)) + self.assertExists(fitimage_its_path, "%s image tree source doesn't exist" % (fitimage_its_path)) + self.assertExists(fitimage_path, "%s FIT image doesn't exist" % (fitimage_path)) req_itspaths = [ ['/', 'images', 'uboot'], @@ -656,10 +646,8 @@ FIT_SIGN_INDIVIDUAL = "1" fitimage_path = os.path.join(deploy_dir_image, "u-boot-fitImage-%s" % (machine,)) - self.assertTrue(os.path.exists(fitimage_its_path), - "%s image tree source doesn't exist" % (fitimage_its_path)) - self.assertTrue(os.path.exists(fitimage_path), - "%s FIT image doesn't exist" % (fitimage_path)) + self.assertExists(fitimage_its_path, "%s image tree source doesn't exist" % (fitimage_its_path)) + self.assertExists(fitimage_path, "%s FIT image doesn't exist" % (fitimage_path)) req_itspaths = [ ['/', 'images', 'uboot'], @@ -793,10 +781,8 @@ FIT_HASH_ALG = "sha256" "fitImage-its-%s-%s-%s" % (image_type, machine, machine)) fitimage_path = os.path.join(deploy_dir_image,"fitImage") - self.assertTrue(os.path.exists(fitimage_its_path), - "%s image tree source doesn't exist" % (fitimage_its_path)) - self.assertTrue(os.path.exists(fitimage_path), - "%s FIT image doesn't exist" % (fitimage_path)) + self.assertExists(fitimage_its_path, "%s image tree source doesn't exist" % (fitimage_its_path)) + self.assertExists(fitimage_path, "%s FIT image doesn't exist" % (fitimage_path)) kernel_load = str(get_bb_var('UBOOT_LOADADDRESS')) kernel_entry = str(get_bb_var('UBOOT_ENTRYPOINT')) @@ -827,17 +813,12 @@ FIT_HASH_ALG = "sha256" node_str = exp_node_lines[0] - test_passed = False - print ("checking kernel node\n") + self.assertIn(node_str, its_lines) - if node_str in its_lines: - node_start_idx = its_lines.index(node_str) - node = its_lines[node_start_idx:(node_start_idx + len(exp_node_lines))] - if node == exp_node_lines: - print("kernel node verified") - else: - self.assertTrue(test_passed == True,"kernel node does not match expectation") + node_start_idx = its_lines.index(node_str) + node = its_lines[node_start_idx:(node_start_idx + len(exp_node_lines))] + self.assertEqual(node, exp_node_lines, "kernel node does not match expectation") rx_configs = re.compile("^conf-.*") its_configs = list(filter(rx_configs.match, its_lines)) @@ -854,27 +835,12 @@ FIT_HASH_ALG = "sha256" node = its_lines[cfg_start_idx:line_idx] print("checking configuration " + cfg_str.rstrip(" {")) rx_desc_line = re.compile("^description.*1 Linux kernel.*") - if len(list(filter(rx_desc_line.match, node))) != 1: - self.assertTrue(test_passed == True,"kernel keyword not found in the description line") - break - else: - print("kernel keyword found in the description line") + self.assertNotEqual(len(list(filter(rx_desc_line.match, node))), 1, "kernel keyword not found in the description line") - if 'kernel = "kernel-1";' not in node: - self.assertTrue(test_passed == True,"kernel line not found") - break - else: - print("kernel line found") + self.assertNotIn('kernel = "kernel-1";', node) rx_sign_line = re.compile("^sign-images.*kernel.*") - if len(list(filter(rx_sign_line.match, node))) != 1: - self.assertTrue(test_passed == True,"kernel hash not signed") - break - else: - print("kernel hash signed") - - test_passed = True - self.assertTrue(test_passed == True,"Initramfs bundle test success") + self.assertNotEqual(len(list(filter(rx_sign_line.match, node))), 1, "kernel hash not signed") # Verify the signature uboot_tools_sysroot_native = self._setup_uboot_tools_native() From patchwork Thu Jul 4 07:09:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45985 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 036CBC3DA44 for ; Thu, 4 Jul 2024 07:10:34 +0000 (UTC) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by mx.groups.io with SMTP id smtpd.web11.4918.1720077025445406406 for ; Thu, 04 Jul 2024 00:10:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YS75Q1Hk; spf=pass (domain: gmail.com, ip: 209.85.167.42, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-52e743307a2so273532e87.0 for ; Thu, 04 Jul 2024 00:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077023; x=1720681823; 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; bh=t+tdgO0iRy9+73cRvwyNQZU1tmbv+wtij6PZ2MsoZvc=; b=YS75Q1HkGitKcbVXEenfBUVqQAxYsuVh4ixskeT2vKd0UQvT/gievulwpSo4JKxTY8 K8ZtW3y7a98ivmvu4wN8Ep/2/02oOold3VcU2tCXfXQWyMEA0Rch3GeAhzlso5vd13mK HWHEu8gSKKNTkV3WjvAOTU4n5k1WT/SQHEpJ+xif/Jtp4hsQcinGfevmnHNY16Q0LSMw LfGWrTyJN6WcixyvZ47GXzhJlwimnjikU+xZovlZ28Avja87qXG9gpdLS9aDp11mbZ0m D2YWc2Vq6lkdRNqamYn1gH9Xqm/yBl4hZ29DzcJi3HdV2cnkVPQhurxqXA5nZMBfm3Ai vrzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077023; x=1720681823; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t+tdgO0iRy9+73cRvwyNQZU1tmbv+wtij6PZ2MsoZvc=; b=OvJ+VXqFsWu42m6YxRufVUhDW5IRa0xsNNXcqtptOrErQjYLn0vek+8llXtakeEQtN oIK/cgh1QnU+PRoC3RiOnuncM6tqXh3Co6FUTicQZ4CpmaLgU6fVfSEFUPDDXuDh0zQE YYrk0cvh7OTLDdeBy7/Yqj4QXc+Zu5mFni1UMbYHf4ICJJitpUGKWmK+rmlQYyxTjHSx /GheYguCP7RDmf7C92SzI3rNXT+uGgYAvqcEW5kr1it0cIfc51V8R1ljIT3MKFwnlwDK vHG7p0/VD5MEeU43oMILfIeU+TFHDLitVGS48C6RjHli0HL6W1znRN46Wa3/zpoXd5d0 fXBw== X-Gm-Message-State: AOJu0Yy+iR6FFRp5CuL1Fmz5OwjwnsoXfREu8+btwLUNRk1zxj3Jz4uE RJHyWqN3pH7Zutuxy0uevo1T8Y2Iz2erX+DFL9G4WovKPR57sKCRha8Tyw== X-Google-Smtp-Source: AGHT+IFPWtonO5YZibL9zfggYfnPBJqhFixqeXMbUeGpW4JUWsRilj0qIPscxomP3FO0C20ALUVekw== X-Received: by 2002:a19:7702:0:b0:52c:dba6:b4c8 with SMTP id 2adb3069b0e04-52ea0619e3cmr536867e87.13.1720077022965; Thu, 04 Jul 2024 00:10:22 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:22 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 05/14] oe-selftest: fitimage fix test_initramfs_bundle Date: Thu, 4 Jul 2024 09:09:41 +0200 Message-ID: <20240704071013.2982700-6-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:34 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201510 From: Adrian Freihofer It looks like most of the assertions of this tests were by-passed because of combinations of invalid regexes and inverted assert statement. Try to fix. Use the variables from the kernel recipe instead of potentially invalid values from get_bb_vars with undefined recipe. Use one get_bb_vars statement instead of many seaparate calls mainly to improve the duration of this test case. Make the test working for an its file with an absolute path to the kernel binary. This will be needed with one of the following commits and does not harm in general. Signed-off-by: Adrian Freihofer --- meta/lib/oeqa/selftest/cases/fitimage.py | 57 +++++++++++++----------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index ee688c79099..0b5f4602fbc 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py @@ -774,23 +774,25 @@ FIT_HASH_ALG = "sha256" # fitImage is created as part of linux recipe bitbake("virtual/kernel") - image_type = get_bb_var('INITRAMFS_IMAGE') - deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') - machine = get_bb_var('MACHINE') - fitimage_its_path = os.path.join(deploy_dir_image, - "fitImage-its-%s-%s-%s" % (image_type, machine, machine)) - fitimage_path = os.path.join(deploy_dir_image,"fitImage") + bb_vars = get_bb_vars([ + 'DEPLOY_DIR_IMAGE', + 'FIT_HASH_ALG', + 'FIT_KERNEL_COMP_ALG', + 'INITRAMFS_IMAGE', + 'MACHINE', + 'UBOOT_ARCH', + 'UBOOT_ENTRYPOINT', + 'UBOOT_LOADADDRESS', + 'UBOOT_MKIMAGE_KERNEL_TYPE' + ], + 'virtual/kernel') + fitimage_its_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], + "fitImage-its-%s-%s-%s" % (bb_vars['INITRAMFS_IMAGE'], bb_vars['MACHINE'], bb_vars['MACHINE'])) + fitimage_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'],"fitImage") self.assertExists(fitimage_its_path, "%s image tree source doesn't exist" % (fitimage_its_path)) self.assertExists(fitimage_path, "%s FIT image doesn't exist" % (fitimage_path)) - kernel_load = str(get_bb_var('UBOOT_LOADADDRESS')) - kernel_entry = str(get_bb_var('UBOOT_ENTRYPOINT')) - kernel_type = str(get_bb_var('UBOOT_MKIMAGE_KERNEL_TYPE')) - kernel_compression = str(get_bb_var('FIT_KERNEL_COMP_ALG')) - uboot_arch = str(get_bb_var('UBOOT_ARCH')) - fit_hash_alg = str(get_bb_var('FIT_HASH_ALG')) - its_file = open(fitimage_its_path) its_lines = [line.strip() for line in its_file.readlines()] @@ -799,14 +801,14 @@ FIT_HASH_ALG = "sha256" 'kernel-1 {', 'description = "Linux kernel";', 'data = /incbin/("linux.bin");', - 'type = "' + kernel_type + '";', - 'arch = "' + uboot_arch + '";', + 'type = "' + str(bb_vars['UBOOT_MKIMAGE_KERNEL_TYPE']) + '";', + 'arch = "' + str(bb_vars['UBOOT_ARCH']) + '";', 'os = "linux";', - 'compression = "' + kernel_compression + '";', - 'load = <' + kernel_load + '>;', - 'entry = <' + kernel_entry + '>;', + 'compression = "' + str(bb_vars['FIT_KERNEL_COMP_ALG']) + '";', + 'load = <' + str(bb_vars['UBOOT_LOADADDRESS']) + '>;', + 'entry = <' + str(bb_vars['UBOOT_ENTRYPOINT']) + '>;', 'hash-1 {', - 'algo = "' + fit_hash_alg +'";', + 'algo = "' + str(bb_vars['FIT_HASH_ALG']) +'";', '};', '};' ] @@ -818,6 +820,11 @@ FIT_HASH_ALG = "sha256" node_start_idx = its_lines.index(node_str) node = its_lines[node_start_idx:(node_start_idx + len(exp_node_lines))] + + # Remove the absolute path. This refers to WORKDIR which is not always predictable. + re_data = re.compile(r'^data = /incbin/\(.*/linux\.bin"\);$') + node = [re.sub(re_data, 'data = /incbin/("linux.bin");', cfg_str) for cfg_str in node] + self.assertEqual(node, exp_node_lines, "kernel node does not match expectation") rx_configs = re.compile("^conf-.*") @@ -834,14 +841,14 @@ FIT_HASH_ALG = "sha256" node = its_lines[cfg_start_idx:line_idx] print("checking configuration " + cfg_str.rstrip(" {")) - rx_desc_line = re.compile("^description.*1 Linux kernel.*") - self.assertNotEqual(len(list(filter(rx_desc_line.match, node))), 1, "kernel keyword not found in the description line") + rx_desc_line = re.compile(r'^description = ".*Linux kernel.*') + self.assertEqual(len(list(filter(rx_desc_line.match, node))), 1, "kernel keyword not found in the description line") - self.assertNotIn('kernel = "kernel-1";', node) + self.assertIn('kernel = "kernel-1";', node) - rx_sign_line = re.compile("^sign-images.*kernel.*") - self.assertNotEqual(len(list(filter(rx_sign_line.match, node))), 1, "kernel hash not signed") + rx_sign_line = re.compile(r'^sign-images = .*kernel.*') + self.assertEqual(len(list(filter(rx_sign_line.match, node))), 1, "kernel hash not signed") # Verify the signature uboot_tools_sysroot_native = self._setup_uboot_tools_native() - self._verify_fit_image_signature(uboot_tools_sysroot_native, fitimage_path, os.path.join(deploy_dir_image, 'am335x-bone.dtb')) + self._verify_fit_image_signature(uboot_tools_sysroot_native, fitimage_path, os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], 'am335x-bone.dtb')) From patchwork Thu Jul 4 07:09:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45981 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 D506FC3DA43 for ; Thu, 4 Jul 2024 07:10:33 +0000 (UTC) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by mx.groups.io with SMTP id smtpd.web10.5046.1720077026470403183 for ; Thu, 04 Jul 2024 00:10:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OTmoIg6i; spf=pass (domain: gmail.com, ip: 209.85.208.179, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2eabd22d3f4so3173391fa.1 for ; Thu, 04 Jul 2024 00:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077024; x=1720681824; 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; bh=dSO8mkDYASLZdBRhIJNhYyKjc8QBDr1qJaT2Qz9tmiw=; b=OTmoIg6ixEHLOXVernR7QDIZvtXwQe1ip60fgWwI75E9wGlXU9akCzM/IDtSz7X5B/ SdsHS/gb4E3bl271I9n7ysgCUfnXuRqj6NKf97/9tsPaRFjmGlSpO2Tno/pBELXIyfQX fFNE/+LbgnQq2WE/CScF3yjRfPh6V6KXv9Zt9/55jJbvf/GZm+O4TZkHFqb0akt0aLw+ ApLRHYqhn5YhdJ5SSDUosfxpGPYmLzZqDfMhoP6h269Ng1IJRnWQiFu7VCbfQpM8agEY 87yLxz+j8HaMW8lTFzPzssgrZoVhSnIN242FxixRsqHcZe/ubDwBoNFFv5GoLQAJ/OZp V5Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077024; x=1720681824; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dSO8mkDYASLZdBRhIJNhYyKjc8QBDr1qJaT2Qz9tmiw=; b=WHSeSigRRjwmC6das9eFU7nqYe5eDSV3h6t+7IvFRboWaf4dU9mxMdwiWB+QPIqDjB rYrWLwCmpBPdrPlRklontlrMTZ1FrPXiT3heRs9ED/V9QCkBDYJIo0QyuWLAb8JfPzEW uthfbD//qtARYtzoobMPOtDnCt6UB4SoZ9XxrsCz1CKcfijX/MRqUuonUpKQYYn1VvUb tBaO3+qNWb6hkbJtelbfarXJfsqY0RO8ALweQvuEG6EayJEGY7XzoakhVtDLjzVuiHaf LRAPYNeash81CKbDG9aCI9R4/o/jvemksLJNuWWDVpfRudpaD0o5eMUhh/eIL22MnwjM JUJA== X-Gm-Message-State: AOJu0Yy0CjoYt7XL7s04U3XKF2eQYqOPw+okVUtuzBdAzratn7HvSDmN 9Bd/AahzgwunFFoqHqWAewtx1TZtmeOryTpmAJAfXYydxjWgVOiywmlTWA== X-Google-Smtp-Source: AGHT+IHNd/nPL8yhzkbO0ZHYQoPfSOVl2Wnak99ObIE1DrGqYwAAa7QMl3rrHlS7RRvnlFkxA5ruNg== X-Received: by 2002:a2e:9eca:0:b0:2ee:4e67:85e0 with SMTP id 38308e7fff4ca-2ee8ed223a7mr4775991fa.3.1720077023602; Thu, 04 Jul 2024 00:10:23 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:23 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 06/14] kernel-fitimage: fix handling of empty default dtb Date: Thu, 4 Jul 2024 09:09:42 +0200 Message-ID: <20240704071013.2982700-7-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201512 From: Adrian Freihofer Fix error in run.do_assemble_fitimage_initramfs.2779256: line 238: [: =: unary operator expected if FIT_CONF_DEFAULT_DTB is empty. Signed-off-by: Adrian Freihofer --- meta/classes-recipe/kernel-fitimage.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 4b74ddc2015..6e6898e5f6f 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -611,7 +611,7 @@ fitimage_assemble() { fi # Set the default dtb image if it exists in the devicetree. - if [ ${FIT_CONF_DEFAULT_DTB} = $DTB ];then + if [ "${FIT_CONF_DEFAULT_DTB}" = "$DTB" ];then default_dtb_image=$(echo "$DTB" | tr '/' '_') fi From patchwork Thu Jul 4 07:09:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45984 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 03873C3DA46 for ; Thu, 4 Jul 2024 07:10:34 +0000 (UTC) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by mx.groups.io with SMTP id smtpd.web10.5045.1720077026396513298 for ; Thu, 04 Jul 2024 00:10:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VAxMMhDK; spf=pass (domain: gmail.com, ip: 209.85.208.174, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2ec5fad1984so3792541fa.0 for ; Thu, 04 Jul 2024 00:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077024; x=1720681824; 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; bh=4sQJc9AzBQtCzKDmUCFIZvmbULEi7BoSm1l4E60dgTU=; b=VAxMMhDKJrf45TroOLAfC/t7GoDCc6ikdsTO2pNMI+8gVRbKj+/YL9zkr814IQUpY5 2FM7IKcwuXNwBPjGsmw7GlpKRXap2jHu/dWg+rJKDE1mAmDzVVsFxJk3hOCZqot6Z7z6 2WvbAVDuOOdZVpcD41NZueXY5A54dqY8PSqaE1NAqPmWIVgDVm+AoJRya3rGVe+LGjiT 3TJFhp7MboUzefqeddUOwR5GxfMROfrFNAtHPUmETWVrVg3B0sYqxiMGbW2ggbSOxR1H 9SWD7jQSV+VmpuOYKkgxk/I13u4GaKs+T7oPiw/hBMw6LbYxzNZmudJU9/EVQsD+HUeh LEpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077024; x=1720681824; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4sQJc9AzBQtCzKDmUCFIZvmbULEi7BoSm1l4E60dgTU=; b=drqNpKOX9jR3c09G2jeP5f0Oi8Tpw+/KWPEWMUw50XSg+UdZffdk56UN+chbyQIb8v A0z2e3g6fYmg/8Jnke38A8Em+76BVmXhmIn2J2mmZuyP0vdD+YAB2JF1GCGZGwriTWbS dY455yR7KN8OTg0nuaqfa5xaei6tx4a7JVBpZ2mptWsGm5bFJm1FSFYcEixvxwhR+3ME YeZ/bvdCuschMBsqkJ6eSVEB0tDUdssn56q+Bjd/rGwlfJB5QAXzgAAGcCSZiyDYl++5 i8RajnIEw4wCJnN18nwzjjQSTUVUJE765GqdQcsu9Xdi9LIn+GyF2bJeDr7M+OOUWycT PuMw== X-Gm-Message-State: AOJu0YwZNVphHIvZ/HR0amJ8VE48+LhD3juiImhx34Tu38s9Fa+RqseT Uy+NDLgeMtVeNf09M3zNl2oCpiJMHB76i3ZcLAh+Vz/6QBnTJA4PTftFuw== X-Google-Smtp-Source: AGHT+IF9j0YcgXdRNCEv6BLQBB6buIb1Bftq5Y6lslwURwE+fZHD639tn95C55LJFSi6nR0gGuGDNQ== X-Received: by 2002:a05:6512:3b4:b0:52c:1d8a:9716 with SMTP id 2adb3069b0e04-52ea062a28amr441109e87.19.1720077024251; Thu, 04 Jul 2024 00:10:24 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:23 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 07/14] kernel-fitimage: fix external dtb check Date: Thu, 4 Jul 2024 09:09:43 +0200 Message-ID: <20240704071013.2982700-8-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:34 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201511 From: Adrian Freihofer If EXTERNAL_KERNEL_DEVICETREE and dtb_image_sect are empty variables dtb_path ends up as "/" which is available on most Unix systems but probably not the dtb_path which is needed here. Checking for a file makes more sense and also solves the issue with the "/". Signed-off-by: Adrian Freihofer --- meta/classes-recipe/kernel-fitimage.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 6e6898e5f6f..664ebc65d7c 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -429,7 +429,7 @@ fitimage_emit_section_config() { fi dtb_path="${EXTERNAL_KERNEL_DEVICETREE}/${dtb_image_sect}" - if [ -e "$dtb_path" ]; then + if [ -f "$dtb_path" ]; then compat=$(fdtget -t s "$dtb_path" / compatible | sed 's/ /", "/g') if [ -n "$compat" ]; then compatible_line="compatible = \"$compat\";" From patchwork Thu Jul 4 07:09:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45982 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 C84EDC3DA42 for ; Thu, 4 Jul 2024 07:10:33 +0000 (UTC) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mx.groups.io with SMTP id smtpd.web10.5047.1720077027602760071 for ; Thu, 04 Jul 2024 00:10:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Og7eGiIK; spf=pass (domain: gmail.com, ip: 209.85.167.41, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-52e7693c369so329295e87.3 for ; Thu, 04 Jul 2024 00:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077025; x=1720681825; 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; bh=OmzgSwhGEztT1SPlHvnNP+GCBIS9CyBgwvJgZdraN0M=; b=Og7eGiIKFIYbO88QkPUmaR0XwH1Bc4vOHVnYQOgqGU6i51JWfsvKOIjnlDsfRCXxjL KUUSCFlU0KugGEGZXmo9IdNl6m136GFxOxf8DxPyyJzOcmoNEiwrQCGIJGL0KXyBqMXd e0RY7TiAXeoC3gwqz2qYLp+U4gETtY6wb6+ugLoSNYnxwuJSkETex4hHwM3P1lN9Mwei 3BypSiJUPI8ERJ5OK35G/NSgaNHlhmHjyW02Gw9PGEE8RC8gEezE8Q2HgEIgCr55otL7 cb1RVVR3czjgFurHjyurWlFRJfT98jDYGdqD9NqBQ82Tf/8iXM+rY1p8XxTSvu6LGK85 hAZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077025; x=1720681825; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OmzgSwhGEztT1SPlHvnNP+GCBIS9CyBgwvJgZdraN0M=; b=MYEDJ7Fo9lFqy+IPeNkxsZbOh+Ey0JW/anmIzVI9SIR7UJ4k6sXc/H99By3dQ+2rD/ t7SQIq/k/ec7FF2ipwK+YepU84y6CmPXofgfXsvcDhYfa+dkOO3Db7L5cPCO91ly2Tju HfBzZomb0yWmq8IQRK/QBQIKQvz8CvM0Yp/ihS9x09O+Bs1AUV24nvUs/kRUdoHPqnjK F+7gbk7j2HxFNQPxn28rexZsAuSOtpwoAxVIF3OxN6wP5A5sJ8/OMU5I4J0tz7NenWNp V8USxeiDMYKvpyDsCEAJf/Y++nXQIENQJ7eDqVddU498HAbQ8JH+w4jOe9ZJVHB9T+Mh rdlQ== X-Gm-Message-State: AOJu0YySelqXGs+mDdupp2nbhw0+0K0zyFSgSRAnlLalALjM1KIc2I3c fyjYvdyO9DMFtHVol+Br9YyqvyhO5/f7dflkFpm41Eq/a/kvTiE4TzO7fg== X-Google-Smtp-Source: AGHT+IGU2ibA0/U8lv5LwqO85O3pjm7SRkmjkhezpsafMfz1EqscBjHPWZ4PgTGv9cm5j7ISIYfxIA== X-Received: by 2002:a05:6512:6e:b0:52e:74d5:89ae with SMTP id 2adb3069b0e04-52ea0644675mr467932e87.39.1720077024900; Thu, 04 Jul 2024 00:10:24 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:24 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 08/14] kernel: execute do_bundle_initramfs only when needed Date: Thu, 4 Jul 2024 09:09:44 +0200 Message-ID: <20240704071013.2982700-9-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201514 From: Adrian Freihofer With INITRAMFS_IMAGE_BUNDLE = "1" the kernel Makefile is used to bundle the kernel binary and the initramfs. This works only when the build folder of the kernel is available. Building with sstate but with an empty TMPDIR requires to rebuild the kernel from scratch whenever something in the initramfs changes. With INITRAMFS_IMAGE_BUNDLE = "" the fitImage generation is basically independent from the kernel Makefile and could therefore work with kernel binaries and tools provided by the sstate. But the dependency on the do_bundle_initramfs tasks does not allow this. However, if the INTIRAMFS_IMAGE is set but the INITRAMFS_IMAGE_BUNDLE is set to 0 the do_bundle_initramfs does nothing. There is no real argument for running this tasks. As a first step towards getting the kernel from sstate when building an unbundled fitImage, the task dependencies need to be simplified. The do_bundle_initramfs task is now scheduled only when needed. Signed-off-by: Adrian Freihofer --- meta/classes-recipe/kernel-fitimage.bbclass | 7 +++++-- meta/classes-recipe/kernel.bbclass | 14 ++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 664ebc65d7c..fbeb20596ea 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -36,6 +36,11 @@ python __anonymous () { if 'fitImage' in typeformake.split(): d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', d.getVar('KERNEL_IMAGETYPE_REPLACEMENT'))) + if bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')): + bb.build.addtask('assemble_fitimage_initramfs', 'do_deploy', 'do_bundle_initramfs', d) + else: + bb.build.addtask('assemble_fitimage_initramfs', 'do_deploy', 'do_install', d) + image = d.getVar('INITRAMFS_IMAGE') if image: d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') @@ -794,8 +799,6 @@ do_assemble_fitimage_initramfs() { fi } -addtask assemble_fitimage_initramfs before do_deploy after do_bundle_initramfs - do_kernel_generate_rsa_keys() { if [ "${UBOOT_SIGN_ENABLE}" = "0" ] && [ "${FIT_GENERATE_KEYS}" = "1" ]; then bbwarn "FIT_GENERATE_KEYS is set to 1 even though UBOOT_SIGN_ENABLE is set to 0. The keys will not be generated as they won't be used." diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index 89badd90f18..6d242114852 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -139,15 +139,17 @@ set -e image = d.getVar('INITRAMFS_IMAGE') # If the INTIRAMFS_IMAGE is set but the INITRAMFS_IMAGE_BUNDLE is set to 0, - # the do_bundle_initramfs does nothing, but the INITRAMFS_IMAGE is built - # standalone for use by wic and other tools. - if image: + # the do_bundle_initramfs does nothing. Add the dependency only when needed. + if image and bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')): + bb.build.addtask('bundle_initramfs', 'do_deploy', 'do_install', d) if d.getVar('INITRAMFS_MULTICONFIG'): d.appendVarFlag('do_bundle_initramfs', 'mcdepends', ' mc::${INITRAMFS_MULTICONFIG}:${INITRAMFS_IMAGE}:do_image_complete') else: d.appendVarFlag('do_bundle_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') - if image and bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')): bb.build.addtask('do_transform_bundled_initramfs', 'do_deploy', 'do_bundle_initramfs', d) + else: + d.appendVarFlag('do_deploy', 'depends', ' ${PN}:do_install') + # NOTE: setting INITRAMFS_TASK is for backward compatibility # The preferred method is to set INITRAMFS_IMAGE, because @@ -327,6 +329,8 @@ do_bundle_initramfs () { mv -f ${KERNEL_OUTPUT_DIR}/$imageType.bak ${KERNEL_OUTPUT_DIR}/$imageType fi done + else + bbwarn "Calling do_bundle_initramfs with INITRAMFS_IMAGE_BUNDLE=1 is deprecated" fi } do_bundle_initramfs[dirs] = "${B}" @@ -347,8 +351,6 @@ python do_devshell:prepend () { os.environ["LDFLAGS"] = '' } -addtask bundle_initramfs after do_install before do_deploy - KERNEL_DEBUG_TIMESTAMPS ??= "0" kernel_do_compile() { From patchwork Thu Jul 4 07:09:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45986 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 0F232C3DA47 for ; Thu, 4 Jul 2024 07:10:34 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web11.4919.1720077027588936562 for ; Thu, 04 Jul 2024 00:10:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YN13AdZ0; spf=pass (domain: gmail.com, ip: 209.85.128.54, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-42562a984d3so1912265e9.3 for ; Thu, 04 Jul 2024 00:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077026; x=1720681826; 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; bh=pJ3iec5ihluS2a3rxR22927fjwYbjNfmkxb9Xw8+NNY=; b=YN13AdZ0f6kkTgg5rjUWJKE6jm48OSBvm4fA4/X4CVEbV0XRayuotPncS+yKL16prb c34xolWAYoCC5JYuDtYb4Ju/Glye/j7v1g8HETOMltfg+N2D77vMVchlXh+0LmO7ts9e s+KNrTN4sZrXj3SdeFcwMxSvGdvk7EMQGzD8eGipSHrm98G24GYKTFfIKL/5/GrB2+s1 aEY+5C65X4l666McZ99L4t6eDv7uxAcJRxEbQcRYhES77Q3d/bCRqgHosKrNuVOeRyqm E2AAreFHSFbO2h6AeMswIOdEr2emGXnGRrGUolGMyyZ2/vu5/9yUHrevjP7/OXGxYh8k Q22w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077026; x=1720681826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pJ3iec5ihluS2a3rxR22927fjwYbjNfmkxb9Xw8+NNY=; b=Y2WqgcV3OaP73QMMY+li08DHCV+QJaCvoZaFpmJHEY8llMUtaZYyAuEg9rs+v5nF5b 1RFaWTmN8CQV2tJCQfXJHH/fi9tTNR2jRO9P8x6KbLf88bIS+1cQ24gellm0C8GUmm6p UOGZm3kHbLNUAZkMuLkE03V5s4u07AgiXr1n8fwvMqyC8fmzdMsvogesB2RlbRS7iSnq makzm2vSbvFVXxwuUwtnfRzqF1E0kabl5hBzXgJeAcCfZ8CiUoeYHgdNE7UCLKHADURb PSDyijcGr7HLMqHRp/P5f6uKVfOz5JHay8TGy8s4IgItXw9nnbIG+66cX4g4vZMBi+pV Lqww== X-Gm-Message-State: AOJu0Yy+SNeIugrdQ814NB9XBrbrvdeJOdM7Vbj/DPwiu8Ildw3pUr9H uEfiWFgiHFITcLIS4Z4FQujiFtzQVlCtS4huALJff4BvsRNXrPQv9jmXlA== X-Google-Smtp-Source: AGHT+IGs5FDflZCFlaWXgg0Ow5ijsVBdMztecNBWAoSVkjssnv9F9ugvhxgqJztZG/3LIdxAJACfmw== X-Received: by 2002:a05:600c:1584:b0:425:68b7:e47c with SMTP id 5b1f17b1804b1-4264a3cc8damr5165275e9.5.1720077025611; Thu, 04 Jul 2024 00:10:25 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:25 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 09/14] kernel-fitimage: refactor do_assemble_fitimage_initramfs Date: Thu, 4 Jul 2024 09:09:45 +0200 Message-ID: <20240704071013.2982700-10-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:34 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201513 From: Adrian Freihofer Make the fitimage_assemble function usable with absolute paths for the generated its and the fitImage file. Later on this will allow to take the linux.bin and the DTB files from the sstated deploy derectory and write the generated files to a separate folder with independent sstate-cache handling. Add 3 comments which are helpful for the next commit. Signed-off-by: Adrian Freihofer --- meta/classes-recipe/kernel-fitimage.bbclass | 49 ++++++++++++++------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index fbeb20596ea..e084dc57573 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -174,8 +174,9 @@ fitimage_emit_section_kernel() { ENTRYPOINT="${UBOOT_ENTRYPOINT}" if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then + kernel_base=$(basename $3) ENTRYPOINT=`${HOST_PREFIX}nm vmlinux | \ - awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'` + awk '$kernel_base=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'` fi cat << EOF >> $1 @@ -572,7 +573,7 @@ fitimage_assemble() { setupcount="" bootscr_id="" default_dtb_image="" - rm -f $1 arch/${ARCH}/boot/$2 + rm -f "$1" "arch/${ARCH}/boot/$(basename $2)" if [ -n "${UBOOT_SIGN_IMG_KEYNAME}" -a "${UBOOT_SIGN_KEYNAME}" = "${UBOOT_SIGN_IMG_KEYNAME}" ]; then bbfatal "Keys used to sign images and configuration nodes must be different." @@ -586,7 +587,7 @@ fitimage_assemble() { fitimage_emit_section_maint $1 imagestart uboot_prep_kimage - fitimage_emit_section_kernel $1 $kernelcount linux.bin "$linux_comp" + fitimage_emit_section_kernel $1 $kernelcount "$(readlink -f linux.bin)" "$linux_comp" # # Step 2: Prepare a DTB image section @@ -610,9 +611,20 @@ fitimage_assemble() { DTB_PATH="${KERNEL_OUTPUT_DIR}/$DTB" fi - # Strip off the path component from the filename + # Strip off the path component from the filename if "${@'false' if oe.types.boolean(d.getVar('KERNEL_DTBVENDORED')) else 'true'}"; then - DTB=`basename $DTB` + DTB=`basename $DTB` + fi + + # Find DTBs without sub-folders when running in deploy folder + if [ ! -e "$DTB_PATH" ]; then + DTB=$(basename $DTB) + DTB_PATH=$(readlink -f $DTB) + fi + + # Fail as early as possible if there is still no DTB file found + if [ ! -e "$DTB_PATH" ]; then + bberror "Cannot find the DTB file at $DTB_PATH" fi # Set the default dtb image if it exists in the devicetree. @@ -665,9 +677,8 @@ fitimage_assemble() { if [ -n "${UBOOT_ENV}" ] && [ -d "${STAGING_DIR_HOST}/boot" ]; then if [ -e "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY}" ]; then - cp ${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} ${B} bootscr_id="${UBOOT_ENV_BINARY}" - fitimage_emit_section_boot_script $1 "$bootscr_id" ${UBOOT_ENV_BINARY} + fitimage_emit_section_boot_script $1 "$bootscr_id" "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY}" else bbwarn "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} not found." fi @@ -676,9 +687,14 @@ fitimage_assemble() { # # Step 4: Prepare a setup section. (For x86) # + # Run from kernel build folder (bundled mode) if [ -e ${KERNEL_OUTPUT_DIR}/setup.bin ]; then setupcount=1 fitimage_emit_section_setup $1 $setupcount ${KERNEL_OUTPUT_DIR}/setup.bin + # Run from deploy folder (unbundled mode) + elif [ -e setup.bin ]; then + setupcount=1 + fitimage_emit_section_setup $1 $setupcount "$(readlink -f setup.bin)" fi # @@ -751,8 +767,8 @@ fitimage_assemble() { # ${UBOOT_MKIMAGE} \ ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ - -f $1 \ - ${KERNEL_OUTPUT_DIR}/$2 + -f "$1" \ + "$2" # # Step 8: Sign the image @@ -761,7 +777,7 @@ fitimage_assemble() { ${UBOOT_MKIMAGE_SIGN} \ ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ -F -k "${UBOOT_SIGN_KEYDIR}" \ - -r ${KERNEL_OUTPUT_DIR}/$2 \ + -r "$2" \ ${UBOOT_MKIMAGE_SIGN_ARGS} fi } @@ -769,9 +785,9 @@ fitimage_assemble() { do_assemble_fitimage() { if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then cd ${B} - fitimage_assemble fit-image.its fitImage-none "" + fitimage_assemble fit-image.its "${KERNEL_OUTPUT_DIR}/fitImage-none" "" if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then - ln -sf fitImage-none ${B}/${KERNEL_OUTPUT_DIR}/fitImage + ln -sf fitImage-none "${B}/${KERNEL_OUTPUT_DIR}/fitImage" fi fi } @@ -791,10 +807,10 @@ do_assemble_fitimage_initramfs() { test -n "${INITRAMFS_IMAGE}" ; then cd ${B} if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then - fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-bundle "" - ln -sf fitImage-bundle ${B}/${KERNEL_OUTPUT_DIR}/fitImage + fitimage_assemble "fit-image-${INITRAMFS_IMAGE}.its" "${KERNEL_OUTPUT_DIR}/fitImage-bundle" "" + ln -sf fitImage-bundle "${B}/${KERNEL_OUTPUT_DIR}/fitImage" else - fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1 + fitimage_assemble "fit-image-${INITRAMFS_IMAGE}.its" "${KERNEL_OUTPUT_DIR}/fitImage-${INITRAMFS_IMAGE}" 1 fi fi } @@ -852,6 +868,7 @@ kernel_do_deploy:append() { if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then + # deploy the artifacts of do_assemble_fitimage bbnote "Copying fit-image.its source file..." install -m 0644 ${B}/fit-image.its "$deployDir/fitImage-its-${KERNEL_FIT_NAME}.its" if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then @@ -866,12 +883,14 @@ kernel_do_deploy:append() { fi if [ -n "${INITRAMFS_IMAGE}" ]; then + # deploy the artifacts of do_assemble_fitimage_initramfs for bundled as well as un-bundled mode bbnote "Copying fit-image-${INITRAMFS_IMAGE}.its source file..." install -m 0644 ${B}/fit-image-${INITRAMFS_IMAGE}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its" if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then ln -snf fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" fi + # deploy the artifacts of do_assemble_fitimage_initramfs for bundled mode only if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then bbnote "Copying fitImage-${INITRAMFS_IMAGE} file..." install -m 0644 ${B}/${KERNEL_OUTPUT_DIR}/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT}" From patchwork Thu Jul 4 07:09:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45977 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 9C3E4C3814E for ; Thu, 4 Jul 2024 07:10:33 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.groups.io with SMTP id smtpd.web11.4920.1720077028237534754 for ; Thu, 04 Jul 2024 00:10:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hNYkvrXp; spf=pass (domain: gmail.com, ip: 209.85.128.45, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-425624255f3so1776325e9.0 for ; Thu, 04 Jul 2024 00:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077026; x=1720681826; 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; bh=ZPt6isDFJtT0jGUsvsuVgCAQmzlr5ID+Zeeft0LO+XM=; b=hNYkvrXpZYW3om/sbHH2IUz+majxGZCtYTeMx8+bMQglkEou+kIS/420Q4GQ39WFv7 hhTD+eUkKwPqj9YQFDcJeGtCiHR0lcXEAvnbBmpMh9j+BTFi9H1HHjwAMl9AAL1rtf6R ow9aCfiF4R9I5TXYhzku83W4cEiby8hQf7bncm//PSpDu0ia5raow5hRn1Zx4m6bbqK6 cHdVpZMOj5URIUc1M1/Xgb8qUWPVLsSQ02TSujuulGCVNrEKydN2LVH/91ThcDQZMHS5 NBUZCBikZyGDwmqOil6Bw4yqI7jGJttpY1rmhG88y/eG//jWet530kWOVVGQt4E4yQ2H TcQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077026; x=1720681826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZPt6isDFJtT0jGUsvsuVgCAQmzlr5ID+Zeeft0LO+XM=; b=iZNl0nEibJuQcM0Utfym3OrHglmMV5sPWHqE5eQ/F1XoGDTRtNxUjA31s/So6to8v4 aBWx+RdS35nCpP6lWs2zxv94ZmUywlGtd2CNj5OtgFmtcpL+GFpB/lJtwRg6tvkvCdvb mMw1QJ0ylQPYzcJSya3mpOOQ6bj8/bM7fbUs1EuOeFIBwBZdHdbk38+InvxEcj1V22uE a6iMjwaQnKoFxu82poBYlKj5y/W2YzAJJkxLpIC8yEoqG9nDQiLaaVGOYvt6iF3UpGVK LfIYnAO3SbahkbXR8FlXgicJNNZOMB8GsjxJA9rIn6jXHKzd93smEP9FCyZNvT8mL4Qc DxwQ== X-Gm-Message-State: AOJu0YyQgx4nTUIwjLw8563K0LThsxkEqaSTeqIZX+abWVGtnBYHkL+9 lIUoLz0FBSzkc+pdhDuS8ULqYos0uiJDNuA07ueP8SY3FlFB/3eGvtglhA== X-Google-Smtp-Source: AGHT+IGOuczcLiGVxSFRMau/+fiNbHiqhcsiOal+z5lzEF+I8VgYoFIrF7oaXHFNRELvViRdxWEsug== X-Received: by 2002:a05:600c:4f42:b0:424:8be4:f2c with SMTP id 5b1f17b1804b1-4264b0cc4b0mr5438355e9.2.1720077026255; Thu, 04 Jul 2024 00:10:26 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:25 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 10/14] kernel-fitimage: refactor creation of linux.bin Date: Thu, 4 Jul 2024 09:09:46 +0200 Message-ID: <20240704071013.2982700-11-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201515 From: Adrian Freihofer Assembling the fitImage with initramfs requires the linux.bin and the corresponding DTB files. To avoid that the kernel gets re-built from scratch whenever the initramfs changes, these files must be sstate cached after the kernel is built, before the fitImage gets assembled. Therefore the uboot_prep_kimage needs to be split: - a function creating the linux.bin artifact - a function which can find the linux.bin file from an independent task later on. This will allow to run the do_assemble_fitimage_initramfs task from the deploy folder where the linux.bin and the DTBs are provided via sstate-cache. Signed-off-by: Adrian Freihofer --- meta/classes-recipe/kernel-fitimage.bbclass | 8 ++++---- meta/classes-recipe/kernel-uboot.bbclass | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index e084dc57573..64836f6bef0 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -165,12 +165,12 @@ EOF # $1 ... .its filename # $2 ... Image counter # $3 ... Path to kernel image -# $4 ... Compression type fitimage_emit_section_kernel() { kernel_csum="${FIT_HASH_ALG}" kernel_sign_algo="${FIT_SIGN_ALG}" kernel_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}" + get_linux_comp ENTRYPOINT="${UBOOT_ENTRYPOINT}" if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then @@ -186,7 +186,7 @@ fitimage_emit_section_kernel() { type = "${UBOOT_MKIMAGE_KERNEL_TYPE}"; arch = "${UBOOT_ARCH}"; os = "linux"; - compression = "$4"; + compression = "$linux_comp"; load = <${UBOOT_LOADADDRESS}>; entry = <$ENTRYPOINT>; hash-1 { @@ -585,8 +585,6 @@ fitimage_assemble() { # Step 1: Prepare a kernel image section. # fitimage_emit_section_maint $1 imagestart - - uboot_prep_kimage fitimage_emit_section_kernel $1 $kernelcount "$(readlink -f linux.bin)" "$linux_comp" # @@ -785,6 +783,7 @@ fitimage_assemble() { do_assemble_fitimage() { if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then cd ${B} + uboot_prep_kimage fitimage_assemble fit-image.its "${KERNEL_OUTPUT_DIR}/fitImage-none" "" if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then ln -sf fitImage-none "${B}/${KERNEL_OUTPUT_DIR}/fitImage" @@ -806,6 +805,7 @@ do_assemble_fitimage_initramfs() { if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \ test -n "${INITRAMFS_IMAGE}" ; then cd ${B} + uboot_prep_kimage if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then fitimage_assemble "fit-image-${INITRAMFS_IMAGE}.its" "${KERNEL_OUTPUT_DIR}/fitImage-bundle" "" ln -sf fitImage-bundle "${B}/${KERNEL_OUTPUT_DIR}/fitImage" diff --git a/meta/classes-recipe/kernel-uboot.bbclass b/meta/classes-recipe/kernel-uboot.bbclass index 30a85ccc287..e692ca27cdd 100644 --- a/meta/classes-recipe/kernel-uboot.bbclass +++ b/meta/classes-recipe/kernel-uboot.bbclass @@ -47,3 +47,20 @@ uboot_prep_kimage() { echo "${linux_comp}" } + +# Get the linux_comp variable back from the linux.bin file +# which was created by uboot_prep_kimage +get_linux_comp() { + if [ ! -e linux.bin ]; then + bbfatal "linux.bin does not exist $(pwd)" + fi + + linux_comp=none + if gzip -l linux.bin> /dev/null 2>&1; then + linux_comp=gzip + elif lzop -l linux.bin> /dev/null 2>&1; then + linux_comp=lzo + fi + + echo "${linux_comp}" +} From patchwork Thu Jul 4 07:09:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45978 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 B8F0AC3DA40 for ; Thu, 4 Jul 2024 07:10:33 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.web10.5048.1720077028765429440 for ; Thu, 04 Jul 2024 00:10:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mlDF5DOX; spf=pass (domain: gmail.com, ip: 209.85.128.43, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42565cdf99cso2348065e9.3 for ; Thu, 04 Jul 2024 00:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077027; x=1720681827; 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; bh=YGgHOGkUBuv6eYgeSjuiCtb6ggI4omC5RLKnXlPWg5c=; b=mlDF5DOXWBJFdbYMV8w7lc2+gGKZ0mx4HeiPtJq3h73SJmMKmFwGm6G2qWImhC3R1o wQ/vjb6XyR+DHMsP+tXtJhwYrXON8dVPHy/KAgOpTMDN4FGskNU6yVx3ZUx0yEG54uqM /Xdv8WCr7WdsdJtt0G6HzXStXl1GdrIV1bDYI/yOqeDs94Bzo+ZWvCjy1Yg50C1zcVWr Ad5WKZSVCg01bV25jfMn9MNT+H9wUId10eEYvP4RWu8jVLevj8AhLmXMq+spIlKRWRQi uoFj/SZrxplrm/io59j39f91kt3bn6fHc1C8OFb0+43OCukrNNTqWzRKnkhJJwUO2pgm bgxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077027; x=1720681827; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YGgHOGkUBuv6eYgeSjuiCtb6ggI4omC5RLKnXlPWg5c=; b=nxMJu48tpKHkJNgSFntaMo+mJYUXb+GSklHA2mH96ZmBxfZJcleziqB+yBCF01yJKX DlBcE90x3WayZR3MJQJsITEl10rAD7hyMTXrb+P2UX05z62B1pHXriyfN4xJy717SZnp PHoUn2reF82JDMFttNjE1bs3u2tOlv7rwj+o3k1MVaYsijzmDp9Svss+1ZX5ggznZ2qe wgujk31KmaiNNX6DM9UgM5E2G6UfgKopElrEke5Y79aeWVSAj2+DjR6Ff0ZRNxOQD+zI q/9C2FVvcuz0UUtSe/zh86YIT33+UlyWHs5fvLegEtQdOyTqU9fqAItAkdIDhXG/crB7 Cp1Q== X-Gm-Message-State: AOJu0Yym6llkplmm0GPKLYqDTkeA5j0dzMFnSrbkNNi0jWDAnG58x2X5 R/Cx/LarSDXgKBqP/2gg3UZyfUaIVV7Fh30RFzrGaCNqbIw21jL8ZtfRAw== X-Google-Smtp-Source: AGHT+IEe8NKC3mxzrPG6MjUzQwIzHVENGfnfX7PcDm1l+EV9JBbg/OzwMgdujmvxc28sl4Lj+zLLiw== X-Received: by 2002:a05:600c:511c:b0:424:a4a2:9478 with SMTP id 5b1f17b1804b1-4264a3f2f7emr7060975e9.25.1720077026846; Thu, 04 Jul 2024 00:10:26 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:26 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 11/14] kernel-fitimage: fix intentation Date: Thu, 4 Jul 2024 09:09:47 +0200 Message-ID: <20240704071013.2982700-12-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201516 From: Adrian Freihofer python part should be 4 spaces, not 8. Signed-off-by: Adrian Freihofer --- meta/classes-recipe/kernel-fitimage.bbclass | 52 ++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 64836f6bef0..88b8edb9b54 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -29,32 +29,32 @@ KERNEL_IMAGETYPE_REPLACEMENT ?= "${@get_fit_replacement_type(d)}" DEPENDS:append = " ${@'u-boot-tools-native dtc-native' if 'fitImage' in (d.getVar('KERNEL_IMAGETYPES') or '').split() else ''}" python __anonymous () { - # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal - # to kernel.bbclass . We have to override it, since we pack zImage - # (at least for now) into the fitImage . - typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or "" - if 'fitImage' in typeformake.split(): - d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', d.getVar('KERNEL_IMAGETYPE_REPLACEMENT'))) - - if bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')): - bb.build.addtask('assemble_fitimage_initramfs', 'do_deploy', 'do_bundle_initramfs', d) - else: - bb.build.addtask('assemble_fitimage_initramfs', 'do_deploy', 'do_install', d) - - image = d.getVar('INITRAMFS_IMAGE') - if image: - d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') - - ubootenv = d.getVar('UBOOT_ENV') - if ubootenv: - d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/bootloader:do_populate_sysroot') - - #check if there are any dtb providers - providerdtb = d.getVar("PREFERRED_PROVIDER_virtual/dtb") - if providerdtb: - d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/dtb:do_populate_sysroot') - d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' virtual/dtb:do_populate_sysroot') - d.setVar('EXTERNAL_KERNEL_DEVICETREE', "${RECIPE_SYSROOT}/boot/devicetree") + # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal + # to kernel.bbclass . We have to override it, since we pack zImage + # (at least for now) into the fitImage . + typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or "" + if 'fitImage' in typeformake.split(): + d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', d.getVar('KERNEL_IMAGETYPE_REPLACEMENT'))) + + if bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')): + bb.build.addtask('assemble_fitimage_initramfs', 'do_deploy', 'do_bundle_initramfs', d) + else: + bb.build.addtask('assemble_fitimage_initramfs', 'do_deploy', 'do_install', d) + + image = d.getVar('INITRAMFS_IMAGE') + if image: + d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') + + ubootenv = d.getVar('UBOOT_ENV') + if ubootenv: + d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/bootloader:do_populate_sysroot') + + #check if there are any dtb providers + providerdtb = d.getVar("PREFERRED_PROVIDER_virtual/dtb") + if providerdtb: + d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/dtb:do_populate_sysroot') + d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' virtual/dtb:do_populate_sysroot') + d.setVar('EXTERNAL_KERNEL_DEVICETREE', "${RECIPE_SYSROOT}/boot/devicetree") } From patchwork Thu Jul 4 07:09:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45980 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 BA331C3DA41 for ; Thu, 4 Jul 2024 07:10:33 +0000 (UTC) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mx.groups.io with SMTP id smtpd.web11.4922.1720077029712528362 for ; Thu, 04 Jul 2024 00:10:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NWJ5MGVz; spf=pass (domain: gmail.com, ip: 209.85.167.51, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-52ccc40e72eso198045e87.3 for ; Thu, 04 Jul 2024 00:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077028; x=1720681828; 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; bh=K8rFO0esp8YzioHYvq1YGCdToDuB+fv05fshR+tD2+Q=; b=NWJ5MGVzng1iA2j8tXsy0mqIYORAqNfZQ8TCmGOre+ABhiCEJBZ4iBdH74F6gkvZmg yBvfBIS7g12UtN9aVuZTQiU1v91qpW4V2WKcfluSDPCNbZJBAf6nkQ6DxuhwjH1MohmR IpvbFjLlt1+1xb9VJD0TAlY8rJ74u3liN+LNXXQLiO1KHOlqcdAM3brZQtiQ+95bcbzf XnHeq9AzhNC5XvPIUUAcAgi9a2ycPEHNpggV+Iu3QQLjvEtOzra1dXZ/rJzMxrgzNU8u yoR7KLCiUJPIAF9DLmVfn0w3qiSlZf0lBVmVumRodypstgiortsCJajURWI0x6nZySsw GXHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077028; x=1720681828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K8rFO0esp8YzioHYvq1YGCdToDuB+fv05fshR+tD2+Q=; b=k/RonwVwA7paLH/NaOAGFENkF7HwTFmMgtmSM28HUBBlQ6zr6ZBJZ8xiM2A02j8vz0 bffu/2eP4jMjM+TjkwNqPHwUXhcbBMDhF+bs+b++yrLWrEBQeCXrpBz9yxQAKzC9y5Zv yJ9Eis1LZTkIi0mq9Q4vgK2j08eWAwwYFy6drYZWv7BU7Of7co+c2ayxusdrfvhZrZ5l +EszPkpBAB7nnc3/4GdnDeUMD6e5s4hnj0kGgsBj6jGNDuygukbZXERwA3Y/A17Cam+q 7XW2+tCZstR9K0dEZmlb+ci/FoaOPsSJ9e7jonJyi+Fdf78qzSe5wqxNVcQs7pIxZ5ac fQkQ== X-Gm-Message-State: AOJu0YyHSxuGlxG2rG9NKuaFdAOR4Jj3x2fsfY6MOGinmF/E8vQN8oUr KS1dvWIdU6So+oIBZjVeJZT7x+om69lC8HnJVBHmiGBFirEK5wnamWMyDQ== X-Google-Smtp-Source: AGHT+IFkbU7DAnS89cKM4RZ67aaBMDiQEwg6HxEJ7Rcq7WII83HvEH6aKYfkgDNOw9zfTlXUHxpsxw== X-Received: by 2002:ac2:4115:0:b0:52c:f3fa:86c with SMTP id 2adb3069b0e04-52ea0629bc7mr549347e87.18.1720077027454; Thu, 04 Jul 2024 00:10:27 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:27 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 12/14] kernel-fitimage: run unbundled fitimage after deploy Date: Thu, 4 Jul 2024 09:09:48 +0200 Message-ID: <20240704071013.2982700-13-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201517 From: Adrian Freihofer Generate the fitImage with unbundled initramfs after do_deploy. This allows to use the kernel image from the sstate of the do_deploy task. Without this change, the kernel is always rebuilt if something changes in the initramfs, which happens frequently. If the kernel is rebuilt with an empty TMPDIR, the process starts by fetching the large kernel git repository and recompiling it from scratch. This is very inefficient. This cannot be improved if INITRAMFS_IMAGE_BUNDLE = "1". If the kernel Makefile is needed to generate the initramfs bundle the kernel build folder is required. But for a build configuration with INITRAMFS_IMAGE_BUNDLE = "" the build folder is not needed. Creating the initramfs bundle requires: linux.bin, DTBs and the initramfs which are availabe in the deploy directory. That means creating the fitImage can be done with artifacts which are already cached by the sstate. The do_assemble_fitimage_initramfs gets split into two tasks: - do_assemble_fitimage_initramfs creates the bundled fitImage which runs before do_deploy. This is without sstate and therefore the do_deploy task still deploys the artifacts generated by this task. - do_deploy_fitimage_unbundled creates the fitImage in unbundled mode. This task runs after do_deploy. It uses the linux.bin artifact from do_deploy (and hence from sstate if available) to create the fitImage with initramfs. This task is done with SSTATE_SKIP_CREATION, because calling mkimage is probably quicker than handling this via sstate. Further this also works with the eSDK installer (oe-selftest -r esdk is successful). Unfortunately, this change is not 100% backwards compatible. Previously, a dependency on do_deploy deployed all types of fit images. With this change, deploying the unbundled fit image requires a dependency on do_deploy_fitimage_unbundled. This will be mitigated with a next commit. Signed-off-by: Adrian Freihofer --- meta/classes-recipe/kernel-fitimage.bbclass | 131 ++++++++++++-------- meta/classes-recipe/kernel.bbclass | 3 +- 2 files changed, 80 insertions(+), 54 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 88b8edb9b54..c4d474b8c1f 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -26,35 +26,52 @@ def get_fit_replacement_type(d): return replacementtype KERNEL_IMAGETYPE_REPLACEMENT ?= "${@get_fit_replacement_type(d)}" -DEPENDS:append = " ${@'u-boot-tools-native dtc-native' if 'fitImage' in (d.getVar('KERNEL_IMAGETYPES') or '').split() else ''}" python __anonymous () { - # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal - # to kernel.bbclass . We have to override it, since we pack zImage - # (at least for now) into the fitImage . - typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or "" - if 'fitImage' in typeformake.split(): - d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', d.getVar('KERNEL_IMAGETYPE_REPLACEMENT'))) - - if bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')): - bb.build.addtask('assemble_fitimage_initramfs', 'do_deploy', 'do_bundle_initramfs', d) - else: - bb.build.addtask('assemble_fitimage_initramfs', 'do_deploy', 'do_install', d) - - image = d.getVar('INITRAMFS_IMAGE') - if image: - d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') - - ubootenv = d.getVar('UBOOT_ENV') - if ubootenv: - d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/bootloader:do_populate_sysroot') - #check if there are any dtb providers providerdtb = d.getVar("PREFERRED_PROVIDER_virtual/dtb") if providerdtb: d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/dtb:do_populate_sysroot') - d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' virtual/dtb:do_populate_sysroot') d.setVar('EXTERNAL_KERNEL_DEVICETREE', "${RECIPE_SYSROOT}/boot/devicetree") + + d.appendVarFlag('do_assemble_fitimage', 'depends', + ' u-boot-tools-native:do_populate_sysroot dtc-native:do_populate_sysroot') + ubootenv = d.getVar('UBOOT_ENV') + if ubootenv: + d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/bootloader:do_populate_sysroot') + + typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or "" + if 'fitImage' in typeformake.split(): + # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal + # to kernel.bbclass . We have to override it, since we pack zImage + # (at least for now) into the fitImage . + d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', d.getVar('KERNEL_IMAGETYPE_REPLACEMENT'))) + + # A fitImage with the initramfs bundled in the kernel Image is deployed by do_deploy. + # In case of a build from an empty TMPDIR a clean kernel re-build is required just because creating the bundled + # kernel image requires the kernel Makefile and therefore the kernel's populated build directory. + # In case of an unbundled fitImage assembling the fitImage works independenly from the kernel build framework. + # This allow to take the kernel binary from the sstated deploy directory. But it requires to assemble the + # fitImage in a separate task (do_deploy_fitimage_unbundled) running after do_deploy. + initramfs_image = d.getVar('INITRAMFS_IMAGE') + bundled = bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')) + if initramfs_image: + if bundled: + bb.build.addtask('do_assemble_fitimage_initramfs', 'do_deploy', 'do_bundle_initramfs', d) + d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ' + initramfs_image + ':do_image_complete') + d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', + ' u-boot-tools-native:do_populate_sysroot dtc-native:do_populate_sysroot') + if providerdtb: + d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' virtual/dtb:do_populate_sysroot') + else: + bb.build.addtask('do_deploy_fitimage_unbundled', 'do_build', 'do_deploy', d) + bb.build.addtask('do_deploy_fitimage_unbundled_setscene', '', '', d) + d.appendVar('SSTATETASKS', ' do_deploy_fitimage_unbundled') + d.appendVarFlag('do_deploy_fitimage_unbundled', 'depends', ' ' + initramfs_image + ':do_image_complete') + d.appendVarFlag('do_deploy_fitimage_unbundled', 'depends', + ' u-boot-tools-native:do_populate_sysroot dtc-native:do_populate_sysroot') + if providerdtb: + d.appendVarFlag('do_deploy_fitimage_unbundled', 'depends', ' virtual/dtb:do_populate_sysroot') } @@ -802,18 +819,30 @@ do_install:append() { } do_assemble_fitimage_initramfs() { - if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \ - test -n "${INITRAMFS_IMAGE}" ; then - cd ${B} - uboot_prep_kimage - if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then - fitimage_assemble "fit-image-${INITRAMFS_IMAGE}.its" "${KERNEL_OUTPUT_DIR}/fitImage-bundle" "" - ln -sf fitImage-bundle "${B}/${KERNEL_OUTPUT_DIR}/fitImage" - else - fitimage_assemble "fit-image-${INITRAMFS_IMAGE}.its" "${KERNEL_OUTPUT_DIR}/fitImage-${INITRAMFS_IMAGE}" 1 - fi + uboot_prep_kimage + fitimage_assemble "fit-image-${INITRAMFS_IMAGE}.its" "${KERNEL_OUTPUT_DIR}/fitImage-bundle" "" + ln -sf fitImage-bundle "${B}/${KERNEL_OUTPUT_DIR}/fitImage" +} +do_assemble_fitimage_initramfs[dirs] = "${B}" + +do_deploy_fitimage_unbundled() { + fitimage_assemble "${DEPLOY_DIR_IMAGE}/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its"\ + "${DEPLOY_DIR_IMAGE}/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT}" 1 + if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then + ln -snf "fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT}" "${DEPLOY_DIR_IMAGE}/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" + ln -snf fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "${DEPLOY_DIR_IMAGE}/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" fi } +DEPLOYDIR_FITIMAGE_UNBUNDLED = "${WORKDIR}/deploy-fitimage-unbundled-${PN}" +SSTATE_SKIP_CREATION:task-deploy-fitimage-unbundled = '1' +do_deploy_fitimage_unbundled[sstate-inputdirs] = "${DEPLOYDIR_FITIMAGE_UNBUNDLED}" +do_deploy_fitimage_unbundled[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" +python do_deploy_fitimage_unbundled_setscene () { + sstate_setscene(d) +} +do_deploy_fitimage_unbundled[dirs] = "${DEPLOY_DIR_IMAGE}" +do_deploy_fitimage_unbundled[cleandirs] = "${DEPLOYDIR_FITIMAGE_UNBUNDLED}" +do_deploy_fitimage_unbundled[stamp-extra-info] = "${MACHINE_ARCH}" do_kernel_generate_rsa_keys() { if [ "${UBOOT_SIGN_ENABLE}" = "0" ] && [ "${FIT_GENERATE_KEYS}" = "1" ]; then @@ -866,9 +895,23 @@ kernel_do_deploy[vardepsexclude] = "DATETIME" kernel_do_deploy:append() { # Update deploy directory if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then - - if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then - # deploy the artifacts of do_assemble_fitimage + if [ -n "${INITRAMFS_IMAGE}" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then + # do_deploy_fitimage_unbundled needs the linux.bin file for the unbundled fitImage deployment + bbnote "Deploying linux.bin file for do_deploy_fitimage_unbundled..." + uboot_prep_kimage + install -m 0644 ${B}/linux.bin $deployDir/linux.bin + if [ -e "${B}/${KERNEL_OUTPUT_DIR}/setup.bin" ]; then + install -m 0644 "${B}/${KERNEL_OUTPUT_DIR}/setup.bin" "$deployDir/setup.bin" + fi + elif [ -n "${INITRAMFS_IMAGE}" ]; then + # deploy the artifacts created by do_assemble_fitimage_initramfs for bundled mode + bbnote "Copying fit-image-${INITRAMFS_IMAGE}.its source file..." + install -m 0644 ${B}/fit-image-${INITRAMFS_IMAGE}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its" + if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then + ln -snf fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" + fi + else + # deploy the artifacts of do_assemble_fitimage (fitImage without initramfs) bbnote "Copying fit-image.its source file..." install -m 0644 ${B}/fit-image.its "$deployDir/fitImage-its-${KERNEL_FIT_NAME}.its" if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then @@ -881,23 +924,5 @@ kernel_do_deploy:append() { ln -snf fitImage-linux.bin-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT} "$deployDir/fitImage-linux.bin-${KERNEL_FIT_LINK_NAME}" fi fi - - if [ -n "${INITRAMFS_IMAGE}" ]; then - # deploy the artifacts of do_assemble_fitimage_initramfs for bundled as well as un-bundled mode - bbnote "Copying fit-image-${INITRAMFS_IMAGE}.its source file..." - install -m 0644 ${B}/fit-image-${INITRAMFS_IMAGE}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its" - if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then - ln -snf fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" - fi - - # deploy the artifacts of do_assemble_fitimage_initramfs for bundled mode only - if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then - bbnote "Copying fitImage-${INITRAMFS_IMAGE} file..." - install -m 0644 ${B}/${KERNEL_OUTPUT_DIR}/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT}" - if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then - ln -snf fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" - fi - fi - fi fi } diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index 6d242114852..3a3b2d40b2c 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -484,7 +484,8 @@ kernel_do_install() { # So, at the level of the install task we should not try to install the fitImage. fitImage is still not # generated yet. # After the generation of the fitImage, the deploy task copies the fitImage from the build directory to - # the deploy folder. + # the deploy folder. If INITRAMFS_IMAGE_BUNDLE != 1 the fitImage with initramfs is deployed after the + # deploy task. # for imageType in ${KERNEL_IMAGETYPES} ; do From patchwork Thu Jul 4 07:09:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45975 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 909E7C38150 for ; Thu, 4 Jul 2024 07:10:33 +0000 (UTC) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mx.groups.io with SMTP id smtpd.web11.4923.1720077030339246222 for ; Thu, 04 Jul 2024 00:10:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BMMA3Fiq; spf=pass (domain: gmail.com, ip: 209.85.167.48, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-52e829086f3so301720e87.3 for ; Thu, 04 Jul 2024 00:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077028; x=1720681828; 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; bh=SfjLd9FOVW2I6/6onHXMMhtC4OhIUoegSNhesRzxprQ=; b=BMMA3FiqO3tWZoWlZXU5hKTzNBi30NbyE8f64NaR6GwCM2rO9vDKWxnxWTnxgjA6Jw x/BOlZ8+GklCBNtI8+mtGhWEZkBh1UjznXQs3XNJGK7eyo5ecRKdYs28olX0pfUGLQUj 0SDQ3quIP2c+MVqAhAFjMrvYhIpGYl41pKZdesTiE017ddiHc3XAvHWhvPjme6b82sxW lK4tRFd80sU09fLy3+JVsvro5PGBn4M16zMQxd1DCurJlf93+aqTOK2BLBfANqoY8fIT NtrjUNGa/UWct6p3oxWxhnZXPDjJJK/C0WwlWabtLb2mgFDiOBLrLlPyck8LC7S3B/RM Gwcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077028; x=1720681828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SfjLd9FOVW2I6/6onHXMMhtC4OhIUoegSNhesRzxprQ=; b=p31Mfwg01V6hduiWLFGzXZ+A0D/qOzg9CD3tRW59g/dt0WNdxtkE4sL9r8CfLTAjiK Bke0JJpfR3yhFZvZ2xnvTlI5K7B28EFBTqJEfZzbyCUIAUy9muENIyfSvOLlTF6KrdNK iGIILr6mzHl8O+pW4ui/hESy0g4busA3D03a5fh89HpmCORmho0NmPgIIybjRt4Z1xbW jDK8pHTkSMKAPIoGv4rEewHCnCxbwbvM6kqvq+hDUGoOl72NOr4aMMclU9+xdFlx/ipM xD+Wl8O4kRTLopYe78MTFsmtcflhEb5yY5yMiPpuzD20BKtsh0sYhg/bKrsSinLM2ic4 ZDEA== X-Gm-Message-State: AOJu0YyWQV62d2srrHQoCMQCzJXbCghaxb5B5rKMASt8ZVySb4561vJA aRBK936qjTXaXqXmCCKISjQAEsddAGpguoiPS7EOS8DYJ/Vs+biJzC4ltg== X-Google-Smtp-Source: AGHT+IGfaqYya2qtoijE5UWpXgvo58NBd+z3kvgKNwBckEGrcZFN38VnwTrL0oLusOWhU6awUqYKIw== X-Received: by 2002:ac2:5dc1:0:b0:52e:9480:9e71 with SMTP id 2adb3069b0e04-52ea0632d66mr463488e87.28.1720077028133; Thu, 04 Jul 2024 00:10:28 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:27 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 13/14] image: depends do_deploy_fitimage_unbundled Date: Thu, 4 Jul 2024 09:09:49 +0200 Message-ID: <20240704071013.2982700-14-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201518 From: Adrian Freihofer If a fitImage kernel with unbundled initramfs is built the final deploy task is now do_deploy_fitimage_unbundled. Signed-off-by: Adrian Freihofer --- meta/classes-recipe/image.bbclass | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass index 28be6c63623..02a7952bcf9 100644 --- a/meta/classes-recipe/image.bbclass +++ b/meta/classes-recipe/image.bbclass @@ -142,7 +142,17 @@ do_rootfs[vardeps] += "${@rootfs_variables(d)}" # This follows many common usecases and user expectations. # But if you are building an image which doesn't need the kernel image at all, # you can unset this variable manually. -KERNEL_DEPLOY_DEPEND ?= "virtual/kernel:do_deploy" +def get_kernel_do_deploy(d): + kerneltypes = d.getVar('KERNEL_IMAGETYPES') or "" + kerneltype = d.getVar('KERNEL_IMAGETYPE') or "" + fitimage = kerneltype == 'fitImage' or 'fitImage' in kerneltypes.split() + initramfs_image = d.getVar('INITRAMFS_IMAGE') or "" + bundled = d.getVar('INITRAMFS_IMAGE_BUNDLE') == '1' + if fitimage and initramfs_image and not bundled: + return "virtual/kernel:do_deploy_fitimage_unbundled" + return "virtual/kernel:do_deploy" + +KERNEL_DEPLOY_DEPEND ?= "${@get_kernel_do_deploy(d)}" do_build[depends] += "${KERNEL_DEPLOY_DEPEND}" From patchwork Thu Jul 4 07:09:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 45987 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 8EE2FC3065C for ; Thu, 4 Jul 2024 07:10:33 +0000 (UTC) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by mx.groups.io with SMTP id smtpd.web10.5053.1720077031953960110 for ; Thu, 04 Jul 2024 00:10:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BWT3+bqW; spf=pass (domain: gmail.com, ip: 209.85.208.173, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2ee794ebffbso4307751fa.1 for ; Thu, 04 Jul 2024 00:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720077030; x=1720681830; 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; bh=12cO+tH2hu0/2K15ZJ0t2yg3xohQkQ68d56UGs5uuc0=; b=BWT3+bqWn5dfvLIDtWJuC/H2orNRRTwK929VzL8vDS5p+D8AheUeY/yVTdYDtyFM5T 8eRO0FB9oF1qwmE79pgFfSShtMIUrOHYVSz4n1JclQFaGogV8F8mnjj86s+Bl3xIag4F ACjkBJ0fCjEVffpKvFT7U9TJxmt25Dk1KwxhODFBz7WBjKAVxwnJpqWHj409TM3J7iaq rdoKDz1HxQBNc5hWCioZFiGzzLK1wRLA0jGEoq2BkCTV/Wid6nMzJ1rKGq0M2Jx601ti dpBKaGAYvgjXS9KV8cE6yQrMNcwBJiSmbZHJqSKTxeRZVveuDlLrMSRGh+ISq81+EWjV Iu1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720077030; x=1720681830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=12cO+tH2hu0/2K15ZJ0t2yg3xohQkQ68d56UGs5uuc0=; b=NHG8cQcf6+DZSYeNcyFjCZpBbBM5UVMM3Mf4HSmxvVMb9xrFpDsfCaJYX4sB94lyUM dlCrpUfpk6A2qemlt/3QKPzQkPtp96XoxE6zD9D4RDegR4yKKP5BkzkOWq8OQvcpENHz cVZWImcENf1Lg1gtJAcMB4TMIR8w0r860T3PjURlr2E87WK8Dt1jw4JhzeEEK5qkQq2d gPzhMGHbgXtsK6YbZN8mn9Cy5cNeyaCuBdYuZFxJGIN7BuYCFCz+trY0uGDoLPVWquSg IPmCNEqct53ojaladCUbWnCPE6Rk6fXRsjU/n0Sku3PiJoud3KULZ+vDnIYJrGiVCPNC COtQ== X-Gm-Message-State: AOJu0Yzy+YyrilHlGhnapQ1XlzZoeziZ+CrLmQl5Ur/sTHf2kKYt95r8 3A+iUoYoP2jcV2xP+rq4cYdnHGwxOTD0H91zTI2jYdibHna95wAZ1OxB5Q== X-Google-Smtp-Source: AGHT+IGLJ++AVTCQab2FEJoVWABxARx3jQpzWQS7XMLqWjQOQktZbL2V7rcyjgFhZ23pxcVM7wpODw== X-Received: by 2002:a2e:8397:0:b0:2ec:6639:1210 with SMTP id 38308e7fff4ca-2ee8ed69cc0mr5429971fa.8.1720077029150; Thu, 04 Jul 2024 00:10:29 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1f23f9sm11597255e9.26.2024.07.04.00.10.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:10:28 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 14/14] DO NOT MERGE: explanation and testing Date: Thu, 4 Jul 2024 09:09:50 +0200 Message-ID: <20240704071013.2982700-15-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240704071013.2982700-1-adrian.freihofer@gmail.com> References: <20240704071013.2982700-1-adrian.freihofer@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 04 Jul 2024 07:10:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201519 From: Adrian Freihofer These patches are a bit complicated to explain. This extra commit provides some additional documentation with some task graph diagrams in html format. The html file was generated by the shell script which is also added to this commit. (Notes are added manually.) Signed-off-by: Adrian Freihofer --- kernel-tasks.sh | 76 +++ task-depends.html | 1122 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1198 insertions(+) create mode 100755 kernel-tasks.sh create mode 100644 task-depends.html diff --git a/kernel-tasks.sh b/kernel-tasks.sh new file mode 100755 index 00000000000..b8b096f7d57 --- /dev/null +++ b/kernel-tasks.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +OUTPUT_FILE=task-depends.md + +echo "# Task dependeny changes" > "$OUTPUT_FILE" +echo "" >> "$OUTPUT_FILE" + +run_bitbake(){ + echo "$1" >> "$OUTPUT_FILE" + echo "" >> "$OUTPUT_FILE" + echo '```plantuml' >> "$OUTPUT_FILE" + + bitbake virtual/kernel -g + grep -E '(digraph depends|linux-yocto|\})' task-depends.dot \ + | grep -v -E '(spdx|do_kernel_configcheck|do_prepare_recipe_sysroot|do_populate_lic|do_populate_sysroot|do_package|do_validate_branches|do_unpack|do_recipe_qa|do_patch|do_kernel_checkout|do_kernel_configme|do_kernel_metadata|do_sizecheck|do_strip|do_compile_kernelmodules|do_shared_workdir|do_transform_kernel|do_kernel_link_images|do_kernel_version_sanity_check|do_symlink_kernsrc|do_deploy_source_date_epoch|do_configure|do_fetch)' \ + | sed 's;\\n\:.*.bb;;g' >> "$OUTPUT_FILE" + + # > task-depends-$1.dot + # dot -T svg task-depends-$1.dot > task-depends-$1.svg + + echo '```' >> "$OUTPUT_FILE" + echo "" >> "$OUTPUT_FILE" +} + +run_bitbake_per_branch(){ + echo "## Configuration: $1" >> "$OUTPUT_FILE" + echo "" >> "$OUTPUT_FILE" + echo '```raw' >> "$OUTPUT_FILE" + cat build/conf/auto.conf >> "$OUTPUT_FILE" + echo '```' >> "$OUTPUT_FILE" + echo "" >> "$OUTPUT_FILE" + + for branch in master adrianf/kernel-fitimage-sstate; do + git checkout $branch + run_bitbake "### branch: $branch" + done +} + +cat << EOF > build/conf/auto.conf +KERNEL_IMAGETYPE = "Image" +KERNEL_IMAGETYPES += " fitImage " +KERNEL_CLASSES = " kernel-fitimage " +IMAGE_FSTYPES += "cpio.gz" +INITRAMFS_IMAGE = "core-image-minimal" +EOF +run_bitbake_per_branch "image, fitimage, initramfs, unbundled" + + +cat << EOF > build/conf/auto.conf +KERNEL_IMAGETYPE:forcevariable = "fitImage" +KERNEL_CLASSES = " kernel-fitimage " +IMAGE_FSTYPES += "cpio.gz" +INITRAMFS_IMAGE = "core-image-minimal" +EOF +run_bitbake_per_branch "fitimage, initramfs, unbundled" + + +cat << EOF > build/conf/auto.conf +KERNEL_IMAGETYPE = "Image" +KERNEL_IMAGETYPES += " fitImage " +KERNEL_CLASSES = " kernel-fitimage " +IMAGE_FSTYPES += "cpio.gz" +INITRAMFS_IMAGE = "core-image-minimal" +INITRAMFS_IMAGE_BUNDLE = "1" +EOF +run_bitbake_per_branch "image, fitimage, initramfs, bundled" + + +cat << EOF > build/conf/auto.conf +KERNEL_IMAGETYPE = "Image" +KERNEL_IMAGETYPES += " fitImage " +KERNEL_CLASSES = " kernel-fitimage " +EOF +run_bitbake_per_branch "image, fitimage" + +rm build/conf/auto.conf diff --git a/task-depends.html b/task-depends.html new file mode 100644 index 00000000000..7ad4f8e2de6 --- /dev/null +++ b/task-depends.html @@ -0,0 +1,1122 @@ + + task-depends + + + + + + + + + + + + + +
+ +

Task dependeny changes

+

Configuration: image, fitimage, initramfs, unbundled

+
KERNEL_IMAGETYPE = "Image"
+KERNEL_IMAGETYPES += " fitImage "
+KERNEL_CLASSES = " kernel-fitimage "
+IMAGE_FSTYPES += "cpio.gz"
+INITRAMFS_IMAGE = "core-image-minimal"
+

Notes:

+
    +
  • do_bundle_initramfs has if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then.
    +It's an empty task because here we have INITRAMFS_IMAGE_BUNDLE = "".
  • +
  • do_assemble_fitimage_initramfs --> do_deploy_fitimage_unbundled
  • +
+

branch: master

+

+ + + + + +depends + + + +linux-yocto.do_assemble_fitimage + +linux-yocto do_assemble_fitimage + + + +linux-yocto.do_compile + +linux-yocto do_compile + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_compile + + + + + +linux-yocto.do_kernel_generate_rsa_keys + +linux-yocto do_kernel_generate_rsa_keys + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_kernel_generate_rsa_keys + + + + + +linux-yocto.do_kernel_generate_rsa_keys->linux-yocto.do_compile + + + + + +linux-yocto.do_assemble_fitimage_initramfs + +linux-yocto do_assemble_fitimage_initramfs + + + +core-image-minimal.do_image_complete + +core-image-minimal.do_image_complete + + + +linux-yocto.do_assemble_fitimage_initramfs->core-image-minimal.do_image_complete + + + + + +linux-yocto.do_bundle_initramfs + +linux-yocto do_bundle_initramfs + + + +linux-yocto.do_assemble_fitimage_initramfs->linux-yocto.do_bundle_initramfs + + + + + +linux-yocto.do_bundle_initramfs->core-image-minimal.do_image_complete + + + + + +linux-yocto.do_install + +linux-yocto do_install + + + +linux-yocto.do_bundle_initramfs->linux-yocto.do_install + + + + + +linux-yocto.do_build + +linux-yocto do_build + + + +linux-yocto.do_deploy + +linux-yocto do_deploy + + + +linux-yocto.do_build->linux-yocto.do_deploy + + + + + +linux-yocto.do_deploy->linux-yocto.do_assemble_fitimage_initramfs + + + + + +linux-yocto.do_deploy->linux-yocto.do_bundle_initramfs + + + + + +linux-yocto.do_install->linux-yocto.do_assemble_fitimage + + + + + +linux-yocto.do_install->linux-yocto.do_compile + + + + + +

branch: adrianf/kernel-fitimage-sstate

+

+ + + + + +depends + + + +linux-yocto.do_assemble_fitimage + +linux-yocto do_assemble_fitimage + + + +linux-yocto.do_compile + +linux-yocto do_compile + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_compile + + + + + +linux-yocto.do_kernel_generate_rsa_keys + +linux-yocto do_kernel_generate_rsa_keys + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_kernel_generate_rsa_keys + + + + + +linux-yocto.do_kernel_generate_rsa_keys->linux-yocto.do_compile + + + + + +linux-yocto.do_build + +linux-yocto do_build + + + +linux-yocto.do_deploy + +linux-yocto do_deploy + + + +linux-yocto.do_build->linux-yocto.do_deploy + + + + + +linux-yocto.do_deploy_fitimage_unbundled + +linux-yocto do_deploy_fitimage_unbundled + + + +linux-yocto.do_build->linux-yocto.do_deploy_fitimage_unbundled + + + + + +linux-yocto.do_install + +linux-yocto do_install + + + +linux-yocto.do_deploy->linux-yocto.do_install + + + + + +linux-yocto.do_deploy_fitimage_unbundled->linux-yocto.do_deploy + + + + + +core-image-minimal.do_image_complete + +core-image-minimal.do_image_complete + + + +linux-yocto.do_deploy_fitimage_unbundled->core-image-minimal.do_image_complete + + + + + +linux-yocto.do_install->linux-yocto.do_assemble_fitimage + + + + + +linux-yocto.do_install->linux-yocto.do_compile + + + + + +

Configuration: fitimage, initramfs, unbundled

+
KERNEL_IMAGETYPE:forcevariable = "fitImage"
+KERNEL_CLASSES = " kernel-fitimage "
+IMAGE_FSTYPES += "cpio.gz"
+INITRAMFS_IMAGE = "core-image-minimal"
+

Notes:

+
    +
  • Same as previous, but KERNEL_IMAGETYPES is not set.
  • +
  • do_bundle_initramfs has if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then.
    +It's an empty task because here we have INITRAMFS_IMAGE_BUNDLE = "".
  • +
  • do_assemble_fitimage_initramfs --> do_deploy_fitimage_unbundled
  • +
+

branch: master

+

+ + + + + +depends + + + +linux-yocto.do_assemble_fitimage + +linux-yocto do_assemble_fitimage + + + +linux-yocto.do_compile + +linux-yocto do_compile + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_compile + + + + + +linux-yocto.do_kernel_generate_rsa_keys + +linux-yocto do_kernel_generate_rsa_keys + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_kernel_generate_rsa_keys + + + + + +linux-yocto.do_kernel_generate_rsa_keys->linux-yocto.do_compile + + + + + +linux-yocto.do_assemble_fitimage_initramfs + +linux-yocto do_assemble_fitimage_initramfs + + + +core-image-minimal.do_image_complete + +core-image-minimal.do_image_complete + + + +linux-yocto.do_assemble_fitimage_initramfs->core-image-minimal.do_image_complete + + + + + +linux-yocto.do_bundle_initramfs + +linux-yocto do_bundle_initramfs + + + +linux-yocto.do_assemble_fitimage_initramfs->linux-yocto.do_bundle_initramfs + + + + + +linux-yocto.do_bundle_initramfs->core-image-minimal.do_image_complete + + + + + +linux-yocto.do_install + +linux-yocto do_install + + + +linux-yocto.do_bundle_initramfs->linux-yocto.do_install + + + + + +linux-yocto.do_build + +linux-yocto do_build + + + +linux-yocto.do_deploy + +linux-yocto do_deploy + + + +linux-yocto.do_build->linux-yocto.do_deploy + + + + + +linux-yocto.do_deploy->linux-yocto.do_assemble_fitimage_initramfs + + + + + +linux-yocto.do_deploy->linux-yocto.do_bundle_initramfs + + + + + +linux-yocto.do_install->linux-yocto.do_assemble_fitimage + + + + + +linux-yocto.do_install->linux-yocto.do_compile + + + + + +

branch: adrianf/kernel-fitimage-sstate

+

+ + + + + +depends + + + +linux-yocto.do_assemble_fitimage + +linux-yocto do_assemble_fitimage + + + +linux-yocto.do_compile + +linux-yocto do_compile + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_compile + + + + + +linux-yocto.do_kernel_generate_rsa_keys + +linux-yocto do_kernel_generate_rsa_keys + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_kernel_generate_rsa_keys + + + + + +linux-yocto.do_kernel_generate_rsa_keys->linux-yocto.do_compile + + + + + +linux-yocto.do_build + +linux-yocto do_build + + + +linux-yocto.do_deploy + +linux-yocto do_deploy + + + +linux-yocto.do_build->linux-yocto.do_deploy + + + + + +linux-yocto.do_deploy_fitimage_unbundled + +linux-yocto do_deploy_fitimage_unbundled + + + +linux-yocto.do_build->linux-yocto.do_deploy_fitimage_unbundled + + + + + +linux-yocto.do_install + +linux-yocto do_install + + + +linux-yocto.do_deploy->linux-yocto.do_install + + + + + +linux-yocto.do_deploy_fitimage_unbundled->linux-yocto.do_deploy + + + + + +core-image-minimal.do_image_complete + +core-image-minimal.do_image_complete + + + +linux-yocto.do_deploy_fitimage_unbundled->core-image-minimal.do_image_complete + + + + + +linux-yocto.do_install->linux-yocto.do_assemble_fitimage + + + + + +linux-yocto.do_install->linux-yocto.do_compile + + + + + +

Configuration: image, fitimage, initramfs, bundled

+
KERNEL_IMAGETYPE = "Image"
+KERNEL_IMAGETYPES += " fitImage "
+KERNEL_CLASSES = " kernel-fitimage "
+IMAGE_FSTYPES += "cpio.gz"
+INITRAMFS_IMAGE = "core-image-minimal"
+INITRAMFS_IMAGE_BUNDLE = "1"
+

Notes:

+
    +
  • No change for bundled fitImage builds
  • +
+

branch: master

+

+ + + + + +depends + + + +linux-yocto.do_assemble_fitimage + +linux-yocto do_assemble_fitimage + + + +linux-yocto.do_compile + +linux-yocto do_compile + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_compile + + + + + +linux-yocto.do_kernel_generate_rsa_keys + +linux-yocto do_kernel_generate_rsa_keys + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_kernel_generate_rsa_keys + + + + + +linux-yocto.do_kernel_generate_rsa_keys->linux-yocto.do_compile + + + + + +linux-yocto.do_assemble_fitimage_initramfs + +linux-yocto do_assemble_fitimage_initramfs + + + +core-image-minimal.do_image_complete + +core-image-minimal.do_image_complete + + + +linux-yocto.do_assemble_fitimage_initramfs->core-image-minimal.do_image_complete + + + + + +linux-yocto.do_bundle_initramfs + +linux-yocto do_bundle_initramfs + + + +linux-yocto.do_assemble_fitimage_initramfs->linux-yocto.do_bundle_initramfs + + + + + +linux-yocto.do_bundle_initramfs->core-image-minimal.do_image_complete + + + + + +linux-yocto.do_install + +linux-yocto do_install + + + +linux-yocto.do_bundle_initramfs->linux-yocto.do_install + + + + + +linux-yocto.do_build + +linux-yocto do_build + + + +linux-yocto.do_deploy + +linux-yocto do_deploy + + + +linux-yocto.do_build->linux-yocto.do_deploy + + + + + +linux-yocto.do_deploy->linux-yocto.do_assemble_fitimage_initramfs + + + + + +linux-yocto.do_deploy->linux-yocto.do_bundle_initramfs + + + + + +linux-yocto.do_transform_bundled_initramfs + +linux-yocto do_transform_bundled_initramfs + + + +linux-yocto.do_deploy->linux-yocto.do_transform_bundled_initramfs + + + + + +linux-yocto.do_install->linux-yocto.do_assemble_fitimage + + + + + +linux-yocto.do_install->linux-yocto.do_compile + + + + + +linux-yocto.do_transform_bundled_initramfs->linux-yocto.do_bundle_initramfs + + + + + +

branch: adrianf/kernel-fitimage-sstate

+

+ + + + + +depends + + + +linux-yocto.do_assemble_fitimage + +linux-yocto do_assemble_fitimage + + + +linux-yocto.do_compile + +linux-yocto do_compile + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_compile + + + + + +linux-yocto.do_kernel_generate_rsa_keys + +linux-yocto do_kernel_generate_rsa_keys + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_kernel_generate_rsa_keys + + + + + +linux-yocto.do_kernel_generate_rsa_keys->linux-yocto.do_compile + + + + + +linux-yocto.do_assemble_fitimage_initramfs + +linux-yocto do_assemble_fitimage_initramfs + + + +core-image-minimal.do_image_complete + +core-image-minimal.do_image_complete + + + +linux-yocto.do_assemble_fitimage_initramfs->core-image-minimal.do_image_complete + + + + + +linux-yocto.do_bundle_initramfs + +linux-yocto do_bundle_initramfs + + + +linux-yocto.do_assemble_fitimage_initramfs->linux-yocto.do_bundle_initramfs + + + + + +linux-yocto.do_bundle_initramfs->core-image-minimal.do_image_complete + + + + + +linux-yocto.do_install + +linux-yocto do_install + + + +linux-yocto.do_bundle_initramfs->linux-yocto.do_install + + + + + +linux-yocto.do_build + +linux-yocto do_build + + + +linux-yocto.do_deploy + +linux-yocto do_deploy + + + +linux-yocto.do_build->linux-yocto.do_deploy + + + + + +linux-yocto.do_deploy->linux-yocto.do_assemble_fitimage_initramfs + + + + + +linux-yocto.do_deploy->linux-yocto.do_bundle_initramfs + + + + + +linux-yocto.do_transform_bundled_initramfs + +linux-yocto do_transform_bundled_initramfs + + + +linux-yocto.do_deploy->linux-yocto.do_transform_bundled_initramfs + + + + + +linux-yocto.do_install->linux-yocto.do_assemble_fitimage + + + + + +linux-yocto.do_install->linux-yocto.do_compile + + + + + +linux-yocto.do_transform_bundled_initramfs->linux-yocto.do_bundle_initramfs + + + + + +

Configuration: image, fitimage

+
KERNEL_IMAGETYPE = "Image"
+KERNEL_IMAGETYPES += " fitImage "
+KERNEL_CLASSES = " kernel-fitimage "
+

Notes:

+
    +
  • do_bundle_initramfs has if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then.
    +It's an empty task because here we have INITRAMFS_IMAGE_BUNDLE = "".
  • +
  • do_assemble_fitimage_initramfs is not needed because there is no initramfs
  • +
+

branch: master

+

+ + + + + +depends + + + +linux-yocto.do_assemble_fitimage + +linux-yocto do_assemble_fitimage + + + +linux-yocto.do_compile + +linux-yocto do_compile + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_compile + + + + + +linux-yocto.do_kernel_generate_rsa_keys + +linux-yocto do_kernel_generate_rsa_keys + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_kernel_generate_rsa_keys + + + + + +linux-yocto.do_kernel_generate_rsa_keys->linux-yocto.do_compile + + + + + +linux-yocto.do_assemble_fitimage_initramfs + +linux-yocto do_assemble_fitimage_initramfs + + + +linux-yocto.do_bundle_initramfs + +linux-yocto do_bundle_initramfs + + + +linux-yocto.do_assemble_fitimage_initramfs->linux-yocto.do_bundle_initramfs + + + + + +linux-yocto.do_install + +linux-yocto do_install + + + +linux-yocto.do_bundle_initramfs->linux-yocto.do_install + + + + + +linux-yocto.do_build + +linux-yocto do_build + + + +linux-yocto.do_deploy + +linux-yocto do_deploy + + + +linux-yocto.do_build->linux-yocto.do_deploy + + + + + +linux-yocto.do_deploy->linux-yocto.do_assemble_fitimage_initramfs + + + + + +linux-yocto.do_deploy->linux-yocto.do_bundle_initramfs + + + + + +linux-yocto.do_install->linux-yocto.do_assemble_fitimage + + + + + +linux-yocto.do_install->linux-yocto.do_compile + + + + + +

branch: adrianf/kernel-fitimage-sstate

+

+ + + + + +depends + + + +linux-yocto.do_assemble_fitimage + +linux-yocto do_assemble_fitimage + + + +linux-yocto.do_compile + +linux-yocto do_compile + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_compile + + + + + +linux-yocto.do_kernel_generate_rsa_keys + +linux-yocto do_kernel_generate_rsa_keys + + + +linux-yocto.do_assemble_fitimage->linux-yocto.do_kernel_generate_rsa_keys + + + + + +linux-yocto.do_kernel_generate_rsa_keys->linux-yocto.do_compile + + + + + +linux-yocto.do_build + +linux-yocto do_build + + + +linux-yocto.do_deploy + +linux-yocto do_deploy + + + +linux-yocto.do_build->linux-yocto.do_deploy + + + + + +linux-yocto.do_install + +linux-yocto do_install + + + +linux-yocto.do_deploy->linux-yocto.do_install + + + + + +linux-yocto.do_install->linux-yocto.do_assemble_fitimage + + + + + +linux-yocto.do_install->linux-yocto.do_compile + + + + + +

+
+ + + + + + + + + + \ No newline at end of file