From patchwork Fri Oct 21 23:37:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 14321 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 26C2DFA3742 for ; Fri, 21 Oct 2022 23:38:01 +0000 (UTC) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.78]) by mx.groups.io with SMTP id smtpd.web10.1487.1666395471881117197 for ; Fri, 21 Oct 2022 16:37:54 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@seco.com header.s=selector1 header.b=ddH372pr; spf=pass (domain: seco.com, ip: 40.107.6.78, mailfrom: sean.anderson@seco.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FyWelQpsc1oE2afk1ZUjPCWvAR/Ra3B5d/EHcdqjv+Q6vKnEsUH8f0ShJd7oKiNQMuG+GapK1sHokqCu2mZ9MsLlsdI2bOlzDMvLGCPSBy6z/qoXSQq/xO6kK61vfnFVemVok7VYK5ZjnPz9QpZHFn8TTuzW7Wbmj62RrQkYRFFXBB8BJdi7pAX59I/cZwrDbGfQMoM5foGL/xjJ09lDLHIepMpnLZ9m89/MytghSX9grbxqLM8sarrMyntajVRmQhWYgDcv86DTbK3GlHCRL73rhZsVHRlqMIxRG940isOEzEfj1XkK4Tx9L4cMfaFvKW0hf2z6C81e+JinK/YqFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=f5+D02N7r7bF6CjDW4Mx2POl/H70s6siQWazSY94HWg=; b=mc59m/ixWpyNOfZV+3tewiiSeZ+zCf1sN1g5HzOvTKNsjPbztCAefjn4zjWzG6DeXLc0JDsE20Rqb7j0Hr18srdTNooJv72yv0t+qIpcLm+syxj6cQGxyUB1fap7h9CVoV+WQepmRP65XKrSaTMgI1BpWOlG0whQwPYCR/R5iJ4v0qI7tbxFNO//8zXpp9SUktIHi7xL++0r2QxudNT8w6uWDA3gNRYe1Jjk5y3K6jwCrjW7wKKa1p3NDXAo/sZ7mJp/NhdZ3AmJkC44FwJIrSGtHvnwi+kqm2Gz+WFrMv+tIP45kn66a1oziJU0fTQEXOTW62jEvZ0qQAFPHdTj/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f5+D02N7r7bF6CjDW4Mx2POl/H70s6siQWazSY94HWg=; b=ddH372prW7Owped9yw2XK1DxGgwDCA24bh+tpE92kj/Ffn8XTHiLURUbYZppqIYoYURgCCWJC15XTO/bVbU8c8SZRtDtQt94pwjeLZx5s5sPEe0zT4+V5kNrEiOhXq4zUo6F281BkV+9gLgYEZCOOGw3lX7AzGQ+wMGIqzDx8g0lEgDMXjJ04LsQVwBIjZDGHFGlzHEV5vLKcOPbcdBtTQTGY27+85AbC4PxQyEWZPQiyTPZq/AtW/Q6MDRJIVCv+Y72m8ga+jSD1cCI6wL1T8E3LXED8GBojmzO0vdAsffnhRPN8QQSSr8y3AkU65p5F0ZRN0LMwsVZh3KzEPehFg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by VI1PR0301MB6656.eurprd03.prod.outlook.com (2603:10a6:800:17f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Fri, 21 Oct 2022 23:37:47 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d%6]) with mapi id 15.20.5723.034; Fri, 21 Oct 2022 23:37:47 +0000 From: Sean Anderson To: Alexandre Belloni , Richard Purdie , openembedded-core@lists.openembedded.org CC: Luca Ceresoli , Klaus Heinrich Kiwi , Sean Anderson Subject: [PATCH 1/6] uboot-sign: Fix using wrong KEY_REQ_ARGS Date: Fri, 21 Oct 2022 19:37:21 -0400 Message-ID: <20221021233726.1751124-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221021233726.1751124-1-sean.anderson@seco.com> References: <20221021233726.1751124-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0012.namprd11.prod.outlook.com (2603:10b6:208:23b::17) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|VI1PR0301MB6656:EE_ X-MS-Office365-Filtering-Correlation-Id: fee44d69-c879-40da-b60f-08dab3bd428b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bfpwZEr2AIBn5F57CdhtUd7QG/Aahbj7nKnRaSbI4xe4yXuJuCcm+Wu4XARqLLJY8PXp0T8Dz0jKpd7MQ5uh8Yh9W3ZqNDFMF7pnpbEM+OUaSYiNVNyQHWodLNS2Nb/Y0khhSoya6UKmSIazkUsDISYgZsYL6PfyJpRagmC/r/l/eUZb5DRE5x4yHlAveQ/mVMSTc8o4SmQZhQ7TGmzv2jnincbc5p11gpUIGRbeDRVSkm/2DFT5LY4FNaJftUOPUpYUhhnoICvJmvcELVRKk9+meRIuaYZ9JFdiMaZUXMlDN70hgcc9n0iP+r2N0aAocjCiuQKkub+YZmz27zh4XC94wi5QJ60ShhNfK0gkDHXlGw4hr1W2cWtHluPv8k28GF99herdS076fTkv529DFwA/dDVPQ6dpbbURCGT3qzVB4duTe3TXe9ji0471Eh9yrXSJ3ArUBrbzqruOmWYezQIUsp5S08cgoEKYMxMVRbWq7sXFPTBkRQC5lcN5fkHhF5ugTQz+DB7veUZpYeojGOJ2RqPzQta6xWu6BP3U5TkJ1K4oSten1U9SBScXZMgvyF7hEsN/Z1mwWicKiFxdz4+zilyuLKX2wkzi487DIg4bJ7DxCXcnCL2L/CHTJiVYHD00xM0vJp4WQ7QO5JICa83dj1pf/8jnxMQi5xbwsjFkJFBfFpU36EvPETKYg6/7Udujs6qUWCIEo+4RCDRFxiRySayEbKYuOrk16jgRbfM5EGMB2nqd/Xt4LlXVAbD8PU8Gc+B4KgEDUQ3enNVTeQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(39840400004)(136003)(346002)(376002)(396003)(451199015)(478600001)(83380400001)(86362001)(6486002)(4326008)(8676002)(66476007)(66556008)(66946007)(54906003)(316002)(107886003)(6666004)(52116002)(36756003)(6506007)(8936002)(5660300002)(6512007)(41300700001)(26005)(110136005)(38350700002)(38100700002)(1076003)(186003)(2616005)(44832011)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sq6OVeh4dA9mwSY6kJJg2QV3WtbkyrIdAmvZZFJqxCXpFb8udJDcZdzg6VdMxwzuQLp5smHxuTX0XGEbbgpLzVGYjhn5q2gB30DVSUj07eHLLfxonk6AfJuD+Gyz7XGik7YMbhJu5xBEVdYD+34UkIohX9Fapk99iOd7eiA8xg8qv0nwQaoT5FSmKhi42zIItLccm17eudwTzAWzrL6NaFuTCaT4t6TX0j03z2w7guslEN6USuDaDkKAxPYu5VAlVenuHVXyyy/p6pIerJrYBK+KvXKduXH3EPrl9ORQC77aKXnkJxsGOnr2itbBZ/riPq40CUgoREVTASlWFtOzRaBviKW97ooXZE5yU53I+wzMSEhuJ6Ze8IwpQls8Dp+vfPvsu98lGoa0V7a1tmWMDHz44mytTVQb0ukbUY1GHwW86CRMhTw0nAGKwGeqjQgOLITt/fSXJHdtaUUynLnWYlhoehSj78hhlK2Fup3ZUXiHLPG6FQt1syKyfDXNs1X1V4HR9z5+TgyVZj0p/OCaUz3g6wCmLTq/JEbPa4LW/MmNTx2thm8BhFsGt2Hz573H4ZWkg4LCwFqwjUVPdHsEOiqwrWuesWNvop3Nr9K7HjZnXzBbOEzJWVWEyrpHZ31mUrvCK5GaywaP0ZkGddkvuO2oY1NWQWPuUQgbPClV5eou4ewF1KiynHOoGPQ3c9NdewzKkhs3q7zMMoeY3X0tYDja79OPsuS7mg37FG6cXG2OzAlQ7F2xCQdWVabIjm1zSMKkNu192fLySTfOG2sDd5SyABBib8CW72eWmqG7y2tOzM0wOkE96506OPVdVCMy+8ivHhTC16M5w3BENtfNdWBqxFpKt7ZF5dGSibR945gnRfoL008MFvFYZeeesjFyR+Q94TjWbzgn7jROYuZpfJl1CwziGvwmJlXh0qz9I0RlS9iw0Pmb0ckKx6VO/hhFk5uC/cGdlr5wfjm8WG+yieRyTzjc2I9GX6HB6QXn2M/pzNdH+s6ssdDEaVT5wpO3/xOVSbT5ODMRXMod2iGQ/se2Z5O7hNcE3i18O1BPHFbKxGI8IAl2mhwiNFpDP8pLlqQNuWFLWZLYleR/QUXzQEFbJwvelS/KBdy9V11wuTnwvcssSFl4F1Y8cOlKlkL/C5ASO3dKors/qkFn6p9Vz9sqLM/bVb7HWVVdo7/k0nQ3glnw6vIa4VPH+VMia7CFugsKK3haFYCeNAjYIAPx9OoKOiQ7escyoywBPXxmS1kBCyD0e87Ki0J+zpE9cQboankHRpFqyImAmMm8jMu6kn30I2eACPzsb5NprQOx4JJTAYZa3xVPnVv9jT0yDG4bOYy3vndsVPICT7dD0bbaVQEj0Nr87RM749pZQ3G97YbQVXAt6JgUhcvWt/coa0N6Ypnq24S39Mtl7GqfU8xNJM80vKoliUYVXJPUsl4AqofBcTAz3c2E85wsHAbc/vuPZ4Vj7/UpzDOCaRZJfIHVnrYsbYSX+nTjhhciuKMlcTHgm3TkElwVMV42g/IaUiPgZMEQfAFj3dyST+hjI/qNdsOY1PECUaEpiFw8/gRnIqRcugR1WnAp19pM0r0Sx7qdu1tZWBQGgDknE95AQyYfGg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: fee44d69-c879-40da-b60f-08dab3bd428b X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 23:37:47.6270 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2QbU1z4F6Wq8SgpvDA5d0YpTlV3U2eK7BoPTNhTr7h1o/sGNwA71S2QbFfKsdGuDx2iL1DPm7MdD9VRn/G73sw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB6656 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 ; Fri, 21 Oct 2022 23:38:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/172050 When generating our SPL-verifying certificate, we use FIT_KEY_REQ_ARGS, which is intended for the U-Boot-verifying certificate. Instead, use UBOOT_FIT_KEY_REQ_ARGS. Fixes: 0e6b0fefa0 ("u-boot: Use a different Key for SPL signing") Signed-off-by: Sean Anderson --- meta/classes-recipe/uboot-sign.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass index debbf23ec6..4b5912a01d 100644 --- a/meta/classes-recipe/uboot-sign.bbclass +++ b/meta/classes-recipe/uboot-sign.bbclass @@ -298,7 +298,7 @@ do_uboot_generate_rsa_keys() { "${UBOOT_FIT_SIGN_NUMBITS}" echo "Generating certificate for signing U-Boot fitImage" - openssl req ${FIT_KEY_REQ_ARGS} "${UBOOT_FIT_KEY_SIGN_PKCS}" \ + openssl req ${UBOOT_FIT_KEY_REQ_ARGS} "${UBOOT_FIT_KEY_SIGN_PKCS}" \ -key "${SPL_SIGN_KEYDIR}/${SPL_SIGN_KEYNAME}".key \ -out "${SPL_SIGN_KEYDIR}/${SPL_SIGN_KEYNAME}".crt fi From patchwork Fri Oct 21 23:37:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 14317 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 18495FA3740 for ; Fri, 21 Oct 2022 23:38:01 +0000 (UTC) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.78]) by mx.groups.io with SMTP id smtpd.web10.1487.1666395471881117197 for ; Fri, 21 Oct 2022 16:37:54 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@seco.com header.s=selector1 header.b=bl11tSBd; spf=pass (domain: seco.com, ip: 40.107.6.78, mailfrom: sean.anderson@seco.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ap7LYrYI6L7nebCG+ReKOABcq4Uo4mjZp+zTbkz87AGcZQPALfEeKlHSAE9S/lat5NW+JzzLJljs+bUo9+4KFdXmlgcDQx0JGznjeCT5sb7B7+dNkMJwjFl5Zh316FnPdhr+MxFsTPTd1AJDHZ3YHcvsXzaoAAAYHTczTq0oYK71pJ1ORKIigM/ySLvvfjwebhYSTJX/cRouRLMPx5W02K4s+XR/7NulvdjIO3Jo7qf7FCdY4/48jpiMd2p25yB5hV2VZGzV//xg9qcpgiGXx+UTm2yOgwIKHFicUaNxxrRuweV/TPaKV2odvJLUeLb0LVLaPI9DnKXhx6JRqML4wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Gcqsj1wqJyRKynoCcF2DSLRp2EO9voBQoHJ0AHMD1ho=; b=Nnw3vcgh6yjRmTi0jp7Rjv1ZH2Lkp/jr0b5Vu4eM1z1nh6uLemDE04tTkZs6o6vg6vSDRojWQ3sdi8FAfP8MerrV17cQePNLumQSWZPRXi1Ky22fT4d5Aoo/dQccBZtacfAUFqckH+kfMMP7QKMrq87TP9MoxUaqvYVh2824Qy0pOdHMwKfoU8NwzcCcdS2YS9w2yZSvNoiiPl5RcTU4G0AXEvFh857OATWGj/FB/IdYcuBdAepYhR1x9snYu/fhvjdCbVltE4sltbKX1N9zNrRRmSD5yehtjsxD1gg0jV/BplVPAXUN8Svf6fqTeYvtu3uacKRqS5VRwzsgpgjNIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Gcqsj1wqJyRKynoCcF2DSLRp2EO9voBQoHJ0AHMD1ho=; b=bl11tSBd8xfp6r254uWjm1KuCmG3vh45X5snIJUqiwT2YUw3aWRHMSsW74SdQkodc4shslA9aGlSbXw6XzA5KbRL+Q6YcdByJnHcaVUNB+B2zQ0kfYfvFJqMjN0GnuFfuvDbkckiyX832rU8uzkBKzwGtQx1JV7IRzmo2C3b/5kYOg435qhSkRs6J9I5GOsix4pTUkNXTKWWxcpyPKOSC7cMbKPqQq+588C8HlPW/RTUkaAoi+eyYCLxEBF3rpyebgWXRzmaJLmErfQQUfXKA3IJAV2+YwWByOUnd4uSPWfXS7LILhiXfsFIfzNGiSGTPIGI/dWvDoQMaR2cB3T7bA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by VI1PR0301MB6656.eurprd03.prod.outlook.com (2603:10a6:800:17f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Fri, 21 Oct 2022 23:37:48 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d%6]) with mapi id 15.20.5723.034; Fri, 21 Oct 2022 23:37:48 +0000 From: Sean Anderson To: Alexandre Belloni , Richard Purdie , openembedded-core@lists.openembedded.org CC: Luca Ceresoli , Klaus Heinrich Kiwi , Sean Anderson Subject: [PATCH 2/6] kernel: Clear SYSROOT_DIRS instead of replacing sysroot_stage_all Date: Fri, 21 Oct 2022 19:37:22 -0400 Message-ID: <20221021233726.1751124-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221021233726.1751124-1-sean.anderson@seco.com> References: <20221021233726.1751124-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0012.namprd11.prod.outlook.com (2603:10b6:208:23b::17) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|VI1PR0301MB6656:EE_ X-MS-Office365-Filtering-Correlation-Id: 0aa8ca51-427a-46fa-1f27-08dab3bd435b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gf0iqAR7t1LVAmUDvfocx9tSpjmBD3taOmV8l5bkJbX/24iZO2DhddX5p+RRzpsm5mmNCwHPvVrltlLnrl83wSlZ6TdYaehfXtnOVdB2/tUf9wgU5lRWrJWW1dF5VcmzKhr9J+5a5URIEcT//X74n0lXZKMWsrARcZOy8DuZX66HeDkHWTiB9tb94FvyDS6BeS3HF7dg4TWQxjCkkbCrEW0dUxmFDkcTqGnF5ZLYY+pxvzEAmYf4bLJMzpPm8ukTZAxl4QNP2dxOB0NSp6pC0ANFAWz0CQtUF9toPIoQ5PPs0uYnvt9sBfy9LO4DsrTox0/Ryv8bWLiTjuNmO3yR2an2AbStoWWqKy/Jv/BOB3Upyz9P7k0PuK2N2bl1msrox62gUTM8ISwpQm5XcslXju4m2OM2Cxmpd8GAMwD9Xgnh3DBxV9MV0IFCYddR8DpwfhSl6fqkdHQsj5HdRYZEOK6sLQWquwdNe2V6/RpJzDizJpqKnrevtznE0QkBnkmG4tO/zd3vcbxPioj1aU6fGIYLRlwOBAa+JruVoSP54Aljdweuv78tIJR/DZgeP0JbhypueXEkTJlNx1DFSVAwjfxTO+UK8gDtxhqtomttgCN2MDjuHWukk4Iq9DkyDmNk/li5Qc5CvKBWIG4WTLQFk+vnhFPFdL3WOILCSK4FIOYt9uBlVV2Cg6s27WlmexkysdwLbjtYbmX+VmtUDlkJfAtGH7SYJ3eHpBDNeZyjIO6sC4vDC25KCAqBA447lY17tQsQc2YGrKDVWOMoH47dPA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(39840400004)(136003)(346002)(376002)(396003)(451199015)(478600001)(83380400001)(86362001)(6486002)(4326008)(8676002)(66476007)(66556008)(66946007)(54906003)(316002)(107886003)(6666004)(52116002)(36756003)(6506007)(8936002)(5660300002)(6512007)(41300700001)(26005)(110136005)(38350700002)(38100700002)(1076003)(186003)(4744005)(2616005)(44832011)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9i1jfgjdNhiQ+WNhcCfnhCtfeujvtoNmfjB05cIlzuDAAr8gf1ts1k6hKcFXaVyZZGF6THb3+hgz+otSgRco2Uwi71jF0BuK8XKFSga/yhLx6pZbZ9SVWhcFDcIDd6lldysgUDzozm11AZXz1eXa0l3png+XTKtsn7wKdhsDO+cIUmBoQUGKn7t87lE0kehBprhnx3tg6Q/lPp47FBA2U8DyYaz5Gj1W5ZjYGMHFoN7ca7u5RUrNsRzccM87axlw9/TW20ryxS/7vRjJ0f7NRWZCe/7XsMxsGwpx9TBUGIJhCBP8Pcw3J7eSlUzUuj1YQ7/LiQ8SMGQ3jVdo36aA4jzbzboBoFaqtL5ZUY09mpJWYdvjG4lrjNVUaTVYeza+Go7P29f5uZVq7kCggcp8m3zCGJbY553mrlXZuoUBNUW4bWXTK/VO23xran7UYIXCASUO1JNbukjpgbJr+PXh0dI6PAXgsMx2X8D8Z6mP35kZijTcVhOznAgf5GBO+tQLSl14WaDSMaHOPaYPINYOAbWU2aj4oA5P/oBi8oCcgJ1mcrp0cAhIWxJsi0QqrSLnngLDeJDo4/7htwxAfXbudUhiKT3mTX5aO0qgOj8lqE6cbHujnoqjR5dKwUgbhu0GWcd+EOc7ZYsHkqIUjKDmo1BHR65BIbcZ3d5/TXN7HpdxidPCgXPROC30K304JgA0Rjo7khu4cPb3S+miEshH6QMZrvqwg9UuoBLlZu+hufKm+dNmoupjtWLaAvdrQCigPK0P53o7BLbFWgjE4ZX/+e4YyIBzhZ+EwKaGr+t0E9oLBvfDKVxVThCo+hXm71Gn5TcZ9QPt6a3DIkg395MGAx8xrbiUXurGAvmJDc5Az5apZpmvm9CGK+9whVijQeLdpgY4hsfPCddzXrOkp7npuU4fbRLxxVyUSM7t8oE066l3tm8oy2xMOJK2HXXQREcE5dLXI7LS61EVKk3uHaxYRDj6h5xoXujNz8QXpKucLT9JXvWyAyQNGXWSrWemP6xjNct3S/q/IIVVk0h/e43r1H89SFxFPlKkvdFvhlQV1K7JaDrldRIxRXT/i5hgSAq2CV03AkPyRiqfRFp0Zywj2Iz+ER02yXyD9xDmeAceUFCag6cQcaIaLmnBVqb2w6DYcOEitRtKRIp6IzwD0s1g+mdsEa6lcKsmuqz4DuQ0Pke8AuwjWQ5AsAawz+RdVG/QJtYVMBFr+tnWCzcmFtHwHPMOQIv71CDtyG+7Zfhf+6ZKegUAOtX7Bz37vPjhtIu5vBBeYM3iXYh7wJvb/tzjPa5499dOwIiZyaBkDK+eglGpoO3wRCAXrqW1gEGXv/KW9WOZInARQbIBwI9BPVKIt7Mai40r0hV20bkMOhm7XfVK43cQwE2sRy4f58PtBX0HT2IDIZNWom+f73NKp9GRiLedrDuUObTO0+NdX940HtnGCC15cpF/T0E6WG5H0bqQzz/MhTMiCIWPzbm6SPsPhx1WxEYxRvVn9MnpgGrMxaxW/ICZVya2TihIHm86u7NXwcXq2hR9QUe19cXKpMEnEawaLhKkSgx5jr0j+iwKnqWyIWDr3b7MnspQ6orym/54NySIviYip1a7xzWKQIkv4w== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0aa8ca51-427a-46fa-1f27-08dab3bd435b X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 23:37:48.8613 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4azwd3fnzXReYucA4scFlVmfbmBzjRW8FkMc6kvpb/6uyz9eJQ101YmymSVsF8tXcV6WlxlU9YpQtIdswBE3ZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB6656 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 ; Fri, 21 Oct 2022 23:38:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/172051 Replacing sysroot_stage_all by a no-op recipe makes it difficult for bbappends to stage files intentionally. Instead, just clear SYSROOT_DIRS, allowing other bbappends to easily add new directories. Signed-off-by: Sean Anderson --- meta/classes-recipe/kernel.bbclass | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index e4e69e0763..7bb3449223 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -594,9 +594,7 @@ do_shared_workdir () { } # We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware -sysroot_stage_all () { - : -} +SYSROOT_DIRS = "" KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} olddefconfig || oe_runmake -C ${S} O=${B} oldnoconfig" From patchwork Fri Oct 21 23:37:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 14318 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 166BFFA3741 for ; Fri, 21 Oct 2022 23:38:01 +0000 (UTC) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.78]) by mx.groups.io with SMTP id smtpd.web10.1487.1666395471881117197 for ; Fri, 21 Oct 2022 16:37:55 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@seco.com header.s=selector1 header.b=s6PYXL1F; spf=pass (domain: seco.com, ip: 40.107.6.78, mailfrom: sean.anderson@seco.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kRJvGIgR/QjvSA5vGha5doSZ8h4knnK0x7Pyjb8aR8GmXe4zWzrpZ+t3FsLcEq5B2Pddh4TgGcK+xhCRv0VjD+VSiTQjRbcVHJO3XW3gzENflM8SNDGPJU52zfQicmI7wdflU43eGiFBvwpB/mNxsR3ZsXa0sEVh+XD/z+4oTFDedUO7iTxZsxMqai8yGLy7oqFrJtdZ/9NTpLE38ot9xw6bhRApeRWJvHdj+ycgaFj+Ho+PoVRt5EGW87VM9BNH7UPURAFjpfoKloDgalsjwNp6yzeYoWpkKRi6nz8owhqfYzGN7lx4Z9tFa0alDDM0FMfw0SlCxfODQX4Ql84vCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wJkfQEcSbg4q2uiBdMjnBm5L1QgagYru4HYKxMmpdnA=; b=lTHSyOcg2orYzk2jFGf/WBto1424eRIpZGV87V89WDx0K0n5w+UHec2CR8mvbaJQCL/iBjloKPFovDDwRGuC7AJNc5MHCjqir8ffrRkCnC9qflkLY+wBnitKes9S521Ojhmb12nvoOeW9materWQw4Fkue2dqeueGpLbTZARL1nMQRIzLyI6PUfw31fepso4Jpoxvs7v9T4jUZvC3PgRKTvGSwmfcAJo+9Ya9LhZHAwXGJ2X5gE40uU3kFut2cBB+gKz/Tpntvy16WrjjGjqSJW2QRrK8Xkl5XjOLzMsiT2UUdoZGSZmLT8367CC18M+iOHlOYNu5zIcL76LemPnxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wJkfQEcSbg4q2uiBdMjnBm5L1QgagYru4HYKxMmpdnA=; b=s6PYXL1Fl+wqAQqWo6KBDLJOVVC/JmpUXqZoZTrrATNARmA+HxRnkBYSNpvvL3I+pp78HyHXJVHtUU4wJCyA5mPs2EUxmgPETQw4Z1QqpbmVp/UtxNnVQZWL+fh8EzkCuhtAY9z7vJBpetUqSpxnD+RN3NXJTUUXblOMLSpHrYV+H5mDpNtRghbOvQLQaOsc/Kr8/qM7ubrBKQbW6ISiZwNH/InubuiS2s9GRS+21cCh/4LT1GK7aDlk6FzkZ/IP+4iMuFGwEMvhWic6oE3okJOxppzVqNmCSbvWx22A76mHYxWTGv2/jCea+3SBcJdjGXf1qn/51UAoPaxxDmLaKQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by VI1PR0301MB6656.eurprd03.prod.outlook.com (2603:10a6:800:17f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Fri, 21 Oct 2022 23:37:50 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d%6]) with mapi id 15.20.5723.034; Fri, 21 Oct 2022 23:37:50 +0000 From: Sean Anderson To: Alexandre Belloni , Richard Purdie , openembedded-core@lists.openembedded.org CC: Luca Ceresoli , Klaus Heinrich Kiwi , Sean Anderson Subject: [PATCH 3/6] kernel-fitimage: Use KERNEL_OUTPUT_DIR where appropriate Date: Fri, 21 Oct 2022 19:37:23 -0400 Message-ID: <20221021233726.1751124-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221021233726.1751124-1-sean.anderson@seco.com> References: <20221021233726.1751124-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0012.namprd11.prod.outlook.com (2603:10b6:208:23b::17) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|VI1PR0301MB6656:EE_ X-MS-Office365-Filtering-Correlation-Id: b2a1c879-24a0-4820-b10d-08dab3bd4412 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NSvIA1J43lF8By+NEGqJxLNzEERBPTW+0YFoHwIFyA7fzhgtFVVZUgPgCxHn7dDaBGz4RJ1WAAwS0xfk6Q/rYZXtTjSoOLsBuaeO+bpswnrL8kxMOVruWn5bK2zMagxLHpeBOv6ydA/HfrIFubxp0Dw9lQoB+V+qB6S8Sha9bo2MQ7Hy1iTzcSlUyqWW4axSIdCzY8S8Kqcyto4/LSzBwvdvrjHiq3WIw3tn94oSiaWmUMzKXPjQDVUGmQHkiwe6l4xlm5x2xoFd5N1bj7A7YRRMHTD86dSLxABjAQTL9QDeWInqP4ApZnrOomMwLJ07qsmNp6h2fqy+tEaZAzL3tH+wG9gKEXYlGWXhfLVBIUs50EKm5MnXGpSP9dv5rKILW7OXmkn1eMsi9sgyCBHEkLI50urlWGv6GQiaHEqWMkZwIdjUImvK+sMjY6SDvis6N3ElUWBaiw+o9wu/chLMHYaXGdePcDzUh78K12goA6PgpHYaNY2sN1C1TjDwCSF3Nxjhvti5CQZGhl2GGZrpS4VznTNPN19KU5zGa6qawR7dV2Yxaz09HFIzGbfcL7aTPJCCSw9fvuMo9l8qSjcwOhQG+doXrxHJcW8oJUV2Z6E+uZb/hf4mX5NgNnqvTO6WERXHiLNWLQ9Qi709eAGVoJoDIWuR6EG1pSVHsbBwBMVFwz6VeFbQxwyG9xtpg66u9wYEHD+nCuFedeNpch/Dg48sUyf21olA/9SXej3r8CdZVmxX7q3oG6FfyM4+ty0uSL+rJDIEfXDw2nu2g48Zhg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(39840400004)(136003)(346002)(376002)(396003)(451199015)(478600001)(83380400001)(86362001)(6486002)(4326008)(8676002)(66476007)(66556008)(66946007)(54906003)(316002)(107886003)(6666004)(52116002)(36756003)(6506007)(8936002)(5660300002)(6512007)(41300700001)(26005)(110136005)(38350700002)(38100700002)(1076003)(186003)(2616005)(44832011)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IQvhMfeKfS0engI/CoixmIyapuzC5jWh/52sWtCFrF/5a9wVpMdLSSB7+kcHx2NRjUwgIiTzQmAW6imCgXXR0gTL37x0QTRzs1z6Lc4lFaG16Tyif9FxuSuo0QGZt+7lMk2LthhfLluWEIEq7eR7+H2++c7UWjQen3aKunTW01k4z3/yuZBcGb/Ne+UqbfedIOayI8NGSdy0HetmUTHxGu5g1aPUIQqJNWWp61ln5W9rF1ps19V5OV7KhxeZA39Eak6xtskdrridvOjZWDDD/mH7wIlsKMyCdhanqFsfD30O0J3TCL2xM48eugkSLDqwSILgjiWnr+GtJfa9YW4ZtX5FMaftAR/H+4cba7ZsZDQv/pXv07XJm5KgPjp9HsqZYW8Oiy/n22DVfFqXuqrfZ5vU3R1OSY6zbQIJ5VyVZCfDy+IDXlpC5YI8b0ZLRZXT57wJB1yHuvHZg/geo2DzqE6V+Ka0pzaGbkdC5KByiouJ3PdI98msK7oiK+Uqbg1tsQsV3DTJyn7yExHQ7dCCqISQJkpmCBMgZKkBPxJlUkfoeTEEhRTPU2J0+62ZGalpKXcPJN4WUJOQKSXCrib3WYPB2TxkoDEFDFI8ijAo/h0yebhP10xcw1D0PAyceTe3pj52KX2tG1FzJgtg7xcNmHOkiBFqEffKbNuhw5F2Zpf2uF2QBUKMKJVSE7RyOJ+0gdgoQ67V8O+b0tOV6DoIOepySbvmmkB6UCkTD1YzaSGTOrHGVmxKaFk4xX3eT0IHiAiaKCGfHkGdJm8qnRwkRnKqcM3x+5twe+Q9pVuzxXwyTQrJtPA9JNaQkhOK3DQxAhCZvKYIVF6evfBme75cu4ZRQbKucFEG4xE+FmvlIcVYPWSUTPCGn7Yebn+vmSbTC9persbKA4OF53OQC8AbH2QdT/ZI/vr9NlVtsdUar5nkuqFrjBUSUUBEMyxj4IKiUL8+LW7tMkGCmz/UqQ+xaeVkc5iWI+O6qcBni2cBGEm4bLFJupXcP28E7kkMHRcBOEzZ7wPtQvUq6/6wpkyN2BRAv8S4b0Dx5cmUTI0DtvgzCWmpCUebIFPAAk+8BM5Jz/zzQ4kHuXP69bj8JOLwDWsquBdekEtd1wAhwIYXrOHngSZRipH9RaZBWbCHuJwof4aV//ukTh8diqFCfshBsCF4UnYu5+8f1oNmtqZQabTLdTvTmrIe2Qb0gqJXWvjQO1aS+sDnCZm4fyB+qQrvfJKLTyPIp9n+tUQZIxkpUVmNZ9R7qwPb41mpXZs1RgFri9d/DvbDPis+XDP2504HKq4Ja2SCxaqyr8muUFZlNXdHqPSc6ue+eJHIbi36lqbVIDS8yJxroIU2GLqmHQrvd7vKgs39YwhiFAIUITT+37tq5EMH7UEH98C+MxsvWqo7bJ3oljqJ1FZzyWYzxLOuXy6cbWM4nNnOkXUEwdtcRXbvVCfSeFy149Ln0bm7Q/ux3jiy9NTz+wz39kgTkEwNoHlkMMTz8KstS+p2+y7UgSHHXsxdlbNe8e7rZqjWrmDgz15/RCY08td/0i2kAeNV6UEVtRvHEPL+neE3DWjW19QRimsuKYgpkfqB32WFmz4QFGTL6OxWu0ixMyrzMl+ZdQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: b2a1c879-24a0-4820-b10d-08dab3bd4412 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 23:37:49.9550 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HyRzk5mcKYg//rcjuCqvl8lqL4eDZEhefYrYc4sTgwUjLAMW8azvK7i4jH40LZVdk+Ye3kl+508NRt+ErJZ3+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB6656 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 ; Fri, 21 Oct 2022 23:38:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/172052 We have a specific variable for the path to the boot directory. Use it instead of open-coding this path. Signed-off-by: Sean Anderson --- meta/classes-recipe/kernel-fitimage.bbclass | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 107914e28c..8ddebf8dd8 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -496,7 +496,7 @@ fitimage_assemble() { ramdiskcount=$3 setupcount="" bootscr_id="" - rm -f $1 arch/${ARCH}/boot/$2 + rm -f $1 ${KERNEL_OUTPUT_DIR}/$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." @@ -529,9 +529,9 @@ fitimage_assemble() { continue fi - DTB_PATH="arch/${ARCH}/boot/dts/$DTB" + DTB_PATH="${KERNEL_OUTPUT_DIR}/dts/$DTB" if [ ! -e "$DTB_PATH" ]; then - DTB_PATH="arch/${ARCH}/boot/$DTB" + DTB_PATH="${KERNEL_OUTPUT_DIR}/$DTB" fi DTB=$(echo "$DTB" | tr '/' '_') @@ -574,9 +574,9 @@ fitimage_assemble() { # # Step 4: Prepare a setup section. (For x86) # - if [ -e arch/${ARCH}/boot/setup.bin ]; then + if [ -e ${KERNEL_OUTPUT_DIR}/setup.bin ]; then setupcount=1 - fitimage_emit_section_setup $1 $setupcount arch/${ARCH}/boot/setup.bin + fitimage_emit_section_setup $1 $setupcount ${KERNEL_OUTPUT_DIR}/setup.bin fi # @@ -650,7 +650,7 @@ fitimage_assemble() { ${UBOOT_MKIMAGE} \ ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ -f $1 \ - arch/${ARCH}/boot/$2 + ${KERNEL_OUTPUT_DIR}/$2 # # Step 8: Sign the image and add public key to U-Boot dtb @@ -667,7 +667,7 @@ fitimage_assemble() { ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ -F -k "${UBOOT_SIGN_KEYDIR}" \ $add_key_to_u_boot \ - -r arch/${ARCH}/boot/$2 \ + -r ${KERNEL_OUTPUT_DIR}/$2 \ ${UBOOT_MKIMAGE_SIGN_ARGS} fi } @@ -770,7 +770,7 @@ kernel_do_deploy:append() { if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then bbnote "Copying fitImage-${INITRAMFS_IMAGE} file..." - install -m 0644 ${B}/arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT}" + 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 From patchwork Fri Oct 21 23:37:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 14320 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 15550ECDFA1 for ; Fri, 21 Oct 2022 23:38:01 +0000 (UTC) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.78]) by mx.groups.io with SMTP id smtpd.web10.1487.1666395471881117197 for ; Fri, 21 Oct 2022 16:37:56 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@seco.com header.s=selector1 header.b=dykohjIw; spf=pass (domain: seco.com, ip: 40.107.6.78, mailfrom: sean.anderson@seco.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gsnpe0c0lOAWFRQepbfIesB71QqXe1fc0EWqPswwkzLBAnBU0cdQBiDczhfzINGc37PXe+WpFLChT+7Ikr08pHJaxdh6IgZYw1Zm2ZFAUKBAxJAc1JJ8KNVgFAJYF7FJqR49wsuzRIi2tSqhQAJUzGH5KOvKLiayTfxo1gn2PSKgNBwnew3Kri8TYh+d8qUdhNZZLIsp4ZspgW9EqWbwgtAKIfMj8b7gOtF8WFumC36Vszzli2v1JiKB+uw0NXnbXuD/C5yE7w9OczdOuho76enS+5VPc1SW05XmSomyhy0c79i5vflT+RdPpJ2D/RsB9dPMLQxMIekXSaetiP4m3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3GUO5GD3n722Qx+ufdf0TaCbeh7PWlMbBjnUnYnPK6A=; b=aCmfCzt7OaXFnoanTPIbghzflZI8vw3qR+/dK+/kjEFIcWZ11Nl7tUXTHJ0Etb8RICdonDe/Q9KJdMq5KpdGsmoa9IhF+a3ZNWYcC1dqycprGaAKT6C0Dmgm0p1UB+LGWtN0ePYK9jpsuTpb3YPWSVm60OnLYaluJO/vb5jT1mFYUll8UQSdivdHl1a8mJ2XcTIDydshbSA8+25SrAe6Yc3zqGtMQGMlt+vicXqgfVKAdgli4Y0QWBexSmMYcsokW4qrtgoJIvPPrTq8CpdqIwPPCg3W1WwbWyLnLgeykrwqyKmuDhUWCtxUlrLd1whix+amq1ZSV7bVOSkYDqsLEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3GUO5GD3n722Qx+ufdf0TaCbeh7PWlMbBjnUnYnPK6A=; b=dykohjIwSArWlO5PWOfVhmmBFrghrRzpIqq7xL6kFqLauBa2782DhACMtDnSFRpZvEsYPLctwtdCuW4oPjVSO3l50L8SCRYh8Hwfo/PftPSgbHt5er9O3JOMWc2RfwKMzE/chP0fo19NoQl8hEBh5o6OQWDReMN7E6OVBlnrcLdwcoVQIQfPxwV5vgvvcfqQMa76PRBbvceTEmmaNNkTgRIIKFkjC29TLIlwtmZ20cLgAAv/OnHtQKxNHzskNX3J0g1PHuNt3vZzTaAfjqFlkB6hAFx+pyjCiHTkUe/GHcpwTX/5QN6Lm5s7Bzo1OBjlop0Ui0CX014nTATlJzYMAA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by VI1PR0301MB6656.eurprd03.prod.outlook.com (2603:10a6:800:17f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Fri, 21 Oct 2022 23:37:51 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d%6]) with mapi id 15.20.5723.034; Fri, 21 Oct 2022 23:37:51 +0000 From: Sean Anderson To: Alexandre Belloni , Richard Purdie , openembedded-core@lists.openembedded.org CC: Luca Ceresoli , Klaus Heinrich Kiwi , Sean Anderson Subject: [PATCH 4/6] uboot-sign: Use bitbake variables directly Date: Fri, 21 Oct 2022 19:37:24 -0400 Message-ID: <20221021233726.1751124-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221021233726.1751124-1-sean.anderson@seco.com> References: <20221021233726.1751124-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0012.namprd11.prod.outlook.com (2603:10b6:208:23b::17) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|VI1PR0301MB6656:EE_ X-MS-Office365-Filtering-Correlation-Id: f78696d1-645f-4480-92d2-08dab3bd44b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tWmEeChQSTTJFM456lA4MIpZIFHge/yX6cd7fVXU9j44ZUSXwEc7U3CxuVWU9NweB6Arie5KNgV1vPFeD0sYnYi8s7gHee+eMxjYA51+SaLPa+W/jQ46YlqCrVLwJmk3+GJhqxC0ZFFAq3o+P6lzsHmjSik8Mpse9V4koW8pXJweWHHAuWdYyrDlc94qoMuGwas35DHphS4bckC0xXrWCa4O7o31EB32eqXqoEmjTUi+u7ySlP87F70zyMIMPIet1gnDgcAj8zV+jWk6QYGDUmPNWHsqpx9ol4/JnPUUyE8W5MglT3MAIbLW1vfQ9fiqbevyptdaVyjHDmKOabIHy+WOr17l5NhepsOaB5mPJwhVyk0p2NGv3JxOhNc5DRIsyEgccjPwhqql4Waat/+U8wB5OzzYwT+98TTDW4qFhFsO0npQGwo8lNRwmbMixIJjmsHl6foo6QQAEdMjHk4ojeJGK6Af0wSFrxMVZlwIZfI6bAi1ahVC9I5qD2LGWXmUyEh4R+BfGsGtuNZSB3ejYy2DKZVf9j7K98JB5Smv4M81NcpLcA8+gM8qCEpgDa+ZbhxxdSFWzRsMnlcU53JYjWGGwDcCtfA4a/IX61oTVZ7B+dFWZwMKc2/u9rP8TFf+I4KecxWMXOWmPguajJUD49h4ds16g15+I+klVCQqbI9TJKWpM0xa60W1dDcMG02w6NmM1E+OnJsa8NfiO8rPJ4OQDz6xVVeiJPrnZPkne5ryvw8ev7KxFAviAp38N5qgrx5pskFZgrS6pH/Hw41pyA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(39840400004)(136003)(346002)(376002)(396003)(451199015)(478600001)(83380400001)(86362001)(6486002)(4326008)(8676002)(66476007)(66556008)(66946007)(54906003)(316002)(107886003)(6666004)(52116002)(36756003)(6506007)(8936002)(5660300002)(6512007)(41300700001)(26005)(110136005)(38350700002)(38100700002)(1076003)(186003)(2616005)(44832011)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Vuo6gqPhw6OJhpwwdV48/ZW107RC+1WSnHP4GDl7mWYFSc75L+NB7v0Ly24cgxi/I4qcusgrZSSCxyA9uIPW6fHT5wG7X6MNuHsN5Pc75TaCghCPlWEepbtT5UA/xQGKBS6rHExAX+pWd6LldV/9cTzzKoHb6ugof+PL6O5GEQjKWlkFW9iRpfCfMKZlPPdFHOUH2NjgVAIOL2ZS+/i3e6TvYLzn3DKfSDnFXef4FCzt6+0DY9dnVibpe4Vmk6aS7eKO7M5+cMdQV76M1FWtvo2KqIf38j5uGkbZ5nA5bODGK8Njdt7zlTw4fP8Mbzf+6WHC8o1k5o1hsicTZqztJCr8WSIySPGMUlrgiDphko03yyRkBCkyo2MRPocz67dl3iyko08oCiSVSyeheyCMi8We44QmK1DbSo2Dfsl6WpbTcW5AetFswO2gXdOOkAzSLs3w5v9mlN9cufdws29Krpmob0flPN/3tkgoGk3fjO5ZxhrOWef4JUNYuJdMna7RJDLXFreJsIXA2k/Yrq5QbKOzLWe69t011moRX6nQymq6Ta9UQbFLlnFVGy1k9zKa1bm/6tPO6zu6D5RLl9rmwNiLqF11Ip72KLKSLLrdrT6sXlc/PIhIwvYjS6Mx7nuTQ9EvuJ0Euxi77dv4yxT8qcRsMN+G9xl08ZDjKMTC0ZTk1HkVRp+FDSjyIysae1kr1YI5wzXzYVgmxr3sU4M8yitznzcVG4aBGffnp1mPiv6ynD4dgbBmVpMPAJTGOOHhekJe22icHPOzZmy84CqraTznZs2tr5WqamZgnU4NZLqlfE3Ux4pSd/4orsx1b41j0Lzec4YWQDbDqnZg81yCSw7BXckgHORFikeyaLeGGGIKpGqX/ccBppZVCfAq0oDiyzSxBcumgwfPAMvsQtj+fMMEYHDAGdlVDevb3mpsMptjfHhHcs9/ouS7RG0G6kOXkbHCn4LZSQ46gLO9NpkoEWOrx03Q7bsWdUfjuJU9ZS0pIVHRUkVFZTh8II2Yftx6IcLiy4vJPy/OP+Gn0Yl+8CM/UIICj50NP/SwiJMdzHNSHeeL55jDFm3lMDoLU+vKtBMLPMOBUwtGWvWOEWzeoj7EZHR2JRZq6hyUQnxybvkrewBkuOkX81R7/X/GbV4LllF7gOJIL3FR+djshxitNWle4p5ktnuhuWgmV6jiGeMayLFkCDb8VSnNd4SZejtAs65ynPxVsnxt227PMkmhv3zsFJqekdoOLj8KxKKDnu4d2n6zoCH5VeHrZl/4tPBLOwQHdxYaone6unz1fkIiGgzwXJ3EgjNapd1T7Uck9/rcesGfPyQI0EmD6JVmYTsVzzWRKZdL3U3yr+7nUfagowgJMWAy0UwMf/61sYOJw6Ee2r19hUsqUYojcQu86pBv0wdt3H6kT8aYnBOdgLBauqKQWkvDsmY0qdMn0bwdiZ7mzbRSXIJD44tud/otASU+MJgHSnZcX89fvUYGjbxnoH321X8cgB9u7I1vG0IqOncs4vrJf5eK0xKaCob4WYi/S6WcGKK8kzkHdJ/dK1pOFwBxuPY5cWHADJa6+XaYcfSjW6MuLNWlfPQt2qFHN59tkpAa8zLv72bztTEuyCx94g== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: f78696d1-645f-4480-92d2-08dab3bd44b9 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 23:37:51.0487 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pPkxHqAM9BJVpor5/QdePbHdXSXnP7aspXzuWqPkw6tduSzes6lxwNwim4mMOjE5AzABHry8UZN6hMy02Kpxng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB6656 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 ; Fri, 21 Oct 2022 23:38:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/172053 uboot_fitimage_assemble is called from one place with the same arguments. Instead of using shell variables as intermediaries, simplify the function by using the bitbake variables directly. Removing a layer of indirection makes it easier to determine what values are being substituted in. Some variables can't be fully converted, but they will be addressed in the a few commits. Signed-off-by: Sean Anderson --- meta/classes-recipe/uboot-sign.bbclass | 30 +++++++++----------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass index 4b5912a01d..85e23b963f 100644 --- a/meta/classes-recipe/uboot-sign.bbclass +++ b/meta/classes-recipe/uboot-sign.bbclass @@ -311,14 +311,8 @@ addtask uboot_generate_rsa_keys before do_uboot_assemble_fitimage after do_compi # Create a ITS file for the U-boot FIT, for use when # we want to sign it so that the SPL can verify it uboot_fitimage_assemble() { - uboot_its="$1" - uboot_nodtb_bin="$2" - uboot_dtb="$3" - uboot_bin="$4" - spl_dtb="$5" - uboot_csum="${UBOOT_FIT_HASH_ALG}" - uboot_sign_algo="${UBOOT_FIT_SIGN_ALG}" - uboot_sign_keyname="${SPL_SIGN_KEYNAME}" + uboot_its="$(basename ${STAGING_DATADIR}/u-boot-its-*)" + uboot_bin="$(basename ${STAGING_DATADIR}/u-boot-fitImage-*)" rm -f $uboot_its $uboot_bin @@ -333,7 +327,7 @@ uboot_fitimage_assemble() { images { uboot { description = "U-Boot image"; - data = /incbin/("$uboot_nodtb_bin"); + data = /incbin/("${UBOOT_NODTB_BINARY}"); type = "standalone"; os = "u-boot"; arch = "${UBOOT_ARCH}"; @@ -345,8 +339,8 @@ EOF if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then cat << EOF >> $uboot_its signature { - algo = "$uboot_csum,$uboot_sign_algo"; - key-name-hint = "$uboot_sign_keyname"; + algo = "${UBOOT_FIT_HASH_ALG},${UBOOT_FIT_SIGN_ALG}"; + key-name-hint = "${SPL_SIGN_KEYNAME}"; }; EOF fi @@ -355,7 +349,7 @@ EOF }; fdt { description = "U-Boot FDT"; - data = /incbin/("$uboot_dtb"); + data = /incbin/("${UBOOT_DTB_BINARY}"); type = "flat_dt"; arch = "${UBOOT_ARCH}"; compression = "none"; @@ -364,8 +358,8 @@ EOF if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then cat << EOF >> $uboot_its signature { - algo = "$uboot_csum,$uboot_sign_algo"; - key-name-hint = "$uboot_sign_keyname"; + algo = "${UBOOT_FIT_HASH_ALG},${UBOOT_FIT_SIGN_ALG}"; + key-name-hint = "${SPL_SIGN_KEYNAME}"; }; EOF fi @@ -400,7 +394,7 @@ EOF ${UBOOT_MKIMAGE_SIGN} \ ${@'-D "${SPL_MKIMAGE_DTCOPTS}"' if len('${SPL_MKIMAGE_DTCOPTS}') else ''} \ -F -k "${SPL_SIGN_KEYDIR}" \ - -K "$spl_dtb" \ + -K "${SPL_DTB_BINARY}" \ -r $uboot_bin \ ${SPL_MKIMAGE_SIGN_ARGS} fi @@ -430,12 +424,8 @@ do_uboot_assemble_fitimage() { cp -P ${STAGING_DATADIR}/u-boot-spl*.dtb ${B} cp -P ${STAGING_DATADIR}/u-boot-nodtb*.bin ${B} rm -rf ${B}/u-boot-fitImage-* ${B}/u-boot-its-* - kernel_uboot_fitimage_name=`basename ${STAGING_DATADIR}/u-boot-fitImage-*` - kernel_uboot_its_name=`basename ${STAGING_DATADIR}/u-boot-its-*` cd ${B} - uboot_fitimage_assemble $kernel_uboot_its_name ${UBOOT_NODTB_BINARY} \ - ${UBOOT_DTB_BINARY} $kernel_uboot_fitimage_name \ - ${SPL_DTB_BINARY} + uboot_fitimage_assemble fi } From patchwork Fri Oct 21 23:37:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 14319 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 086E1C433FE for ; Fri, 21 Oct 2022 23:38:01 +0000 (UTC) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.78]) by mx.groups.io with SMTP id smtpd.web10.1487.1666395471881117197 for ; Fri, 21 Oct 2022 16:37:57 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@seco.com header.s=selector1 header.b=MxMc6g3e; spf=pass (domain: seco.com, ip: 40.107.6.78, mailfrom: sean.anderson@seco.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WhVtvqOQavPidAoa2tzhEIQHW4oV+cqGPbmkyDdINg7R6WmUTAMXe6z6T3J/OSgN0G6dmCAaLOhhUkd++C/lxRNTbi3YVKmnTDXaYxmpVjzhCQJFfAdF4df6TA4T1CrZ6XaYyEf3ds8kEZzdDhCQWK9qKw7yUq3Wt0jMpzgjE1+t7h/RVex6jXsWj2ASrHXLG78/3IPSwDZvgBbEpAPDfgVy5g8y6+I2ZoIx/eNPuMz0rAP37nVd2eNWyE+avaBzOGZJnTgGClyZrlLKzBcx8JiuhILH6JL3YK/P/c9H7BwJhAGuIatZA3ElHtCIb48U2CphedbN5WlY7sc9vI/bjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=es2SWx+WMGSVns4dxwioyWhqU9axbqy7VF4PSQbO5VU=; b=RKPC+ri0NE23x3PTeZXyMdbmPE6Is3mnLYEeJs1B/XAYbKYOUJfJLwmHd8ltin0IcdLcZOhaOqIcqfT21EZjrwPMANAVvrL39To9omCoYUPcTMpVLofXZ/mQafLAQKb/9nyO89XHKMnfU73t4gl8OQtr5t+iT2B1YxdkrGVFt8T4cvF3+SR2tFjwFkUGkGdm5VG5DKn+0caI53udl3BD7mJG1UrD8rqcRofLO3XOl94bXSDR9Lk+41300AaHUW9WkM1eIVtY6j8usd1LUZBhqks1CkYX09Mq6Pn2AVjADnw4mprGfPS5bhemjy3QIbcMkKvTJ4c7fLGxoEsI3peBpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=es2SWx+WMGSVns4dxwioyWhqU9axbqy7VF4PSQbO5VU=; b=MxMc6g3ew9GENl6nnm4zUuKXP4mGUrEiiAu6BoWx8dQUhuFpBQ8JrUdsz9xy2RJSO8XTXePOxnTGcqTYp0WmII0QNXvDRyuHQ0kAyDDUBgz5SYGPonrA43J0kZyllM40LbdtM1e7AgzH0iGmej7uE6902t5plLIt2a0HDyPBEBpg71LQsfJALrjARcinAZhFYo+dJumolY+6IWeHyfJKNJf9dbEvypu6YZxUh5rwbAV6opBaG+PNJlvOQR2AZwPeyPT13yY182JqMoYgQw7bGOOuTbdVtxNdv6sbwbRDH30ZH8ieW3KiTPDclSJNVJi75GDDbuA+8fBEJEgKY0xAcQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by VI1PR0301MB6656.eurprd03.prod.outlook.com (2603:10a6:800:17f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Fri, 21 Oct 2022 23:37:52 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d%6]) with mapi id 15.20.5723.034; Fri, 21 Oct 2022 23:37:52 +0000 From: Sean Anderson To: Alexandre Belloni , Richard Purdie , openembedded-core@lists.openembedded.org CC: Luca Ceresoli , Klaus Heinrich Kiwi , Sean Anderson Subject: [PATCH 5/6] uboot-sign: Split off kernel-fitimage variables Date: Fri, 21 Oct 2022 19:37:25 -0400 Message-ID: <20221021233726.1751124-6-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221021233726.1751124-1-sean.anderson@seco.com> References: <20221021233726.1751124-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0012.namprd11.prod.outlook.com (2603:10b6:208:23b::17) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|VI1PR0301MB6656:EE_ X-MS-Office365-Filtering-Correlation-Id: ae6d7c2a-e2c0-47a5-d6e9-08dab3bd4562 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pch8zeG/z7zltcG0o31DaQ7E+ZrIgtXVmmvB0mGuI7hxRo6wa5GX1fFpFxajHTTnl+VgRexQVIakxjkrhCfdRn2ji/CS3OAOmIV/iqxuXMHLnki26b8hLbdIC9wTxEO2xIZX8kCt4bkgfCFPViTg4+E+BzUthUZ1BvBbdIp56h4b3hNYudtKnhdk6rOcETVjk8Dr9nySgwVmAQl40uuVeQn2C6F7+rPQtj7X4icsGrzGUK71Q7dqAGsYlFXe4aX9673T+cFz+ZoCdA5F8/f94WpIJWW7rLWEJVt/AChGvip6QZazmTpUCJmB7Fm1MikwyYVK+doQQ8wB9e2oU8xjnUOs1lNcT21o7k7D9NV5OmWNDqao/1C8H3uh2VYRypfOqtgwuPijJ3jOMJik1xrzWjCKZYR9tqrJc53uvmzr/Rn2V2xZWhX/rdj36fhYgNcyBTw8edQvB9dbr+8raprzL3YEai+ZcWY+WUf5upPMOv50Zkp7CZ3KvwCks+Pmpx6qCTUWvUHJrHZ2OQJPeyfTzZCi56isaMQT3WebeHu2+AoZu4ZtMTGNrBanUOqIyIfLLxB7mhK+N1TIS7BjwT1EPpRzjDSrOTzoU1B+vT1dwcZSivFrLHlECV3sQONSQAocW3ZJpPZEkK1Z2JEyVrtWZzzbK/bh18PCY9nQmT5EzBCi8e+or29Hts0q1NKN6ibv16MLh8gaPkaylieaHcIme0lm4OsPu6lOSW1A79biIDjpFDAm5g7IDnfbeQhtGEBI9xJEyYc+/hskj5Dg7+otmQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(39840400004)(136003)(346002)(376002)(396003)(451199015)(478600001)(83380400001)(86362001)(6486002)(4326008)(8676002)(66476007)(66556008)(66946007)(54906003)(316002)(107886003)(6666004)(52116002)(36756003)(6506007)(8936002)(5660300002)(6512007)(41300700001)(26005)(110136005)(38350700002)(38100700002)(1076003)(186003)(2616005)(44832011)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H7MVOwXT17n0PCA4cBUxZ8vnoco9EIHUcG1+H2+OBJz4UQCdsuApEGyDBOT8iiHFWAHrgO7Rb+fkI3508kuNgfy8U8y/pJuVOgEK2i3s3aYavQz2QkWE1oRHYm1AltGqtX5nXToJN5PbXtDuWhxUH/BSy+q0slNWiisGmdap0h47fvBz24sxqF0x8GJjmJLHM9+ttXIjwpDHUuI4ujrRsDlVar+pkwg4HMsfMDaPs7HCquioqWrc+/vezMZfTcSK71s+6GASxLY3UzUQnfVQrT7KqTczINEAuy8tWCT9aHdy7v6BsGqoMSahQ8Ux24aRihiybjwyCbwyFbGlClNyQCI3fWLLXykW/F0esiih+wHWyMclv6cyo4yyk1yig/IqCDJ64ZE+NvTLoudu3NS+x78oKishjdpAuraK2Gck4pe7S9CcifDtEzAtkt7Yee5WbpgHGJO5QBu4sUtROzf+g1piOqUsnSQtKSA9MMWQ7VyWph9/kpnBiTu185VnNq0h4iqHblXeZIOY/5vdnkedF8LVSC7nttRc6RVtSUPiqcIVjkSSlrj+hoDMrTtIJiw3w22Iq7LoSIczWKLZRc/HqnOBNvK/WvhB0gV+Td0A0QNM4DFZrNztgvYvqWE6k5c1qZ+mzj64vxPlxPC5dIpeLGoMeH97c8AYz1k4qfayC1/W7ZjluY6t5vOPxqJ7FYW1hrdpNAujRPdQ9QLN8NVKju34kXxDhwBfLHlYmrk8LVR4jAaTJRPJQaYHSVeDCSaad5lLMmb8+iu/frgJye5kebfu11bT/xLk09wId4HsMs8lX7LQDzexfxI1DlTmSqmp0b8hD78k6iWzhYi7/UPisbFgPdDKSkZXAHjwQ5kJqsrejM3jkXLPGe5SS2Ix84URmPPp7yihUSafX3JbPP+WR5hOqECfoeGczPCFp/fLV3EliukK+6makIgsCUQQOPS/mIXjrYZvvReULeKk2Se0gTvM4xwGv9bz6TIKQaue+V5UqVIDcCqWOkec5XUJMfe0xmQcD9+h4IEqKOGnTnK5wsZXC5S8H6zIEy+KrfX7feQRdKOBlXTDVBv8r5DufqrJ0SJ3jyM50bdtkCajK1FopkGbFhaW0txdFfDMlUdpX859x8dnslrFp4koWtSS9LlfUsJ3wFvYWv+NBjQvKd8QzOTmUvdhCftgNegngP/yF/yVDH46Y6rIrNxpLUH9W8rr+MuuRvKgs9y50N9fT1i4v36vnr6a30GbIsE/ywTOYAnY3eBAxesSxOkj+wRbnGeDbe2Yx64RuwBvqq9/CBMQsrnvkPcAhbpbnLgpLR24zs8KSVPSmoqB9et7OvBT+rGPG2IVnz2/Qt6CnzGc9bnwWIYQFluBcS/0YB+5TisCyAviOBdYaY5I/1yFNMnFajd3mTOx6OEf+XyciwvVfCYi5X2nsK4i6nVlxkSypsoT/fECNdXch+aUHLbKAVcN6k3CcACbJPvDIJdSF2pWCem/MCIMdwnyM9paJDDTR0HU/p5EZwx0qWgiBjXtS42EOpmk40cB3ZhEbgFVQWQkp/igMuV2FLHlAXCSLCGAUrNICFEjAop3FVyWL3MaK5PTrlVfb6defTbju6NMmQWc5GOsDQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae6d7c2a-e2c0-47a5-d6e9-08dab3bd4562 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 23:37:52.2205 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: suPU0mrIeQlNi4o8XOH+vqkIVR0LnuFSrL/ki00oyhaV6AZWnblxCDZ9Uey84APvqsU6oETXfMwRRbSfqgkIKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB6656 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 ; Fri, 21 Oct 2022 23:38:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/172054 In preparation for the next commit, split off several Signed-off-by: Sean Anderson --- meta/classes-recipe/kernel-fitimage.bbclass | 25 +++++++++++++++++++++ meta/classes-recipe/uboot-config.bbclass | 3 +++ meta/classes-recipe/uboot-sign.bbclass | 19 ++++------------ 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 8ddebf8dd8..e4a130a0f2 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -65,6 +65,31 @@ python __anonymous () { # Description string FIT_DESC ?= "Kernel fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}" +# Kernel fitImage Hash Algo +FIT_HASH_ALG ?= "sha256" + +# Kernel fitImage Signature Algo +FIT_SIGN_ALG ?= "rsa2048" + +# Kernel / U-Boot fitImage Padding Algo +FIT_PAD_ALG ?= "pkcs-1.5" + +# Generate keys for signing Kernel fitImage +FIT_GENERATE_KEYS ?= "0" + +# Size of private keys in number of bits +FIT_SIGN_NUMBITS ?= "2048" + +# args to openssl genrsa (Default is just the public exponent) +FIT_KEY_GENRSA_ARGS ?= "-F4" + +# args to openssl req (Default is -batch for non interactive mode and +# -new for new certificate) +FIT_KEY_REQ_ARGS ?= "-batch -new" + +# Standard format for public key certificate +FIT_KEY_SIGN_PKCS ?= "-x509" + # Sign individual images as well FIT_SIGN_INDIVIDUAL ?= "0" diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass index 7ab006a20d..73dc464444 100644 --- a/meta/classes-recipe/uboot-config.bbclass +++ b/meta/classes-recipe/uboot-config.bbclass @@ -80,6 +80,9 @@ SPL_MKIMAGE_DTCOPTS ??= "" UBOOT_MKIMAGE ?= "uboot-mkimage" UBOOT_MKIMAGE_SIGN ?= "${UBOOT_MKIMAGE}" +# Signature activation - this requires KERNEL_IMAGETYPE = "fitImage" +UBOOT_SIGN_ENABLE ?= "0" + # Arguments passed to mkimage for signing UBOOT_MKIMAGE_SIGN_ARGS ?= "" SPL_MKIMAGE_SIGN_ARGS ?= "" diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass index 85e23b963f..569907fa68 100644 --- a/meta/classes-recipe/uboot-sign.bbclass +++ b/meta/classes-recipe/uboot-sign.bbclass @@ -43,8 +43,7 @@ inherit uboot-config # Enable use of a U-Boot fitImage UBOOT_FITIMAGE_ENABLE ?= "0" -# Signature activation - these require their respective fitImages -UBOOT_SIGN_ENABLE ?= "0" +# Signature activation - this requires UBOOT_FITIMAGE_ENABLE = "1" SPL_SIGN_ENABLE ?= "0" # Default value for deployment filenames. @@ -71,36 +70,26 @@ SPL_NODTB_SYMLINK ?= "u-boot-spl-nodtb-${MACHINE}.bin" # U-Boot fitImage description UBOOT_FIT_DESC ?= "U-Boot fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}" -# Kernel / U-Boot fitImage Hash Algo -FIT_HASH_ALG ?= "sha256" +# U-Boot fitImage Hash Algo UBOOT_FIT_HASH_ALG ?= "sha256" -# Kernel / U-Boot fitImage Signature Algo -FIT_SIGN_ALG ?= "rsa2048" +# U-Boot fitImage Signature Algo UBOOT_FIT_SIGN_ALG ?= "rsa2048" -# Kernel / U-Boot fitImage Padding Algo -FIT_PAD_ALG ?= "pkcs-1.5" - -# Generate keys for signing Kernel / U-Boot fitImage -FIT_GENERATE_KEYS ?= "0" +# Generate keys for signing U-Boot fitImage UBOOT_FIT_GENERATE_KEYS ?= "0" # Size of private keys in number of bits -FIT_SIGN_NUMBITS ?= "2048" UBOOT_FIT_SIGN_NUMBITS ?= "2048" # args to openssl genrsa (Default is just the public exponent) -FIT_KEY_GENRSA_ARGS ?= "-F4" UBOOT_FIT_KEY_GENRSA_ARGS ?= "-F4" # args to openssl req (Default is -batch for non interactive mode and # -new for new certificate) -FIT_KEY_REQ_ARGS ?= "-batch -new" UBOOT_FIT_KEY_REQ_ARGS ?= "-batch -new" # Standard format for public key certificate -FIT_KEY_SIGN_PKCS ?= "-x509" UBOOT_FIT_KEY_SIGN_PKCS ?= "-x509" # Functions on this bbclass can apply to either U-boot or Kernel, From patchwork Fri Oct 21 23:37:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 14316 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 05F40C3A59D for ; Fri, 21 Oct 2022 23:38:01 +0000 (UTC) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.78]) by mx.groups.io with SMTP id smtpd.web10.1487.1666395471881117197 for ; Fri, 21 Oct 2022 16:37:58 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@seco.com header.s=selector1 header.b=F+ZaJqXB; spf=pass (domain: seco.com, ip: 40.107.6.78, mailfrom: sean.anderson@seco.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CgAZwduN1vJOohb26ITuQ/3owncqC9kfYdLMStqtwH6jGnWVhMVbBnEjMSIu+wO2vGN0Fi1QfVfIATUHwo20mFo/MDMHy2FI/S+4gD5mtMTlApV3xrVvtOWdBMau33RtUSHkA4xRS/A7iiUv6CvC+oE5e3tj7CJYAwy44NG7LMGHvZmkNMk8a0bHPj6ndCf0pqY7EKp9Xu25xzib0a8GPayhMrMx8alIg4RAJT3+i84R+acatZLg54K+nAStrbh3uCVQXLe8BAbseJLrxG9cfqCLHhDHjUSCZSaSu0hJOlADaL6hSdNBjv8TGLfPoYGB0A5soBkGrIl2Kxn0mEY4Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=f0y3Yl6U95BEgrI2a79NpVydkpSn8z3+nFG1aDpnJwg=; b=KG5N7aZro6jmfmaH3VLkPIPJVHXKYN+EjW/dXLlxC8bGHXpf3xeOadXf0a1Edy/6oAJYDJkY9d7BDtv8kcafmm+qvzQIJb7yxVAz/CCiIOWy80YV+Bfg2xnfDRhpa5alh1aHIdEo75WiiejHFyqGGpXpY4mRQdYXlKwPAqlv4Z6PXLAXKAzexTRbXtuFrRHa0iJGiVKKhOk98qlktCv2S88opBDop1eVCrxdsyqbbkA+EysHd+qgD95H2qd7AgZkDy9G6mxOPi6CZq92+H4LjXesrCBNN4paV9GoUSYe/KuXlSrpCkwACT2MR2r90CMBOvlIGYa65xuwuW/CNKuNqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f0y3Yl6U95BEgrI2a79NpVydkpSn8z3+nFG1aDpnJwg=; b=F+ZaJqXB6sVRYCpYgOOL2dQs83FONFDzaEY0ZaPVbXv8gYRvm3fWRvf9AbyTOsjwNNVe6R/dga72C6AiiqUzUrTNfKbMBFzo8Y4kMXg4pwKaOHmLwM9oNAnohNf1RgeB4pjGX9sdyBwM7a2brF++yIm5x0Obhb775800rPfcSm+QTA5nVES2Y4zuECOB7pO3x/A0zjF/5FpNMskdH3V1SBg0typLTqJUiXy8qpCQp4WPNcXgCMn2E+H05hJhrDigoDasnbr2TREL5FTEnuChcKVHsciT2PZ6VdNaTnhwPdro9aOvclN7KUYXWsUwOXvvb3U2q6FBBLboGVS2BGz+yA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by VI1PR0301MB6656.eurprd03.prod.outlook.com (2603:10a6:800:17f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Fri, 21 Oct 2022 23:37:53 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d%6]) with mapi id 15.20.5723.034; Fri, 21 Oct 2022 23:37:53 +0000 From: Sean Anderson To: Alexandre Belloni , Richard Purdie , openembedded-core@lists.openembedded.org CC: Luca Ceresoli , Klaus Heinrich Kiwi , Sean Anderson Subject: [PATCH 6/6] u-boot: Rework signing to remove interdependencies Date: Fri, 21 Oct 2022 19:37:26 -0400 Message-ID: <20221021233726.1751124-7-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221021233726.1751124-1-sean.anderson@seco.com> References: <20221021233726.1751124-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0012.namprd11.prod.outlook.com (2603:10b6:208:23b::17) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|VI1PR0301MB6656:EE_ X-MS-Office365-Filtering-Correlation-Id: 1693252a-35c0-4b65-a45c-08dab3bd4615 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: znVg7z8aZ/HcKdtFmLEWmGAFHvFl6anNr82Dpy21YXHlOdFmK07mAnqOCtAoT2mz2YrNlzb/Uyek64Hc0ia1Rx07d6Gw2iGdb9ZDK7gFZ6DMOGnWCvALbT+dMwyS9x4tiA1RGN+kn75j5hZoaehe+HgwTjH7HFrqgFPu8Ovm9wm/+9tJlXsHIgTP4IElC6d6FzSBX61jBjnEm4KXuh+ZAiK6/BUIWgsxE+6vKQ6ZBq6owqHniT3gsqsQnw83/qLW4RbMM4d1T1VFCMT5aqNCQL7XFCrJMIXcg587BNBW/QbqKLj63J6HsXfM6I+0QdSpvJ+euuTpz7SHwNY4tIthHnT/uUlQ9901XtxFCkIqcukC67fBo7GDpiAtFsA6/975OhJ+TL/4+dStHf/Nq77FYeoIaHoY9M/RE9NcMFxZwWjm93xJVQ6qo7YIDpRZNeLebhHg8xpa80vLmyFiFaprDVAM0xk0fBksgI/Ved97jC/s5Ggl+uyumnF9izXFWJ9t3twJeGPgrADcRW7NAaftu+A3U2UoLXJ2oisjkvrj8tgsyj9rPKGR1u3VUHJJcJQOVY+eHKReXRfW11MiGC6tFWwV56ojYFUchjJ1qZvu+4pF3XsQ9/FHBo2z9dHvHxPIPBgvVAU21WZunlMi8X+gRNKwd862TCqLQ34njxahUJEDe3fGNIdQ7iWwugDoFMLbfF9O0sya9kdEXJdsFQIMaAIYKucGRCGX3kPoU+tJNGBiK+JjZ3UTI/ZWoFRvQjH+L8Ila/BmVB/BD/ZsvxFImQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(39840400004)(136003)(346002)(376002)(396003)(451199015)(478600001)(83380400001)(66899015)(86362001)(6486002)(4326008)(8676002)(66476007)(66556008)(66946007)(54906003)(316002)(107886003)(6666004)(52116002)(36756003)(6506007)(8936002)(5660300002)(6512007)(41300700001)(26005)(110136005)(38350700002)(38100700002)(1076003)(186003)(2616005)(44832011)(2906002)(30864003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ThqpV1YbQz3LzphMZLisWsRMIWaZkT9Rmv3EcXLnI5dgd0sqimCsgGXkuAKGloweuZ/VUOs463uj+r2ov10bMEWGNGH9EL2Al9/A/+vMIdBMlsA7rsZxUxSD/Mm7/evBUEawxM6xcYmlepvPmknnn3BJ/tpsyQvntDDbiTjtxLNOQWrD2uA9Xnu2S2n/UTlZ44D4l2D4nyr/Gb8Fq6KJrEk8EWZ2qUjVdTtzaXb/LwgH9wTETBAJoNrcInQepPi8bPaCTuOYN583ixW73Muq2Phs/+yGA9E8xE1mtzPv6WNdfgMq7rhf/jMqKgLQfucoopdo0cLVUXC45xtVYEMIae3H9+UOZZKu8AS7xttBWS+onMP7DAMGFk09sbaFkmIwNg+kqsPMF75hdveFPZzrfhHtb4fKOL4kgqvIeUymUQAe6m5w/1629D/hqmritNjjIn3qFammGiQrZPPH7v7aUqIt2ihIu2LNTWWJK0XVbNyo7n7lsO3CnNwo4KtolP4/34lg6s6bbZY5WSm5aIUr1QeSmEO+FksXe18GvOLgD4zpaeB3594+vd6WTij5PKjxfV74nlIgD4X3nc3YuAVWRKg9+4elBy+P0oJZanEMUflEDAAcD255ktExcSHw7ucUi7P+muuRlCq9WIpc2sTaDiTUFL/05XobUZZ970E6SamPnMCd8hI19hLgwirMW1kiDvSvI8Ts0xGUj0NODcSNa+xWDtP5WHPSgMzYFb2QQjGqPpZ2tmB1uCP0rg4WkRQeU5RxJfIYIP/aiK6he8w+L6Ug2ozzfuNduPRiY9xDSSyTKFxDxv9K7ho1v3TXtJDZDGrsiQkWVjUuL3WepchJzOUelY7fI0zzXG7JX51Vn1CwDDewgIALRchoB4+VLUdaTd0B8M4fj2JgbnffK2QZqOq8+wHYGxb9glJs//fOztqDn3OTiBO9gHApcRfL2X1/a6ctBIWA9myNs8bBGIFhRy2sL3LN9/IVZtZiL6i+0qGmuIL0WFz3Ub6/xnrjMAHuXoXUOzvkMp7bN/c+iVP/hLGPyJrsc1w3UGOQ48Oelcn1dVq8DaGPsuiJ9Cshf66E7/ud34QQHmK+Mv275Epynn+in5gFc+WWzmM1OQ7flYST9Cvg+CvsppIdo3ASf06AvN7kLkzgvi5d+8K9Pa1Ow9MRVR28HdjTI5IaQul8mRUmEhPOc4kIP5//ODlkv6XwTMS99QHTr0nhodfD6UVOJRcsE1HHLQVDCuXabVA0NI6r+HjgXxzfSNC1dXQG17PFdSCtdVbLVD6HUieQl2ThxwJRdIHyXmo7+y5/kA1cPB6dKqiy2g/PT+KZC32tJy1C2CNi5Z0vQ/YtLpB8bB06a7ihF5oZf33H/VRGHT+dbEpEBLEUM8WZ7BXtkT66Y1s8lEz9Pk5wysSLhInAevi9wHs7fZwPBxOo22aggHfXR00i/oNe8w6Do8Pxf2602o/sDQ+xmK+/+OiA9aBVLpjX2tJryzxZeDaZhSrGWmF03wUGpHO7e4Rm6tFQB4WeODMLJdC3bpCmUSWSEQgVfAP4d3UvKRp3u1OnGWXg0Ae0GVPOlTFXb68nSdBsvBzOkKRv61Q+wmEepymjdFpjX14Z9g== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1693252a-35c0-4b65-a45c-08dab3bd4615 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 23:37:53.4391 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OhXZPoF6ic07qIIQumLZI9Iv6xhyAscjSaDU0A5rwAzwoRY3kRDj0ClM7tJS9jMFZvS5pBI/fmdeoJKBw1t0+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB6656 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 ; Fri, 21 Oct 2022 23:38:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/172055 The U-Boot signing code is a bit of a mess. The problem is that mkimage determines the public keys to embed into a device tree based on an image that it is signing. This results in all sorts of contortions: U-Boot has to be available to the kernel recipe so that it can have the correct public keys embedded. Then, the signed U-Boot has to be made available to U-Boot's do_deploy. This same dance is then repeated for SPL. To complicate matters, signing for U-Boot and U-Boot SPL is optional, so the whole process must be seamlessly integrated with a non-signed build. The complexity and interdependency of this process makes it difficult to extend. For example, it is not possible to install a signed U-Boot binary into the root filesystem. This is first because u-boot:do_install must run before linux:do_assemble_fitimage, which must run before u-boot:do_deploy. But aside from infrastructure issues, installing a signed U-Boot also can't happen, because the kernel image might have an embedded initramfs (containing the signed U-Boot). However, all of this complexity is accidental. It is not necessary to embed the public keys into U-Boot and sign the kernel in one fell swoop. Instead, we can sign the kernel, stage it, and sign the staged kernel again to embed the public keys into U-Boot [1]. This twice-signed kernel serves only to provide the correct parameters to mkimage, and does not have to be installed or deployed. By cutting the dependency of linux:do_assemble_fitimage on u-boot:do_install, we can drastically simplify the build process, making it much more extensible. The process of doing this conversion is a bit involved, since the U-Boot and Linux recipes are so intertwined at the moment. The most major change is that uboot-sign is no longer inherited by kernel-fitimage. Similarly, all U-Boot-related tasks have been removed from kernel-fitimage. We add a new step to the install task to stage the kernel in /sysroot-only. The logic to disable assemble_fitimage has been removed. We always assemble it, even if the final fitImage will use a bundled initramfs, because U-Boot will need it. On the U-Boot side, much of the churn stems from multiple config support. Previously, we took a fairly ad-hoc approach to UBOOT_CONFIG and UBOOT_MACHINE, introducing for loops wherever we needed to deal with them. However, I have chosen to use a much more structured approach. Each task which needs to use the build directory uses the following pseudocode: do_mytask() { if ${UBOOT_CONFIG}; then for config, type in zip(${UBOOT_CONFIG}, ${UBOOT_MACHINE}); do cd ${config} mytask_helper ${type} done else cd ${B} mytask_helper "" fi } By explicitly placing the work in mytask_helper, we make it easier to ensure that everything is covered, and we also allow bbappends files to more easily extend the task (as otherwise they would need to reimplement the loop themselves). [1] It doesn't particularly matter what we sign. Any FIT will do, but I chose the kernel's because we already went to the trouble of setting it up with the correct hashes and signatures. In the future, we could create a "dummy" image and sign that instead, but it would probably have to happen in the kernel recipe anyway (so we have access to the appropriate variables). Signed-off-by: Sean Anderson --- meta/classes-recipe/kernel-fitimage.bbclass | 68 +--- meta/classes-recipe/uboot-config.bbclass | 3 + meta/classes-recipe/uboot-sign.bbclass | 421 +++++++++----------- meta/lib/oeqa/selftest/cases/fitimage.py | 29 +- meta/recipes-bsp/u-boot/u-boot.inc | 3 - 5 files changed, 226 insertions(+), 298 deletions(-) diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index e4a130a0f2..befdf2568c 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass @@ -4,7 +4,7 @@ # SPDX-License-Identifier: MIT # -inherit kernel-uboot kernel-artifact-names uboot-sign +inherit kernel-uboot kernel-artifact-names uboot-config def get_fit_replacement_type(d): kerneltypes = d.getVar('KERNEL_IMAGETYPES') or "" @@ -50,15 +50,6 @@ python __anonymous () { 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") - - # Verified boot will sign the fitImage and append the public key to - # U-Boot dtb. We ensure the U-Boot dtb is deployed before assembling - # the fitImage: - if d.getVar('UBOOT_SIGN_ENABLE') == "1" and d.getVar('UBOOT_DTB_BINARY'): - uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot' - d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_populate_sysroot' % uboot_pn) - if d.getVar('INITRAMFS_IMAGE_BUNDLE') == "1": - d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' %s:do_populate_sysroot' % uboot_pn) } @@ -678,20 +669,12 @@ fitimage_assemble() { ${KERNEL_OUTPUT_DIR}/$2 # - # Step 8: Sign the image and add public key to U-Boot dtb + # Step 8: Sign the image # if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then - add_key_to_u_boot="" - if [ -n "${UBOOT_DTB_BINARY}" ]; then - # The u-boot.dtb is a symlink to UBOOT_DTB_IMAGE, so we need copy - # both of them, and don't dereference the symlink. - cp -P ${STAGING_DATADIR}/u-boot*.dtb ${B} - add_key_to_u_boot="-K ${B}/${UBOOT_DTB_BINARY}" - fi ${UBOOT_MKIMAGE_SIGN} \ ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ -F -k "${UBOOT_SIGN_KEYDIR}" \ - $add_key_to_u_boot \ -r ${KERNEL_OUTPUT_DIR}/$2 \ ${UBOOT_MKIMAGE_SIGN_ARGS} fi @@ -700,18 +683,30 @@ fitimage_assemble() { do_assemble_fitimage() { if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then cd ${B} - fitimage_assemble fit-image.its fitImage "" + fitimage_assemble fit-image.its fitImage-none "" + if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then + ln -sf fitImage-none ${B}/${KERNEL_OUTPUT_DIR}/fitImage + fi fi } addtask assemble_fitimage before do_install after do_compile +SYSROOT_DIRS:append = " /sysroot-only" +do_install:append() { + if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \ + [ "${UBOOT_SIGN_ENABLE}" = "1" ]; then + install -D ${B}/${KERNEL_OUTPUT_DIR}/fitImage-none ${D}/sysroot-only/fitImage + fi +} + 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 "" + 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 @@ -802,35 +797,4 @@ kernel_do_deploy:append() { fi fi fi - if [ "${UBOOT_SIGN_ENABLE}" = "1" -o "${UBOOT_FITIMAGE_ENABLE}" = "1" ] && \ - [ -n "${UBOOT_DTB_BINARY}" ] ; then - # UBOOT_DTB_IMAGE is a realfile, but we can't use - # ${UBOOT_DTB_IMAGE} since it contains ${PV} which is aimed - # for u-boot, but we are in kernel env now. - install -m 0644 ${B}/u-boot-${MACHINE}*.dtb "$deployDir/" - fi - if [ "${UBOOT_FITIMAGE_ENABLE}" = "1" -a -n "${UBOOT_BINARY}" -a -n "${SPL_DTB_BINARY}" ] ; then - # If we're also creating and/or signing the uboot fit, now we need to - # deploy it, it's its file, as well as u-boot-spl.dtb - install -m 0644 ${B}/u-boot-spl-${MACHINE}*.dtb "$deployDir/" - bbnote "Copying u-boot-fitImage file..." - install -m 0644 ${B}/u-boot-fitImage-* "$deployDir/" - bbnote "Copying u-boot-its file..." - install -m 0644 ${B}/u-boot-its-* "$deployDir/" - fi -} - -# The function below performs the following in case of initramfs bundles: -# - Removes do_assemble_fitimage. FIT generation is done through -# do_assemble_fitimage_initramfs. do_assemble_fitimage is not needed -# and should not be part of the tasks to be executed. -# - Since do_kernel_generate_rsa_keys is inserted by default -# between do_compile and do_assemble_fitimage, this is -# not suitable in case of initramfs bundles. do_kernel_generate_rsa_keys -# should be between do_bundle_initramfs and do_assemble_fitimage_initramfs. -python () { - if d.getVar('INITRAMFS_IMAGE_BUNDLE') == "1": - bb.build.deltask('do_assemble_fitimage', d) - bb.build.deltask('kernel_generate_rsa_keys', d) - bb.build.addtask('kernel_generate_rsa_keys', 'do_assemble_fitimage_initramfs', 'do_bundle_initramfs', d) } diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass index 73dc464444..fb7a4bc498 100644 --- a/meta/classes-recipe/uboot-config.bbclass +++ b/meta/classes-recipe/uboot-config.bbclass @@ -19,6 +19,9 @@ def removesuffix(s, suffix): return s[:-len(suffix)] return s +UBOOT_ENTRYPOINT ?= "20008000" +UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" + # Some versions of u-boot use .bin and others use .img. By default use .bin # but enable individual recipes to change this value. UBOOT_SUFFIX ??= "bin" diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass index 569907fa68..3dc029c429 100644 --- a/meta/classes-recipe/uboot-sign.bbclass +++ b/meta/classes-recipe/uboot-sign.bbclass @@ -5,7 +5,7 @@ # # This file is part of U-Boot verified boot support and is intended to be -# inherited from u-boot recipe and from kernel-fitimage.bbclass. +# inherited from the u-boot recipe. # # The signature procedure requires the user to generate an RSA key and # certificate in a directory and to define the following variable: @@ -22,19 +22,6 @@ # # The signature support is limited to the use of CONFIG_OF_SEPARATE in U-Boot. # -# The tasks sequence is set as below, using DEPLOY_IMAGE_DIR as common place to -# treat the device tree blob: -# -# * u-boot:do_install:append -# Install UBOOT_DTB_BINARY to datadir, so that kernel can use it for -# signing, and kernel will deploy UBOOT_DTB_BINARY after signs it. -# -# * virtual/kernel:do_assemble_fitimage -# Sign the image -# -# * u-boot:do_deploy[postfuncs] -# Deploy files like UBOOT_DTB_IMAGE, UBOOT_DTB_SYMLINK and others. -# # For more details on signature process, please refer to U-Boot documentation. # We need some variables from u-boot-config @@ -49,6 +36,7 @@ SPL_SIGN_ENABLE ?= "0" # Default value for deployment filenames. UBOOT_DTB_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.dtb" UBOOT_DTB_BINARY ?= "u-boot.dtb" +UBOOT_DTB_SIGNED ?= "${UBOOT_DTB_BINARY}-signed" UBOOT_DTB_SYMLINK ?= "u-boot-${MACHINE}.dtb" UBOOT_NODTB_IMAGE ?= "u-boot-nodtb-${MACHINE}-${PV}-${PR}.bin" UBOOT_NODTB_BINARY ?= "u-boot-nodtb.bin" @@ -62,6 +50,7 @@ UBOOT_FITIMAGE_SYMLINK ?= "u-boot-fitImage-${MACHINE}" SPL_DIR ?= "spl" SPL_DTB_IMAGE ?= "u-boot-spl-${MACHINE}-${PV}-${PR}.dtb" SPL_DTB_BINARY ?= "u-boot-spl.dtb" +SPL_DTB_SIGNED ?= "${SPL_DTB_BINARY}-signed" SPL_DTB_SYMLINK ?= "u-boot-spl-${MACHINE}.dtb" SPL_NODTB_IMAGE ?= "u-boot-spl-nodtb-${MACHINE}-${PV}-${PR}.bin" SPL_NODTB_BINARY ?= "u-boot-spl-nodtb.bin" @@ -92,58 +81,48 @@ UBOOT_FIT_KEY_REQ_ARGS ?= "-batch -new" # Standard format for public key certificate UBOOT_FIT_KEY_SIGN_PKCS ?= "-x509" -# Functions on this bbclass can apply to either U-boot or Kernel, -# depending on the scenario -UBOOT_PN = "${@d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'}" -KERNEL_PN = "${@d.getVar('PREFERRED_PROVIDER_virtual/kernel')}" +# This is only necessary for determining the signing configuration +KERNEL_PN = "${PREFERRED_PROVIDER_virtual/kernel}" -# We need u-boot-tools-native if we're creating a U-Boot fitImage python() { - if d.getVar('UBOOT_FITIMAGE_ENABLE') == '1': - depends = d.getVar("DEPENDS") - depends = "%s u-boot-tools-native dtc-native" % depends - d.setVar("DEPENDS", depends) + # We need u-boot-tools-native if we're creating a U-Boot fitImage + sign = d.getVar('UBOOT_SIGN_ENABLE') == '1' + if d.getVar('UBOOT_FITIMAGE_ENABLE') == '1' or sign: + d.appendVar('DEPENDS', " u-boot-tools-native dtc-native") + if sign: + d.appendVar('DEPENDS', " " + d.getVar('KERNEL_PN')) } -concat_dtb_helper() { +concat_dtb() { + type="$1" + binary="$2" + if [ -e "${UBOOT_DTB_BINARY}" ]; then - ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_BINARY} - ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_SYMLINK} - fi - - if [ -f "${UBOOT_NODTB_BINARY}" ]; then - install ${UBOOT_NODTB_BINARY} ${DEPLOYDIR}/${UBOOT_NODTB_IMAGE} - ln -sf ${UBOOT_NODTB_IMAGE} ${DEPLOYDIR}/${UBOOT_NODTB_SYMLINK} - ln -sf ${UBOOT_NODTB_IMAGE} ${DEPLOYDIR}/${UBOOT_NODTB_BINARY} + # Re-sign the kernel in order to add the keys to our dtb + ${UBOOT_MKIMAGE_SIGN} \ + ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ + -F -k "${UBOOT_SIGN_KEYDIR}" \ + -K "${UBOOT_DTB_BINARY}" \ + -r ${B}/fitImage-linux \ + ${UBOOT_MKIMAGE_SIGN_ARGS} + cp ${UBOOT_DTB_BINARY} ${UBOOT_DTB_SIGNED} fi # If we're not using a signed u-boot fit, concatenate SPL w/o DTB & U-Boot DTB - # with public key (otherwise it will be deployed by the equivalent - # concat_spl_dtb_helper function - cf. kernel-fitimage.bbclass for more details) + # with public key (otherwise U-Boot will be packaged by uboot_fitimage_assemble) if [ "${SPL_SIGN_ENABLE}" != "1" ] ; then - deployed_uboot_dtb_binary='${DEPLOY_DIR_IMAGE}/${UBOOT_DTB_IMAGE}' if [ "x${UBOOT_SUFFIX}" = "ximg" -o "x${UBOOT_SUFFIX}" = "xrom" ] && \ - [ -e "$deployed_uboot_dtb_binary" ]; then - oe_runmake EXT_DTB=$deployed_uboot_dtb_binary - install ${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE} - elif [ -e "${DEPLOYDIR}/${UBOOT_NODTB_IMAGE}" -a -e "$deployed_uboot_dtb_binary" ]; then - cd ${DEPLOYDIR} - cat ${UBOOT_NODTB_IMAGE} $deployed_uboot_dtb_binary | tee ${B}/${CONFIG_B_PATH}/${UBOOT_BINARY} > ${UBOOT_IMAGE} - - if [ -n "${UBOOT_CONFIG}" ] - then - i=0 - j=0 - for config in ${UBOOT_MACHINE}; do - i=$(expr $i + 1); - for type in ${UBOOT_CONFIG}; do - j=$(expr $j + 1); - if [ $j -eq $i ] - then - cp ${UBOOT_IMAGE} ${B}/${CONFIG_B_PATH}/u-boot-$type.${UBOOT_SUFFIX} - fi - done - done + [ -e "${UBOOT_DTB_BINARY}" ]; then + oe_runmake EXT_DTB="${UBOOT_DTB_SIGNED}" ${UBOOT_MAKE_TARGET} + if [ -n "${binary}" ]; then + cp ${binary} ${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} + fi + elif [ -e "${UBOOT_NODTB_BINARY}" -a -e "${UBOOT_DTB_BINARY}" ]; then + if [ -n "${binary}" ]; then + cat ${UBOOT_NODTB_BINARY} ${UBOOT_DTB_SIGNED} | tee ${binary} > \ + ${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} + else + cat ${UBOOT_NODTB_BINARY} ${UBOOT_DTB_SIGNED} > ${UBOOT_BINARY} fi else bbwarn "Failure while adding public key to u-boot binary. Verified boot won't be available." @@ -151,120 +130,67 @@ concat_dtb_helper() { fi } -concat_spl_dtb_helper() { +deploy_dtb() { + type="$1" - # We only deploy symlinks to the u-boot-spl.dtb,as the KERNEL_PN will - # be responsible for deploying the real file - if [ -e "${SPL_DIR}/${SPL_DTB_BINARY}" ] ; then - ln -sf ${SPL_DTB_IMAGE} ${DEPLOYDIR}/${SPL_DTB_SYMLINK} - ln -sf ${SPL_DTB_IMAGE} ${DEPLOYDIR}/${SPL_DTB_BINARY} - fi - - # Concatenate the SPL nodtb binary and u-boot.dtb - deployed_spl_dtb_binary='${DEPLOY_DIR_IMAGE}/${SPL_DTB_IMAGE}' - if [ -e "${DEPLOYDIR}/${SPL_NODTB_IMAGE}" -a -e "$deployed_spl_dtb_binary" ] ; then - cd ${DEPLOYDIR} - cat ${SPL_NODTB_IMAGE} $deployed_spl_dtb_binary | tee ${B}/${CONFIG_B_PATH}/${SPL_BINARY} > ${SPL_IMAGE} + if [ -n "${type}" ]; then + uboot_dtb_binary="u-boot-${type}-${PV}-${PR}.dtb" + uboot_nodtb_binary="u-boot-nodtb-${type}-${PV}-${PR}.bin" else - bbwarn "Failure while adding public key to spl binary. Verified U-Boot boot won't be available." + uboot_dtb_binary="${UBOOT_DTB_IMAGE}" + uboot_nodtb_binary="${UBOOT_NODTB_IMAGE}" fi -} + if [ -e "${UBOOT_DTB_SIGNED}" ]; then + install -Dm644 ${UBOOT_DTB_SIGNED} ${DEPLOYDIR}/${uboot_dtb_binary} + if [ -n "${type}" ]; then + ln -sf ${uboot_dtb_binary} ${DEPLOYDIR}/${UBOOT_DTB_IMAGE} + fi + fi -concat_dtb() { - if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${PN}" = "${UBOOT_PN}" -a -n "${UBOOT_DTB_BINARY}" ]; then - mkdir -p ${DEPLOYDIR} - if [ -n "${UBOOT_CONFIG}" ]; then - for config in ${UBOOT_MACHINE}; do - CONFIG_B_PATH="$config" - cd ${B}/$config - concat_dtb_helper - done - else - CONFIG_B_PATH="" - cd ${B} - concat_dtb_helper + if [ -f "${UBOOT_NODTB_BINARY}" ]; then + install -Dm644 ${UBOOT_DTB_BINARY} ${DEPLOYDIR}/${uboot_nodtb_binary} + if [ -n "${type}" ]; then + ln -sf ${uboot_nodtb_binary} ${DEPLOYDIR}/${UBOOT_NODTB_IMAGE} fi fi } concat_spl_dtb() { - if [ "${SPL_SIGN_ENABLE}" = "1" -a "${PN}" = "${UBOOT_PN}" -a -n "${SPL_DTB_BINARY}" ]; then - mkdir -p ${DEPLOYDIR} - if [ -n "${UBOOT_CONFIG}" ]; then - for config in ${UBOOT_MACHINE}; do - CONFIG_B_PATH="$config" - cd ${B}/$config - concat_spl_dtb_helper - done - else - CONFIG_B_PATH="" - cd ${B} - concat_spl_dtb_helper - fi + if [ -e "${SPL_DIR}/${SPL_NODTB_BINARY}" -a -e "${SPL_DIR}/${SPL_DTB_BINARY}" ] ; then + cat ${SPL_DIR}/${SPL_NODTB_BINARY} ${SPL_DIR}/${SPL_DTB_SIGNED} > "${SPL_BINARY}" + else + bbwarn "Failure while adding public key to spl binary. Verified U-Boot boot won't be available." fi } +deploy_spl_dtb() { + type="$1" -# Install UBOOT_DTB_BINARY to datadir, so that kernel can use it for -# signing, and kernel will deploy UBOOT_DTB_BINARY after signs it. -install_helper() { - if [ -f "${UBOOT_DTB_BINARY}" ]; then - # UBOOT_DTB_BINARY is a symlink to UBOOT_DTB_IMAGE, so we - # need both of them. - install -Dm 0644 ${UBOOT_DTB_BINARY} ${D}${datadir}/${UBOOT_DTB_IMAGE} - ln -sf ${UBOOT_DTB_IMAGE} ${D}${datadir}/${UBOOT_DTB_BINARY} + if [ -n "${type}" ]; then + spl_dtb_binary="u-boot-spl-${type}-${PV}-${PR}.dtb" + spl_nodtb_binary="u-boot-spl-nodtb-${type}-${PV}-${PR}.bin" else - bbwarn "${UBOOT_DTB_BINARY} not found" + spl_dtb_binary="${SPL_DTB_IMAGE}" + spl_nodtb_binary="${SPL_NODTB_IMAGE}" fi -} -# Install SPL dtb and u-boot nodtb to datadir, -install_spl_helper() { - if [ -f "${SPL_DIR}/${SPL_DTB_BINARY}" ]; then - install -Dm 0644 ${SPL_DIR}/${SPL_DTB_BINARY} ${D}${datadir}/${SPL_DTB_IMAGE} - ln -sf ${SPL_DTB_IMAGE} ${D}${datadir}/${SPL_DTB_BINARY} - else - bbwarn "${SPL_DTB_BINARY} not found" - fi - if [ -f "${UBOOT_NODTB_BINARY}" ] ; then - install -Dm 0644 ${UBOOT_NODTB_BINARY} ${D}${datadir}/${UBOOT_NODTB_IMAGE} - ln -sf ${UBOOT_NODTB_IMAGE} ${D}${datadir}/${UBOOT_NODTB_BINARY} - else - bbwarn "${UBOOT_NODTB_BINARY} not found" + if [ -e "${SPL_DIR}/${SPL_DTB_SIGNED}" ] ; then + install -Dm644 ${SPL_DIR}/${SPL_DTB_SIGNED} ${DEPLOYDIR}/${spl_dtb_binary} + if [ -n "${type}" ]; then + ln -sf ${spl_dtb_binary} ${DEPLOYDIR}/${SPL_DTB_IMAGE} + fi fi - # We need to install a 'stub' u-boot-fitimage + its to datadir, - # so that the KERNEL_PN can use the correct filename when - # assembling and deploying them - touch ${D}/${datadir}/${UBOOT_FITIMAGE_IMAGE} - touch ${D}/${datadir}/${UBOOT_ITS_IMAGE} -} - -do_install:append() { - if [ "${PN}" = "${UBOOT_PN}" ]; then - if [ -n "${UBOOT_CONFIG}" ]; then - for config in ${UBOOT_MACHINE}; do - cd ${B}/$config - if [ "${UBOOT_SIGN_ENABLE}" = "1" -o "${UBOOT_FITIMAGE_ENABLE}" = "1" ] && \ - [ -n "${UBOOT_DTB_BINARY}" ]; then - install_helper - fi - if [ "${UBOOT_FITIMAGE_ENABLE}" = "1" -a -n "${SPL_DTB_BINARY}" ]; then - install_spl_helper - fi - done - else - cd ${B} - if [ "${UBOOT_SIGN_ENABLE}" = "1" -o "${UBOOT_FITIMAGE_ENABLE}" = "1" ] && \ - [ -n "${UBOOT_DTB_BINARY}" ]; then - install_helper - fi - if [ "${UBOOT_FITIMAGE_ENABLE}" = "1" -a -n "${SPL_DTB_BINARY}" ]; then - install_spl_helper - fi + if [ -f "${SPL_DIR}/${SPL_NODTB_BINARY}" ] ; then + install -Dm644 ${SPL_DIR}/${SPL_NODTB_BINARY} ${DEPLOYDIR}/${spl_nodtb_binary} + if [ -n "${type}" ]; then + ln -sf ${spl_nodtb_binary} ${DEPLOYDIR}/${SPL_NODTB_IMAGE} fi fi + + # For backwards compatibility... + install -Dm644 ${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE} } do_uboot_generate_rsa_keys() { @@ -300,13 +226,10 @@ addtask uboot_generate_rsa_keys before do_uboot_assemble_fitimage after do_compi # Create a ITS file for the U-boot FIT, for use when # we want to sign it so that the SPL can verify it uboot_fitimage_assemble() { - uboot_its="$(basename ${STAGING_DATADIR}/u-boot-its-*)" - uboot_bin="$(basename ${STAGING_DATADIR}/u-boot-fitImage-*)" - - rm -f $uboot_its $uboot_bin + rm -f ${UBOOT_ITS} ${UBOOT_FITIMAGE_BINARY} # First we create the ITS script - cat << EOF >> $uboot_its + cat << EOF >> ${UBOOT_ITS} /dts-v1/; / { @@ -326,7 +249,7 @@ uboot_fitimage_assemble() { EOF if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then - cat << EOF >> $uboot_its + cat << EOF >> ${UBOOT_ITS} signature { algo = "${UBOOT_FIT_HASH_ALG},${UBOOT_FIT_SIGN_ALG}"; key-name-hint = "${SPL_SIGN_KEYNAME}"; @@ -334,7 +257,7 @@ EOF EOF fi - cat << EOF >> $uboot_its + cat << EOF >> ${UBOOT_ITS} }; fdt { description = "U-Boot FDT"; @@ -345,7 +268,7 @@ EOF EOF if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then - cat << EOF >> $uboot_its + cat << EOF >> ${UBOOT_ITS} signature { algo = "${UBOOT_FIT_HASH_ALG},${UBOOT_FIT_SIGN_ALG}"; key-name-hint = "${SPL_SIGN_KEYNAME}"; @@ -353,7 +276,7 @@ EOF EOF fi - cat << EOF >> $uboot_its + cat << EOF >> ${UBOOT_ITS} }; }; @@ -373,8 +296,8 @@ EOF # ${UBOOT_MKIMAGE} \ ${@'-D "${SPL_MKIMAGE_DTCOPTS}"' if len('${SPL_MKIMAGE_DTCOPTS}') else ''} \ - -f $uboot_its \ - $uboot_bin + -f ${UBOOT_ITS} \ + ${UBOOT_FITIMAGE_BINARY} if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then # @@ -383,74 +306,136 @@ EOF ${UBOOT_MKIMAGE_SIGN} \ ${@'-D "${SPL_MKIMAGE_DTCOPTS}"' if len('${SPL_MKIMAGE_DTCOPTS}') else ''} \ -F -k "${SPL_SIGN_KEYDIR}" \ - -K "${SPL_DTB_BINARY}" \ - -r $uboot_bin \ + -K "${SPL_DIR}/${SPL_DTB_BINARY}" \ + -r ${UBOOT_FITIMAGE_BINARY} \ ${SPL_MKIMAGE_SIGN_ARGS} fi + cp ${SPL_DIR}/${SPL_DTB_BINARY} ${SPL_DIR}/${SPL_DTB_SIGNED} } -do_uboot_assemble_fitimage() { - # This function runs in KERNEL_PN context. The reason for that is that we need to - # support the scenario where UBOOT_SIGN_ENABLE is placing the Kernel fitImage's - # pubkey in the u-boot.dtb file, so that we can use it when building the U-Boot - # fitImage itself. - if [ "${UBOOT_FITIMAGE_ENABLE}" = "1" ] && \ - [ -n "${SPL_DTB_BINARY}" -a "${PN}" = "${KERNEL_PN}" ] ; then - if [ "${UBOOT_SIGN_ENABLE}" != "1" ]; then - # If we're not signing the Kernel fitImage, that means - # we need to copy the u-boot.dtb from staging ourselves - cp -P ${STAGING_DATADIR}/u-boot*.dtb ${B} - fi - # As we are in the kernel context, we need to copy u-boot-spl.dtb from staging first. - # Unfortunately, need to glob on top of ${SPL_DTB_BINARY} since _IMAGE and _SYMLINK - # will contain U-boot's PV - # Similarly, we need to get the filename for the 'stub' u-boot-fitimage + its in - # staging so that we can use it for creating the image with the correct filename - # in the KERNEL_PN context. - # As for the u-boot.dtb (with fitimage's pubkey), it should come from the dependent - # do_assemble_fitimage task - cp -P ${STAGING_DATADIR}/u-boot-spl*.dtb ${B} - cp -P ${STAGING_DATADIR}/u-boot-nodtb*.bin ${B} - rm -rf ${B}/u-boot-fitImage-* ${B}/u-boot-its-* - cd ${B} +uboot_assemble_fitimage_helper() { + type="$1" + binary="$2" + + if [ "${UBOOT_SIGN_ENABLE}" = "1" -a -n "${UBOOT_DTB_BINARY}" ] ; then + concat_dtb $type $binary + fi + + if [ "${UBOOT_FITIMAGE_ENABLE}" = "1" -a -n "${SPL_DTB_BINARY}" ]; then uboot_fitimage_assemble fi + + if [ "${SPL_SIGN_ENABLE}" = "1" -a -n "${SPL_DTB_BINARY}" ] ; then + concat_spl_dtb + fi +} + +do_uboot_assemble_fitimage() { + if [ "${UBOOT_SIGN_ENABLE}" = "1" ] ; then + cp "${STAGING_DIR_HOST}/sysroot-only/fitImage" "${B}/fitImage-linux" + fi + + if [ -n "${UBOOT_CONFIG}" ]; then + unset i j k + for config in ${UBOOT_MACHINE}; do + i=$(expr $i + 1); + for type in ${UBOOT_CONFIG}; do + j=$(expr $j + 1); + if [ $j -eq $i ]; then + break; + fi + done + + for binary in ${UBOOT_BINARIES}; do + k=$(expr $j + 1); + if [ $k -eq $i ]; then + break; + fi + done + + cd ${B}/${config} + uboot_assemble_fitimage_helper ${type} ${binary} + done + else + cd ${B} + uboot_assemble_fitimage_helper "" ${UBOOT_BINARY} + fi +} + +addtask uboot_assemble_fitimage before do_install do_deploy after do_compile + +deploy_helper() { + type="$1" + + if [ "${UBOOT_SIGN_ENABLE}" = "1" -a -n "${UBOOT_DTB_SIGNED}" ] ; then + deploy_dtb $type + fi + + if [ "${UBOOT_FITIMAGE_ENABLE}" = "1" -a -n "${SPL_DTB_BINARY}" ]; then + if [ -n "${type}" ]; then + uboot_its_image="u-boot-its-${type}-${PV}-${PR}" + uboot_fitimage_image="u-boot-fitImage-${type}-${PV}-${PR}" + else + uboot_its_image="${UBOOT_ITS_IMAGE}" + uboot_fitimage_image="${UBOOT_FITIMAGE_IMAGE}" + fi + + install -Dm644 ${UBOOT_FITIMAGE_BINARY} ${DEPLOYDIR}/$uboot_fitimage_image + install -Dm644 ${UBOOT_ITS} ${DEPLOYDIR}/$uboot_its_image + + if [ -n "${type}" ]; then + ln -sf $uboot_its_image ${DEPLOYDIR}/${UBOOT_ITS_IMAGE} + ln -sf $uboot_fitimage_image ${DEPLOYDIR}/${UBOOT_FITIMAGE_IMAGE} + fi + fi + + if [ "${SPL_SIGN_ENABLE}" = "1" -a -n "${SPL_DTB_SIGNED}" ] ; then + deploy_spl_dtb $type + fi } -addtask uboot_assemble_fitimage before do_deploy after do_compile +do_deploy:prepend() { + if [ -n "${UBOOT_CONFIG}" ]; then + unset i j k + for config in ${UBOOT_MACHINE}; do + i=$(expr $i + 1); + for type in ${UBOOT_CONFIG}; do + j=$(expr $j + 1); + if [ $j -eq $i ]; then + cd ${B}/${config} + deploy_helper ${type} + fi + done + done + else + cd ${B} + deploy_helper "" + fi -do_deploy:prepend:pn-${UBOOT_PN}() { if [ "${UBOOT_SIGN_ENABLE}" = "1" -a -n "${UBOOT_DTB_BINARY}" ] ; then - concat_dtb + ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_BINARY} + ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_SYMLINK} + ln -sf ${UBOOT_NODTB_IMAGE} ${DEPLOYDIR}/${UBOOT_NODTB_SYMLINK} + ln -sf ${UBOOT_NODTB_IMAGE} ${DEPLOYDIR}/${UBOOT_NODTB_BINARY} fi if [ "${UBOOT_FITIMAGE_ENABLE}" = "1" ] ; then - # Deploy the u-boot-nodtb binary and symlinks... - if [ -f "${SPL_DIR}/${SPL_NODTB_BINARY}" ] ; then - echo "Copying u-boot-nodtb binary..." - install -m 0644 ${SPL_DIR}/${SPL_NODTB_BINARY} ${DEPLOYDIR}/${SPL_NODTB_IMAGE} - ln -sf ${SPL_NODTB_IMAGE} ${DEPLOYDIR}/${SPL_NODTB_SYMLINK} - ln -sf ${SPL_NODTB_IMAGE} ${DEPLOYDIR}/${SPL_NODTB_BINARY} - fi - - - # We only deploy the symlinks to the uboot-fitImage and uboot-its - # images, as the KERNEL_PN will take care of deploying the real file - ln -sf ${UBOOT_FITIMAGE_IMAGE} ${DEPLOYDIR}/${UBOOT_FITIMAGE_BINARY} - ln -sf ${UBOOT_FITIMAGE_IMAGE} ${DEPLOYDIR}/${UBOOT_FITIMAGE_SYMLINK} ln -sf ${UBOOT_ITS_IMAGE} ${DEPLOYDIR}/${UBOOT_ITS} ln -sf ${UBOOT_ITS_IMAGE} ${DEPLOYDIR}/${UBOOT_ITS_SYMLINK} + ln -sf ${UBOOT_FITIMAGE_IMAGE} ${DEPLOYDIR}/${UBOOT_FITIMAGE_BINARY} + ln -sf ${UBOOT_FITIMAGE_IMAGE} ${DEPLOYDIR}/${UBOOT_FITIMAGE_SYMLINK} fi if [ "${SPL_SIGN_ENABLE}" = "1" -a -n "${SPL_DTB_BINARY}" ] ; then - concat_spl_dtb + ln -sf ${SPL_DTB_IMAGE} ${DEPLOYDIR}/${SPL_DTB_SYMLINK} + ln -sf ${SPL_DTB_IMAGE} ${DEPLOYDIR}/${SPL_DTB_BINARY} + ln -sf ${SPL_NODTB_IMAGE} ${DEPLOYDIR}/${SPL_NODTB_SYMLINK} + ln -sf ${SPL_NODTB_IMAGE} ${DEPLOYDIR}/${SPL_NODTB_BINARY} fi - - } -do_deploy:append:pn-${UBOOT_PN}() { +do_deploy:append() { # If we're creating a u-boot fitImage, point u-boot.bin # symlink since it might get used by image recipes if [ "${UBOOT_FITIMAGE_ENABLE}" = "1" ] ; then @@ -458,27 +443,3 @@ do_deploy:append:pn-${UBOOT_PN}() { ln -sf ${UBOOT_FITIMAGE_IMAGE} ${DEPLOYDIR}/${UBOOT_SYMLINK} fi } - -python () { - if ( (d.getVar('UBOOT_SIGN_ENABLE') == '1' - or d.getVar('UBOOT_FITIMAGE_ENABLE') == '1') - and d.getVar('PN') == d.getVar('UBOOT_PN') - and d.getVar('UBOOT_DTB_BINARY')): - - # Make "bitbake u-boot -cdeploy" deploys the signed u-boot.dtb - # and/or the U-Boot fitImage - d.appendVarFlag('do_deploy', 'depends', ' %s:do_deploy' % d.getVar('KERNEL_PN')) - - if d.getVar('UBOOT_FITIMAGE_ENABLE') == '1' and d.getVar('PN') == d.getVar('KERNEL_PN'): - # As the U-Boot fitImage is created by the KERNEL_PN, we need - # to make sure that the u-boot-spl.dtb and u-boot-spl-nodtb.bin - # files are in the staging dir for it's use - d.appendVarFlag('do_uboot_assemble_fitimage', 'depends', ' %s:do_populate_sysroot' % d.getVar('UBOOT_PN')) - - # If the Kernel fitImage is being signed, we need to - # create the U-Boot fitImage after it - if d.getVar('UBOOT_SIGN_ENABLE') == '1': - d.appendVarFlag('do_uboot_assemble_fitimage', 'depends', ' %s:do_assemble_fitimage' % d.getVar('KERNEL_PN')) - d.appendVarFlag('do_uboot_assemble_fitimage', 'depends', ' %s:do_assemble_fitimage_initramfs' % d.getVar('KERNEL_PN')) - -} diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 14267dbaaa..1570d54dfb 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py @@ -277,8 +277,8 @@ FIT_SIGN_INDIVIDUAL = "1" """ self.write_config(config) - # The U-Boot fitImage is created as part of linux recipe - bitbake("virtual/kernel") + # The U-Boot fitImage is created as part of the U-Boot recipe + bitbake("virtual/bootloader") deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') machine = get_bb_var('MACHINE') @@ -350,7 +350,8 @@ UBOOT_LOADADDRESS = "0x80080000" UBOOT_ENTRYPOINT = "0x80080000" UBOOT_FIT_DESC = "A model description" KERNEL_IMAGETYPES += " fitImage " -KERNEL_CLASSES = " kernel-fitimage test-mkimage-wrapper " +KERNEL_CLASSES = " kernel-fitimage " +INHERIT += "test-mkimage-wrapper" UBOOT_SIGN_ENABLE = "1" FIT_GENERATE_KEYS = "1" UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" @@ -361,8 +362,8 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'" """ self.write_config(config) - # The U-Boot fitImage is created as part of linux recipe - bitbake("virtual/kernel") + # The U-Boot fitImage is created as part of the U-Boot recipe + bitbake("virtual/bootloader") deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') machine = get_bb_var('MACHINE') @@ -432,7 +433,8 @@ UBOOT_MACHINE = "am57xx_evm_defconfig" 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 test-mkimage-wrapper " +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" @@ -451,8 +453,8 @@ UBOOT_FIT_HASH_ALG = "sha256" """ self.write_config(config) - # The U-Boot fitImage is created as part of linux recipe - bitbake("virtual/kernel") + # 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') @@ -540,7 +542,7 @@ 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/kernel | grep ^T=') + 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') @@ -595,7 +597,8 @@ UBOOT_EXTLINUX = "0" UBOOT_FIT_GENERATE_KEYS = "1" UBOOT_FIT_HASH_ALG = "sha256" KERNEL_IMAGETYPES += " fitImage " -KERNEL_CLASSES = " kernel-fitimage test-mkimage-wrapper " +KERNEL_CLASSES = " kernel-fitimage " +INHERIT += "test-mkimage-wrapper" UBOOT_SIGN_ENABLE = "1" FIT_GENERATE_KEYS = "1" UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" @@ -605,8 +608,8 @@ FIT_SIGN_INDIVIDUAL = "1" """ self.write_config(config) - # The U-Boot fitImage is created as part of linux recipe - bitbake("virtual/kernel") + # 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') @@ -694,7 +697,7 @@ 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/kernel | grep ^T=') + 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') diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc index f022aed732..5afc161fa2 100644 --- a/meta/recipes-bsp/u-boot/u-boot.inc +++ b/meta/recipes-bsp/u-boot/u-boot.inc @@ -305,17 +305,14 @@ do_deploy () { unset i else install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE} - rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK} ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME} ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK} fi fi - if [ -n "${UBOOT_ENV}" ] then install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE} - rm -f ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK} ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK} fi