From patchwork Mon Jul 15 14:10: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: 46369 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 AC886C3DA5D for ; Mon, 15 Jul 2024 14:15:18 +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.web11.38952.1721052910192393679 for ; Mon, 15 Jul 2024 07:15:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YB4B2leO; 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-2ee91d9cb71so45737571fa.0 for ; Mon, 15 Jul 2024 07:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721052908; x=1721657708; 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=6MHRGAKeXAQEg0wG7vpCt6KCDnhphvCiCi4pipi/lJg=; b=YB4B2leOU2k+iH5PyzHd3DLQ93kxyK7g/yDkPVeP7jK4bhbYzS89oJt1PLmmi72g28 NHfdK/EBemo9b9gP0ctoec2sJtqVXoINMBrIdHV1RaZn7+NWrHFEbmDzc/iqRGkM2Lrw dMngWajwP7MuHBT0R9pQTDewYOQjh8iA2z+I2ouqloIqCaAJkQcw6T4P56BDfvcYGWY0 pHNvoOKbh0voFLJrSGB+o5NdSOIcQChqnRCoOdA7gl1paJpLio8rRBo8wLoT1kzV6pqS GaefZGriSoHe1DTFDmBewGHfkt4EnE/xPm8pT8EJ/LBgtvXpWcAtvgL6hGCi07QhVMn2 1kkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721052908; x=1721657708; 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=6MHRGAKeXAQEg0wG7vpCt6KCDnhphvCiCi4pipi/lJg=; b=knK29SINM+YlNNwIM87ElwAB9HilmwHMK4kkoqa12je7Uf3nYy8KZFzusUdw5+tnNJ bSRzkeDTLv968q2YPG81gCh21IOQOC7svrJjcV83ODyamTq3+7eiWLXbJWYxFkkHfTxO T1yAzGOfnJA5fpaO6zX5qQhSHNAAegOoPMhVKhzadMDyXEV+hBkVBjw/TC+Ch4/hFKe6 4GMn24+x1bP2g2pg50mH2We7/jnNZZ929ieeoSJw90Utex06iFPMcD6XYqnWviOs/jTZ ydDJ1ppq/+Js0m6pE5LOXdKkfNaX7+RltGh+NydyWDJ33z1tgaPOwSb/Slp6qfhzyWdP mGfQ== X-Gm-Message-State: AOJu0YxGtE/bCGUNREJQoK3PZR4aDDuGkVjukyQbl3F3DKPuTGDYif3q Z1tJpE8DUUVQ4k712GyR9lCavTmeWlOxZmAxk81jdNg8fFSpulEnRRlmuw== X-Google-Smtp-Source: AGHT+IGNf/yQ+O2JJWVdazoHIiAGxu6KCTNxisx0gtzR+9r+vXi7W7peiYfkfJwnMYxU3MlVN+0ypw== X-Received: by 2002:a05:651c:502:b0:2ee:8eb6:ff61 with SMTP id 38308e7fff4ca-2eef2d852e2mr267931fa.2.1721052907475; Mon, 15 Jul 2024 07:15:07 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680daccbddsm6499074f8f.64.2024.07.15.07.15.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 07:15:07 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 1/6] kernel-fitimage: fix intentation Date: Mon, 15 Jul 2024 16:10:38 +0200 Message-ID: <20240715141448.2158477-2-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715141448.2158477-1-adrian.freihofer@gmail.com> References: <20240715141448.2158477-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 ; Mon, 15 Jul 2024 14:15:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201927 From: Adrian Freihofer white space changes only. - python part should be 4 spaces, not 8. - use tabs for shell Signed-off-by: Adrian Freihofer --- meta/classes-recipe/kernel-fitimage.bbclass | 64 ++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 6e6898e5f6f..ce52297aec3 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -29,27 +29,27 @@ 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'))) - - 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'))) + + 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") } @@ -480,13 +480,13 @@ fitimage_emit_section_config() { # default node is selected based on dtb ID if it is present, # otherwise its selected based on kernel ID if [ -n "$dtb_image" ]; then - # Select default node as user specified dtb when - # multiple dtb exists. - if [ -n "$default_dtb_image" ]; then - default_line="default = \"${FIT_CONF_PREFIX}$default_dtb_image\";" - else - default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";" - fi + # Select default node as user specified dtb when + # multiple dtb exists. + if [ -n "$default_dtb_image" ]; then + default_line="default = \"${FIT_CONF_PREFIX}$default_dtb_image\";" + else + default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";" + fi else default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";" fi @@ -605,9 +605,9 @@ 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 # Set the default dtb image if it exists in the devicetree. @@ -715,8 +715,8 @@ fitimage_assemble() { # kernel-fitimage.bbclass currently only supports a single kernel (no less or # more) to be added to the FIT image along with 0 or more device trees and # 0 or 1 ramdisk. - # It is also possible to include an initramfs bundle (kernel and rootfs in one binary) - # When the initramfs bundle is used ramdisk is disabled. + # It is also possible to include an initramfs bundle (kernel and rootfs in one binary) + # When the initramfs bundle is used ramdisk is disabled. # If a device tree is to be part of the FIT image, then select # the default configuration to be used is based on the dtbcount. If there is # no dtb present than select the default configuation to be based on From patchwork Mon Jul 15 14:10: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: 46367 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 C025CC3DA62 for ; Mon, 15 Jul 2024 14:15:18 +0000 (UTC) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.groups.io with SMTP id smtpd.web10.39145.1721052910387268424 for ; Mon, 15 Jul 2024 07:15:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IkqZMwh8; spf=pass (domain: gmail.com, ip: 209.85.221.52, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-36798e62aeeso2798647f8f.1 for ; Mon, 15 Jul 2024 07:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721052908; x=1721657708; 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=gSBLp7VN22y80e2mPRJVwQknmbERTBUNCXzQHsuhsmw=; b=IkqZMwh8TKG3Rpm1YTafCwklOlEYKpauAFAPnwXl4AIXCx/k3wbZGHHu+PkEmXDUa2 S6ATZliGBrheXPMSxw1j9sZr3lN+KToOIPuwxj9XqMWXtMcKCn8hS6h38ak4GfrNoftH VmeSvutsng1/2CwKze3OC720nXeWCmRI1xy0URgl8tNgBEyom/+yf9OxUTkPLL2D0/v/ lTv78/gcKABoUDakJ+961Pgp0/gJf+73u93m8IC594sR6RuoKZgZBKxh1g8ECevdyCI9 fbc84Vl6VIZYrM9PdMlcu5rBwo0/tva9fA/sX5e03gwZHPt7Rp5onPAoquia3J9ph3y4 G6sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721052908; x=1721657708; 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=gSBLp7VN22y80e2mPRJVwQknmbERTBUNCXzQHsuhsmw=; b=XsuuvypDGaU/Ar8K2UtIWMWo2PK53Qy2zl1Xu7wQXEVeFEu4JK6c6gAq4PPZKTdbqy WlGs564xXvDlVQejeS9qmNmnCtRuTMrM14KLM9QH+Q/ryYoU70Fci2IGpHMMCd9BBJN6 jQqLFkx0Z/JS/qK4KyhSzTDVH1RPn3XEBnI9nrMTLljiNV0CtNhSspwjq+65hUpgWElw WfjcDz3QgnIx0pOTF1yTgp1OFLWap67yDQKPq+ea/EQ0QpVllg/JAO0nXZngmLCG1HZN VvynFW2aOdyO2pDVtDOIiSgbLVZvzsznWSkv3ZpYs/arSFzAsejBQPvqz4LYCWeC9YKJ Br6A== X-Gm-Message-State: AOJu0YwD2YWhSbbwRT0eu/CalnI5r5fTqiFcodhE73KjfwacN/g3Sd3i EVG0Pv3aQCwzMTPiRaU/QwU1ytvGRThhqOyOhtSvplmX8ZnK0AbGVqUQPg== X-Google-Smtp-Source: AGHT+IE3AhztBqIdRKfxi3+KQYOvARfhRaIrb3DZzgGxzWR1uRmxngRMDFkgU8JfhDH+JIbd2VawwQ== X-Received: by 2002:a05:6000:1888:b0:367:8fee:443b with SMTP id ffacd0b85a97d-367cea96744mr16920969f8f.41.1721052908116; Mon, 15 Jul 2024 07:15:08 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680daccbddsm6499074f8f.64.2024.07.15.07.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 07:15:07 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 2/6] kernel-fitimage: fix external dtb check Date: Mon, 15 Jul 2024 16:10:39 +0200 Message-ID: <20240715141448.2158477-3-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715141448.2158477-1-adrian.freihofer@gmail.com> References: <20240715141448.2158477-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 ; Mon, 15 Jul 2024 14:15:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201928 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 ce52297aec3..67c98adb232 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" ] || [ -L "$dtb_path" ]; then compat=$(fdtget -t s "$dtb_path" / compatible | sed 's/ /", "/g') if [ -n "$compat" ]; then compatible_line="compatible = \"$compat\";" From patchwork Mon Jul 15 14:10: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: 46370 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 C6F51C3DA63 for ; Mon, 15 Jul 2024 14:15:18 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.groups.io with SMTP id smtpd.web11.38953.1721052910555333495 for ; Mon, 15 Jul 2024 07:15:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NatWjXEx; spf=pass (domain: gmail.com, ip: 209.85.221.46, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-367a3d1a378so3924808f8f.1 for ; Mon, 15 Jul 2024 07:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721052909; x=1721657709; 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=hGefg8w4IbAc+E6hYrQxSik/7W1Mw21dGCSfSNyKWVs=; b=NatWjXEx6q2EC0SZz/lt5CU2N6NPj86wfkyc0AqYgVT481STOPf32o+VM40ow00pgu OO+5ffgjaoLUJQJjR8Sw54b2Z77/fqUgZ9hgQghpFZ2Bwa/DJ0p6fCYnIhzwA1NzEfAy Jdv5JrqOxe6utIXssalxApOVAXiPWHowq8mvIL4Grh5ddjUicvQzHu+dhyOzotkldlOK oK+s67AVd1EgCVysuuh3HCsOKOIGlEgiv9CesZKNHUmDICZt8j0ZmYKpdHt0lU0udQG0 WNXNzatBxmWpmCT6A50zhQfRYZv6F6cDuTwLPHOslF8qAbQVAHj3KX7yKsELhiEBU6Lz XRlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721052909; x=1721657709; 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=hGefg8w4IbAc+E6hYrQxSik/7W1Mw21dGCSfSNyKWVs=; b=sSANOuWMpFlLarxuk2OxJj9d9Ajtw6s0Caz+9jNeLPIiE8oEmyXlbyrxNW+Zp4NocJ lrNYTCZVrU+uBbl6xTxxTzmjqC7G+ikI1pxNFEsxMMwoj0NpWL/ubmKERel3bSFLNGBA 2J56q4YwDH7ZcpretPiDonVUXEkBgtuAKWOtbYIhA4kSxlnBXy1HI8hZO5+uMo+AZBjX Ub2JgItnpP8iNQdnkQJo8BvUMWdLpcnVyL7/P66avjOnqjG4NZnnmdglgF5fME2td00n UB6I5w1VLo3TYAPYv52j/Q4qzYKbUpRth4lJo19NMNF9rxMCN4Lx0DHbA9Z/tyWaQ0a4 ob9A== X-Gm-Message-State: AOJu0Yyw3qA3ahShr79WX2F0KpBwrlIWrD13zQif9rBvTkI/ZjMwarI0 y8tJyjDrQQCFINFmXM/D+3xPWpSQVewO/p7kAlx7Bl5s/OOU82ADH1lTIg== X-Google-Smtp-Source: AGHT+IFEXTclvCpCmV7374tAlUS7x2572xEFkoYEDE17w1lNKzq56XbVA2/g+r4K387fr3fIl001Ng== X-Received: by 2002:adf:e683:0:b0:367:8fc3:a25f with SMTP id ffacd0b85a97d-367cea96453mr15555027f8f.37.1721052908708; Mon, 15 Jul 2024 07:15:08 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680daccbddsm6499074f8f.64.2024.07.15.07.15.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 07:15:08 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 3/6] kernel: refactor linux compression Date: Mon, 15 Jul 2024 16:10:40 +0200 Message-ID: <20240715141448.2158477-4-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715141448.2158477-1-adrian.freihofer@gmail.com> References: <20240715141448.2158477-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 ; Mon, 15 Jul 2024 14:15:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201929 From: Adrian Freihofer This is a step to avoid unecessary kernel rebuilds when the initramfs changes but not the kernel itself. In case of an unbundled fitImage the kernel should be staged in the sstate instead of re-compiled. The uboot_prep_kimage function generates the kernel binary which gets included into the fitImage. It also defines the variable linux_comp which is used by the fitimage_assemble function later on. To make the fitimage_assemble function working with kernel binaries from sstate it must be decoupled from calling uboot_prep_kimage in ${B} by: - refactoring uboot_prep_kimage to write the result into files (linux.bin, linux.comp). - calling the uboot_prep_kimage before the artifacts are used or cached. - refactoring the fitimage_assemble function to use files rather than calling the uboot_prep_kimage function which depends on ${B}. Signed-off-by: Adrian Freihofer --- meta/classes-recipe/kernel-fitimage.bbclass | 5 ++--- meta/classes-recipe/kernel-uboot.bbclass | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 67c98adb232..02b5fd8e3f5 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -579,9 +579,7 @@ fitimage_assemble() { # Step 1: Prepare a kernel image section. # 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 linux.bin "$(cat linux.comp)" # # Step 2: Prepare a DTB image section @@ -764,6 +762,7 @@ fitimage_assemble() { do_assemble_fitimage() { if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then cd ${B} + uboot_prep_kimage fitimage_assemble fit-image.its fitImage-none "" if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then ln -sf fitImage-none ${B}/${KERNEL_OUTPUT_DIR}/fitImage diff --git a/meta/classes-recipe/kernel-uboot.bbclass b/meta/classes-recipe/kernel-uboot.bbclass index 30a85ccc287..50be7962d46 100644 --- a/meta/classes-recipe/kernel-uboot.bbclass +++ b/meta/classes-recipe/kernel-uboot.bbclass @@ -45,5 +45,6 @@ uboot_prep_kimage() { mv -f "linux.bin${linux_suffix}" linux.bin fi + [ -n "${vmlinux_path}" ] && echo "${linux_comp}" > linux.comp echo "${linux_comp}" } From patchwork Mon Jul 15 14:10: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: 46366 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 9D621C3DA60 for ; Mon, 15 Jul 2024 14:15:18 +0000 (UTC) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.groups.io with SMTP id smtpd.web10.39146.1721052911490420730 for ; Mon, 15 Jul 2024 07:15:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mPAe+Ma3; spf=pass (domain: gmail.com, ip: 209.85.128.41, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4265b7514fcso31299615e9.1 for ; Mon, 15 Jul 2024 07:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721052910; x=1721657710; 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=TKbRF475+i8njE7lfi7doo/9sY0h6c1exqIwosZbr+g=; b=mPAe+Ma3tvClEtNYoobIC864RUukFHDvxpc5sE79UJvlVNMKIcmBlc28iJu0i2AXuU juGN9kGkpENhE3a46tuLX5adhuqRLVxCj4Xyq31tzAY6MNdxoydbdv22wD0thB71jTB6 FV2JdRbktZpKf8tk2g1anWQ9rn12FQVUyRkn4HJCsiI/7oo64JL7Mxok0KfzNI1ctpBz 75QOjU+ZKxL4aF2LNVbjhvzsKJvl9HNU+DW2l1Zg98K2S1Brmt5dMykDKeU4gi/OGbff 03LnlwBOjbDO6S8NNG+3JtYYsfspcioaKu0EdAKs9v6ltM8odyixMXYGOuRk0Va47Ko+ DOQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721052910; x=1721657710; 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=TKbRF475+i8njE7lfi7doo/9sY0h6c1exqIwosZbr+g=; b=EED55feqvSx9p6G4np1itjb1+LhnUSLslV313jnhWLEJsk6ez51eFaf003qnHdmmuU UYR2rjDaX1l4fndRP73mjL2MKCwId8nfCyDRKQPP+zEcWIDBa7A/9Gw9jHfE9ZH5svPG A4lrdDMPVY9Ruho2ecouIbaXekZIkn9rF3PtxxD+eZanbwTpSNVb6OFY4BbbdzQ3/GiN x/Pg5QeualxFN3VCPKvTHSMKQ89QqtWCVASxWzoo6uptdZy0JpyPyMZmTZjXym++mxaT xg7M98KTVt8gL10guvsfqSuE2GpQHKyO8ZGErokT+ze6N5H/ra57+HLkQDDKLS8QZW8I mUVw== X-Gm-Message-State: AOJu0YxxQnvCHrlN7r21YxQENpofBkor6Z4qTt4xJe2twKyMHXUWrBu/ ZGCub326YwdSSmEGoK5yWa4tbWe+gL90DPAZa3TlYgalConXxdmzrSCSVA== X-Google-Smtp-Source: AGHT+IFfuNPxONNQnVQ61KgA6fVsrFNlo7dsQJAnhnW3NtYpJq2IAiYSU3/VJm0vqZrQrDUKrNKE5Q== X-Received: by 2002:a5d:480c:0:b0:362:ff95:5697 with SMTP id ffacd0b85a97d-367ff70cc30mr7169187f8f.28.1721052909600; Mon, 15 Jul 2024 07:15:09 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680daccbddsm6499074f8f.64.2024.07.15.07.15.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 07:15:09 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 4/6] kernel-fitimage: refactor fitimage_assemble Date: Mon, 15 Jul 2024 16:10:41 +0200 Message-ID: <20240715141448.2158477-5-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715141448.2158477-1-adrian.freihofer@gmail.com> References: <20240715141448.2158477-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 ; Mon, 15 Jul 2024 14:15:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201930 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. Signed-off-by: Adrian Freihofer --- meta/classes-recipe/kernel-fitimage.bbclass | 32 +++++++++++++++------ 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 02b5fd8e3f5..705b3ab657f 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -169,8 +169,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 @@ -567,7 +568,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." @@ -608,6 +609,17 @@ fitimage_assemble() { 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. if [ "${FIT_CONF_DEFAULT_DTB}" = "$DTB" ];then default_dtb_image=$(echo "$DTB" | tr '/' '_') @@ -658,9 +670,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 @@ -669,9 +680,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 # @@ -744,8 +760,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 @@ -754,7 +770,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 } @@ -763,7 +779,7 @@ do_assemble_fitimage() { if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then cd ${B} uboot_prep_kimage - 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 fi From patchwork Mon Jul 15 14:10: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: 46365 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 9D85FC3DA61 for ; Mon, 15 Jul 2024 14:15:18 +0000 (UTC) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.groups.io with SMTP id smtpd.web11.38955.1721052912469732292 for ; Mon, 15 Jul 2024 07:15:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AFET894V; spf=pass (domain: gmail.com, ip: 209.85.128.49, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4266f535e82so29279805e9.1 for ; Mon, 15 Jul 2024 07:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721052910; x=1721657710; 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=kD/aYAryd6/wqUT21FIB3IeIMdHmrv4D3N1V3rHL7kM=; b=AFET894VbfO96jBoDVZKYjKBeX6NMTqeqSYJVszLzBhpMkX7hOs+ACrGj9m9UhaviD ymFRu7aXI8rtU9izY/6jomk9L+MMnuRQJCF/bZanD8SmklOFgF7aHNd2ols0uTtu0IWB Wb1s/oomk3FPFolkV8ALLSt/or0mvYBCogM/IibsTyqCMacbO/PETHwy8MRtShU8DiCv 88hiLZPBeve74eoqS0lH6sCoQ08Jw7+o/J2gzPujS+wyjJWiSy711k//00r+ectTYGNF eyI0s5eDZBbTJ5l/gPf4GQPOj4Ng2nPLJQr9fl0WJCgCGddFgFhvas2o47+QHgh5Cu+X jXNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721052910; x=1721657710; 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=kD/aYAryd6/wqUT21FIB3IeIMdHmrv4D3N1V3rHL7kM=; b=g/BlObNwlbmtpwLZV7nddiTRSJw46RC9CNasvwh0XWM4OLk2zU9T4rwz20qagrQ8It okQdbIWA2v50L8MkJcwsaMniOZ6KDWiR1+Ki6SMJu4yH6ijLsu2ZRAxmntXOr4yhRT+c eCPO60bUAdlo2Cnm8Wzey87B/pclEBuYVrAN5nDfZTryNK7WwfhQA4yNZHskzIIvBe0j W2pqMp4MC/U/Wa84dxJUTxeIX/if9yaG+ru1kIQv+Q2DIqoDKxCrjHjZLNiMRIkK2wEo WuMZfqyemTM3J1I4qR32bhuJmAh3QacwDTmto91n6JiUHDiUfzlwoyz4OJUJieLK5pSh HQEg== X-Gm-Message-State: AOJu0YzxgaGWd3R/Yir9ldZmNI6ytqWiIXCi7W+tVPgwaOuToac+sfKw YpxKlvanFcIWVdkffcF4yLpBz5cn/wMPMNsWf/65rg0F+wQPO+YDyzJkgA== X-Google-Smtp-Source: AGHT+IHdzTkFFiWN66HxM7hVaYvermvX2isdDfXgh/uaFYSog/JNDiSIhzY19AYAe3jNsOrXQSI/Hg== X-Received: by 2002:a05:600c:48a7:b0:425:7bbf:fd07 with SMTP id 5b1f17b1804b1-426707cea0bmr121285305e9.5.1721052910439; Mon, 15 Jul 2024 07:15:10 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680daccbddsm6499074f8f.64.2024.07.15.07.15.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 07:15:09 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 5/6] kernel: refactor fitimage Date: Mon, 15 Jul 2024 16:10:42 +0200 Message-ID: <20240715141448.2158477-6-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715141448.2158477-1-adrian.freihofer@gmail.com> References: <20240715141448.2158477-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 ; Mon, 15 Jul 2024 14:15:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201931 From: Adrian Freihofer * do_bundle_initramfs only when needed 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. * If KERNEL_IMAGETYPES does not contain fitImage and INITRAMFS_IMAGE is not set, the do_assemble_fitimage_initramfs ends up as an empty task. Add the do_assemble_fitimage_initramfs only if a fitImage with initramfs needs to be built. * cd in bitbake task is easy to break e.g. by bbappend. Replace the cd by defining the task's dirs variable flag. * Add 3 comments which are helpful for the next commits. * Since the tasks and task dependencies are anyway created by an anonymous function, align and make the DEPENDS code more specific too. This refactoring is not very valuable on its own. But it simplifies the task dependencies which is helpful for the next commit. Signed-off-by: Adrian Freihofer --- meta/classes-recipe/kernel-fitimage.bbclass | 57 ++++++++++++--------- meta/classes-recipe/kernel.bbclass | 28 ++++++---- 2 files changed, 50 insertions(+), 35 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 705b3ab657f..2dda5aec056 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -26,20 +26,8 @@ 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'))) - - 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') @@ -48,8 +36,31 @@ python __anonymous () { 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") + + 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'))) + + # mkimage and dtc are required by the fitimage_assemble function + d.appendVarFlag('do_assemble_fitimage', 'depends', + ' u-boot-tools-native:do_populate_sysroot dtc-native:do_populate_sysroot') + + 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) + else: + bb.build.addtask('do_assemble_fitimage_initramfs', 'do_deploy', 'do_install', d) + + d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', + ' u-boot-tools-native:do_populate_sysroot dtc-native:do_populate_sysroot ${INITRAMFS_IMAGE}:do_image_complete') + if providerdtb: + d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' virtual/dtb:do_populate_sysroot') } @@ -797,19 +808,14 @@ do_install:append() { } do_assemble_fitimage_initramfs() { - if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \ - 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 - else - fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1 - fi + 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 } - -addtask assemble_fitimage_initramfs before do_deploy after do_bundle_initramfs +do_assemble_fitimage_initramfs[dirs] = "${B}" do_kernel_generate_rsa_keys() { if [ "${UBOOT_SIGN_ENABLE}" = "0" ] && [ "${FIT_GENERATE_KEYS}" = "1" ]; then @@ -864,6 +870,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 @@ -878,12 +885,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}" diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index 89badd90f18..6a8c3c25c07 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -136,18 +136,24 @@ fi set -e """ % (type, type, type)) - 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: - if d.getVar('INITRAMFS_MULTICONFIG'): - d.appendVarFlag('do_bundle_initramfs', 'mcdepends', ' mc::${INITRAMFS_MULTICONFIG}:${INITRAMFS_IMAGE}:do_image_complete') + # If the INTIRAMFS_IMAGE is set but the INITRAMFS_IMAGE_BUNDLE is set to 0, + # the do_bundle_initramfs is not needed, but the INITRAMFS_IMAGE is built + # standalone for use by wic and other tools. + def add_initramfs_dep_task(initramfs_dep_task, d): + if d.getVar('INITRAMFS_MULTICONFIG'): + d.appendVarFlag(initramfs_dep_task, 'mcdepends', ' mc::${INITRAMFS_MULTICONFIG}:${INITRAMFS_IMAGE}:do_image_complete') + else: + d.appendVarFlag(initramfs_dep_task, 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') + + if bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')): + bb.build.addtask('do_bundle_initramfs', 'do_deploy', 'do_install', d) + add_initramfs_dep_task('do_bundle_initramfs', d) + bb.build.addtask('do_transform_bundled_initramfs', 'do_deploy', 'do_bundle_initramfs', d) 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) + add_initramfs_dep_task('do_deploy', d) + 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 +333,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 +355,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 Mon Jul 15 14:10: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: 46368 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 7994FC41513 for ; Mon, 15 Jul 2024 14:15:18 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.groups.io with SMTP id smtpd.web10.39147.1721052913220723811 for ; Mon, 15 Jul 2024 07:15:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ew2vIY9c; spf=pass (domain: gmail.com, ip: 209.85.221.51, mailfrom: adrian.freihofer@gmail.com) Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-367b6e5ffbfso2458297f8f.0 for ; Mon, 15 Jul 2024 07:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721052911; x=1721657711; 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=F+7gHmybsY8jlXqMhw27Zxa1l8YpnHBrRMYcsfzD6sc=; b=Ew2vIY9c6kSGjKEraZZyQi/6Ztm57O/nnbGPwBRS84BxfL1cO1yEMoTEap5AwoM0N9 2D+rfXICjTl13w2n6Qc5kQ8NOfbJdteyVrP8KAQdoMpL/pM00RemllqD6QA2JnF2SJ6R UKsitgGSZXAZqGd8Rcnk6z2K+wu+F+kz/Z1XUyuyXxwtfI4mcrpDJdPOo5IF0B52SL9Y /n1NsHRUOjefx95Rl0K+mWngU5VLnz1Np9Fhh3uY7l1So6pdfNxTebYiKCtzgXek679h k158gPKG+FsNDJbWX1t+G7ER90tEWO7fhGFeS/vKTknLhJt6L5rx25UShXV/coHbzZTd RqOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721052911; x=1721657711; 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=F+7gHmybsY8jlXqMhw27Zxa1l8YpnHBrRMYcsfzD6sc=; b=CJh2P6m0eqZpX/EC8NkuxoqBLT1yp79bP/wV6ZXYH91wCUjoUVlbRAVPuEzawutabl 3C6B2+jnEBko+wN0NfUrqyBnYZq8aPPOZvkeFAiTwtDptA8iuLyCB2weR7LTHFEJzuup jPNUh6FYR7AxIch15NS/0GR+NPQBUYpXiE7ao++ESOyGT0lKqcKOw71hNf1x1RrtgtV5 nfCQzFbguxS+2OJYjVziR7wIZRf2oHBlhUBj49iFNdi6Ozr+KWfUmZKLdDfVMUjFMAAZ Wo3u9zK/GlW0r14esiqLvATyG0+K0QSxFOLST+TS92TYH1DOMwoXGZmbs+D3rYC+kSsK xn1w== X-Gm-Message-State: AOJu0YzsPldIzyDMjr4bDVpRh5qgYKdZPOhU20OP6ZUjdhWz+HItLy2F NxS4e0o7XxMU/HFh4ruvpBuYbML5y4wXzJKG/xX3dygfC+0i8hVjstvajQ== X-Google-Smtp-Source: AGHT+IHjvWpulWw9vhmMcB9bgF4ok/daNX6UtK0+RwCk6yRbMnjRKz9wZl4WD5DQiBJylm4M/thJMg== X-Received: by 2002:a5d:6da6:0:b0:367:94a7:12c8 with SMTP id ffacd0b85a97d-367cea46deamr15804210f8f.6.1721052911064; Mon, 15 Jul 2024 07:15:11 -0700 (PDT) Received: from wsadrian16.fritz.box ([2a02:169:59a6:0:55c4:f628:91f3:4287]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680daccbddsm6499074f8f.64.2024.07.15.07.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 07:15:10 -0700 (PDT) From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 6/6] kernel-fitimage: run unbundled fitimage after deploy Date: Mon, 15 Jul 2024 16:10:43 +0200 Message-ID: <20240715141448.2158477-7-adrian.freihofer@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715141448.2158477-1-adrian.freihofer@gmail.com> References: <20240715141448.2158477-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 ; Mon, 15 Jul 2024 14:15:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201932 From: Adrian Freihofer Without this change, the kernel is always rebuilt if something changes in the initramfs. 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. For this cases nothing changes. 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. These artifacts are all available in the deploy folder which is also sstate cached. Therefore do_assemble_fitimage_initramfs gets split into two tasks: - do_assemble_fitimage_initramfs creates the bundled fitImage which runs before do_deploy_image. This is without sstate and therefore the do_deploy_image 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_image. It uses the linux.bin artifact from do_deploy_image to create the fitImage with initramfs. This task is done with SSTATE_SKIP_CREATION, because this also works with the eSDK installer (oe-selftest -r esdk is successful). It is also more effective to quickly create the fit image instead of handling it via sstate. Unfortunately, this change is not 100% backward 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. The assignment of the KERNEL_DEPLOY_DEPEND is improved to handle this appropriately. Signed-off-by: Adrian Freihofer --- meta/classes-recipe/image.bbclass | 12 ++- meta/classes-recipe/kernel-fitimage.bbclass | 84 +++++++++++++-------- meta/classes-recipe/kernel.bbclass | 3 +- 3 files changed, 66 insertions(+), 33 deletions(-) diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass index 32bafcdbbc3..f5754fb6fd9 100644 --- a/meta/classes-recipe/image.bbclass +++ b/meta/classes-recipe/image.bbclass @@ -147,7 +147,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}" diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 2dda5aec056..f42a0cabeb3 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -49,18 +49,28 @@ python __anonymous () { d.appendVarFlag('do_assemble_fitimage', 'depends', ' u-boot-tools-native:do_populate_sysroot dtc-native:do_populate_sysroot') + # 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) + fit_assemble_task = 'do_assemble_fitimage_initramfs' + bb.build.addtask(fit_assemble_task, 'do_deploy', 'do_bundle_initramfs', d) else: - bb.build.addtask('do_assemble_fitimage_initramfs', 'do_deploy', 'do_install', d) + fit_assemble_task = 'do_deploy_fitimage_unbundled' + bb.build.addtask(fit_assemble_task, 'do_build', 'do_deploy', d) + bb.build.addtask(fit_assemble_task + '_setscene', '', '', d) + d.appendVar('SSTATETASKS', fit_assemble_task) - d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', + d.appendVarFlag(fit_assemble_task, 'depends', ' u-boot-tools-native:do_populate_sysroot dtc-native:do_populate_sysroot ${INITRAMFS_IMAGE}:do_image_complete') if providerdtb: - d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' virtual/dtb:do_populate_sysroot') + d.appendVarFlag(fit_assemble_task, 'depends', ' virtual/dtb:do_populate_sysroot') } @@ -808,15 +818,30 @@ do_install:append() { } do_assemble_fitimage_initramfs() { - 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 + 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 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." @@ -868,9 +893,24 @@ 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 and linux.comp file for do_deploy_fitimage_unbundled..." + uboot_prep_kimage + install -m 0644 ${B}/linux.bin $deployDir/linux.bin + install -m 0644 ${B}/linux.comp $deployDir/linux.comp + 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 @@ -883,23 +923,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 6a8c3c25c07..848f4e5e431 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -488,7 +488,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