From patchwork Thu Apr 28 23:04:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1623931 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=seco.com header.i=@seco.com header.a=rsa-sha256 header.s=selector1 header.b=erjaKVvi; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KqB6C3Qwxz9s0r for ; Fri, 29 Apr 2022 09:05:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 349E683DB8; Fri, 29 Apr 2022 01:04:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=seco.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=seco.com header.i=@seco.com header.b="erjaKVvi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4D12983DEB; Fri, 29 Apr 2022 01:04:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0611.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1f::611]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BFC1B83A79 for ; Fri, 29 Apr 2022 01:04:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=seco.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sean.anderson@seco.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NcrYOfy/GCwwXUKV9jbiP05cGUhAc8GVg81bo/zEUjHg/pvn2tkxDB/eGFw5febplHJrfDquiREy7T2ib8AL2xTZMl1iMh69sj91r8mH1NDZ+RTMR7O43oVDUBJEK1u73Bkjt9hdvqVb4Hj1Ruv5PA+k0Wf5SzFK89WadUHZ6T8ET/dFlzLE+NoePeUET5MsQzfG8HdSZ8KxidHoot6Ay4kKb5iVNR18gLlLYwOp498CM8T7ugwy/ouVCPJhOLhGBK33Re10HSKw5GHWsZjpDJvqvbKGl4YrpdzDrC9xusW+Lbw1n1rY/kRyEqE/zKXk3iV7Zsbv10/AmjkDDoERwQ== 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=rxz6kN6bi2TdV4bjNr0KQVYj7k8nbSurUi1n4K/kyng=; b=EYXYjDYeK8bEQ+/wwg90wbYItYl6UqybuDc4LB9N9BdLteNflRgDTP5xMOyhAcIxSzHSFoCSWdHl9JKSXxr8gRCNRkgXKxKrgbGtmR1rS3jf3KTp3xqNeo5eD8qm0JEPkJ1no4mvUmRUvxSA8N4KW0JF/OYzr1Y/wqD2+BFVgnOZjtw2HAaKgZGnMn6DBqX7xf2RXQG9lF65Urk0JFyXQqfR3plZtfQQ5G8wKd0BcsfjT6tj8wO4Vx6Z7zfEmIy8opXLbWAu4IQwatcfI9Pbk/lp4uSvXiich1GPxqA45uhrDRd28L1A7d/e50O9EnCrdFxo/JKBzn5G7Twwt01Fdw== 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=rxz6kN6bi2TdV4bjNr0KQVYj7k8nbSurUi1n4K/kyng=; b=erjaKVviRY7OoLedbqqZVTp6Zw37Mic+0KR7WdrRZUWzhiXcPzvPLutGWzWv0E3KGh//3mQgny5LYBaLaop1DNxpTLI0+X7rhTyYuOGuZ+cmV95fzpMX4bH6D2dECdt8YIN9caEPYGKndq0PRzaakMeN8yxLTo0+xeN6hu6xPIrlW9nenDZVAYn842pDUtv83xPJgd4mI4riVmNJEVw9uzCszazgu8dSQgWy1zDQCnjp0a1ymop4i5hRxoo/bp9AvjP1QruBppYyvLxdN2U1Ui/WdLxRIzl69wdBW14GPJ8rifq8MweOXUiy7pMSZJl804YsX/RE3C201FrZPUc6pQ== 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 DB8PR03MB6043.eurprd03.prod.outlook.com (2603:10a6:10:ed::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Thu, 28 Apr 2022 23:04:49 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::a9d3:8abd:3f5e:a0c]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::a9d3:8abd:3f5e:a0c%5]) with mapi id 15.20.5206.013; Thu, 28 Apr 2022 23:04:49 +0000 From: Sean Anderson To: Simon Glass , u-boot@lists.denx.de Cc: Heinrich Schuchardt , Sean Anderson Subject: [PATCH v2 1/2] mkimage: Document misc options Date: Thu, 28 Apr 2022 19:04:38 -0400 Message-Id: <20220428230439.2396809-1-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty X-ClientProxiedBy: BLAPR03CA0031.namprd03.prod.outlook.com (2603:10b6:208:32d::6) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6be50390-6af8-4d9f-bd45-08da296b7ee6 X-MS-TrafficTypeDiagnostic: DB8PR03MB6043:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9pMPuh+SXhXWsnJjBIKfINRQYXqtLtxVTNyGpN5MFe1a8hVr4aK6dIFuImUZPqNZUt6NbZRk52nkhjCPWJcIkBtyAVQ3KMI+A43H+FLCsMcS/l35GOQI3ItGp3wn8B5NcBAoNxZBut87rOpMAESzuGg9+8hXa+CtK+F73Nj8xQnx1rDc7sN5rP4p0sjzFCbymUlH517Fmk3S2RhWEEa6NvW1jU2NkM+moFtqpEUhnbbwTMVWuEEHSvitc3vwC3u0/0uCuWl9Q4yKJ/0LOmE4TchAixoXW7kQHyB/bXBrsNv2/KbPexUr3YseJfn0hbYMdStCo/pENbdZkNeGFuwbRnCmZDUZfkx0INuN34X1tb6N0ZcUfXa2o2HaYxanigO1ZT6ccz746Gtm87LSOrOQfuIkIkMLaRRQtDGy0spj9FwmxlCoJql6+mdjtzZJGVwjb5Q0/9AsRBizDjuCtKLX7uz1jYn2Z9OyViMco/KTv1vkjlrNHPzJSEup9qiz6T35/UVmmS+cUKcvJ07u1K8CTH7JS0awQYKU3mtAhnG4i/A/L9fP1FeKdkYtOpHlT5PO+MURvrSUtmR0MVFtNeEAItSC+KZJXUm+2XzqGIR0anZodmgzrJigrUtGeZbvz0xMk8BaRi7+yeBD1CxNXgGGaXKCuo8n9P4kf8Sjw9ZV765KXPa4jHpuSIH/jG7stTbziTwZSDHJE45iDo7SvwqZlA== 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:(13230001)(366004)(83380400001)(52116002)(2616005)(2906002)(8676002)(6506007)(4326008)(26005)(66946007)(66556008)(66476007)(38350700002)(5660300002)(44832011)(186003)(38100700002)(316002)(6512007)(6486002)(36756003)(8936002)(86362001)(54906003)(1076003)(508600001)(6666004)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nys2frRTJc8HpmHgioOWld8eqGhZV5bkPdzGe/lb7Li7/I0QeW6gjDMNjKkeJkmTcHUmSPD+0erqjdjlHPByTMfPNfstDGcVeOxfPFk1r63vBppOtTFY6np1HsJShhSrfw6da8amyK5aSLt8Gk/jzOFI4d56Fydc4rx32FLYxM9eT1uG7Tcd8AUZdizhRVjQRhqJ5pJUNVatBaXUrmgIAfbt2jJgfequinFSOOrLJ5sezNoGKpl1+iukVYYTVYx3bWshbJBSODrxs8fEI2Wiq7jqSXGNA+kwoXPNc0T9o4/TCfuEPSSr/xn01eZtUOe1C/vec11aPZ1n/B/dz5omTLPpRner2D7DR8d4RvnnsU3a7CyzV1CZ2Q8HFu7TGx2g88nBBr/j0iiPRFglgmWekJt6H4ZXc5+DX/7j178DyhLV1iWdFUvbGO+EyXTn8yeCclWXIYWOH6D91Bxyp5g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dusdOjGRtm/jr224zbX52UzrMQFm3/SBLU6BjJ92V2+NpGG7Sqs4rpgF0YiwpjITdxDyDX1lufiw1L6uGPZHOuh0Ifcox1//rH5vloUdtorfUzim5molqTwpi+ewgzT7mMJORYemZKF4MA761wAasstNQDgRRIW5XCZ3JFXBIipmcs9rTnzNmH28fptj4BoLVtFTIcHurRrIzko1u9tpuPdj9vWTVKe5y3VZVLAuAOPb4RyM= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6be50390-6af8-4d9f-bd45-08da296b7ee6 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2022 23:04:49.5199 (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: ExM1wxEcYm63f5tfkss6jhTNpVVWai7WhFy2WhVPvGxaDr3hrwx4EcQxeZa4Cg/77yXWi6n6fYn4M41GE71okg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR03MB6043 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Over the years, several options have not made it into the help message. Document them. Do the same for the man page. Signed-off-by: Sean Anderson --- Changes in v2: - Document secondary image types - Move -G directly after -k - Reword documentation for -s doc/mkimage.1 | 60 ++++++++++++++++++++++++++++++++++++++++++++++++- tools/mkimage.c | 15 +++++++++---- 2 files changed, 70 insertions(+), 5 deletions(-) diff --git a/doc/mkimage.1 b/doc/mkimage.1 index 287006279f..10ac31a8fc 100644 --- a/doc/mkimage.1 +++ b/doc/mkimage.1 @@ -53,6 +53,10 @@ Parse image file as type. Pass \-h as the image to see the list of supported image type. Without this option image type is autodetected. +.TP +.BI "\-q" +Quiet. Don't print the image header on successful verification. + .P .B Create old legacy image: @@ -91,6 +95,35 @@ List the contents of an image. .BI "\-n [" "image name" "]" Set image name to 'image name'. +.TP +.BI "\-R [" "secondary image name" "]" +Some image types support a second image for additional data. For these types, +use \-R to specify this second image. +.TS +allbox; +lb lbx +l l. +Image Type Secondary Image Description +pblimage Additional RCW-style header, typically used for PBI commands. +zynqimage, zynqmpimage T{ +Initialization parameters, one per line. Each parameter has the form +.sp +.ti 4 +.I address data +.sp +where +.I address +and +.I data +are hexadecimal integers. The boot ROM will write each +.I data +to +.I address +when loading the image. At most 256 parameters may be specified in this +manner. +T} +.TE + .TP .BI "\-d [" "image data file" "]" Use image data from 'image data file'. @@ -99,6 +132,15 @@ Use image data from 'image data file'. .BI "\-x" Set XIP (execute in place) flag. +.TP +.BI "\-s" +Don't copy in the image data. Depending on the image type, this may create +just the header, everything but the image data, or nothing at all. + +.TP +.BI "\-v" +Verbose. Print file names as they are added to the image. + .P .B Create FIT image: @@ -126,6 +168,11 @@ in each image will be replaced with 'data-offset' and 'data-size' properties. A 'data-offset' of 0 indicates that it starts in the first (4-byte aligned) byte after the FIT. +.TP +.BI "\-B [" "alignment" "]" +The alignment, in hexadecimal, that external data will be aligned to. This +option only has an effect when \-E is specified. + .TP .BI "\-f [" "image tree source file" " | " "auto" "]" Image tree source file that describes the structure and contents of the @@ -153,6 +200,11 @@ Specifies the directory containing keys to use for signing. This directory should contain a private key file .key for use with signing and a certificate .crt (containing the public key) for use with verification. +.TP +.BI "\-G [" "key_file" "]" +Specifies the private key file to use when signing. This option may be used +instead of \-k. + .TP .BI "\-K [" "key_destination" "]" Specifies a compiled device tree binary file (typically .dtb) to write @@ -173,11 +225,17 @@ a 'data-offset' property defining the offset from the end of the FIT, \-p will use 'data-position' as the absolute position from the base of the FIT. .TP -.BI "\-r +.BI "\-r" Specifies that keys used to sign the FIT are required. This means that they must be verified for the image to boot. Without this option, the verification will be optional (useful for testing but not for release). +.TP +.BI "\-N [" "engine" "]" +The openssl engine to use when signing and verifying the image. For a complete list of +available engines, refer to +.BR engine (1). + .TP .BI "\-t Update the timestamp in the FIT. diff --git a/tools/mkimage.c b/tools/mkimage.c index be58e56546..5c6a60e851 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -84,7 +84,8 @@ static void usage(const char *msg) fprintf(stderr, "Error: %s\n", msg); fprintf(stderr, "Usage: %s [-T type] -l image\n" " -l ==> list image header information\n" - " -T ==> parse image file as 'type'\n", + " -T ==> parse image file as 'type'\n" + " -q ==> quiet\n", params.cmdname); fprintf(stderr, " %s [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image\n" @@ -95,8 +96,11 @@ static void usage(const char *msg) " -a ==> set load address to 'addr' (hex)\n" " -e ==> set entry point to 'ep' (hex)\n" " -n ==> set image name to 'name'\n" + " -R ==> set second image name to 'name'\n" " -d ==> use image data from 'datafile'\n" - " -x ==> set XIP (execute in place)\n", + " -x ==> set XIP (execute in place)\n" + " -s ==> create an image with no data\n" + " -v ==> verbose\n", params.cmdname); fprintf(stderr, " %s [-D dtc_options] [-f fit-image.its|-f auto|-F] [-b [-b ]] [-E] [-B size] [-i ] fit-image\n" @@ -107,7 +111,9 @@ static void usage(const char *msg) " -f => input filename for FIT source\n" " -i => input filename for ramdisk file\n" " -E => place data outside of the FIT structure\n" - " -B => align size in hex for FIT structure and header\n"); + " -B => align size in hex for FIT structure and header\n" + " -b => append the device tree binary to the FIT\n" + " -t => update the timestamp in the FIT\n"); #ifdef CONFIG_FIT_SIGNATURE fprintf(stderr, "Signing / verified boot options: [-k keydir] [-K dtb] [ -c ] [-p addr] [-r] [-N engine]\n" @@ -118,7 +124,8 @@ static void usage(const char *msg) " -F => re-sign existing FIT image\n" " -p => place external data at a static position\n" " -r => mark keys used as 'required' in dtb\n" - " -N => openssl engine to use for signing\n"); + " -N => openssl engine to use for signing\n" + " -o => algorithm to use for signing\n"); #else fprintf(stderr, "Signing / verified boot not supported (CONFIG_FIT_SIGNATURE undefined)\n");