From patchwork Thu Jan 19 10:45:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 717016 X-Patchwork-Delegate: hs@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3v40sT1D8pz9sDF for ; Thu, 19 Jan 2017 21:47:24 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A626FB3878; Thu, 19 Jan 2017 11:47:20 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kXWMG_uQK_qH; Thu, 19 Jan 2017 11:47:20 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EE434A75CA; Thu, 19 Jan 2017 11:47:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DA71BA75CA for ; Thu, 19 Jan 2017 11:46:48 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eQkY_b6O1SDX for ; Thu, 19 Jan 2017 11:46:48 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from cvs.linux-mips.org (eddie.linux-mips.org [148.251.95.138]) by theia.denx.de (Postfix) with ESMTP id 2018CA75C9 for ; Thu, 19 Jan 2017 11:46:44 +0100 (CET) Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23993014AbdASKqn4Ab4n (ORCPT ); Thu, 19 Jan 2017 11:46:43 +0100 Date: Thu, 19 Jan 2017 11:45:35 +0100 From: Ladislav Michl To: u-boot@lists.denx.de Message-ID: <20170119104535.nnxsukvmhlisnv4y@lenoch> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20161126 (1.7.1) Cc: Kyungmin Park Subject: [U-Boot] [PATCH] cmd: ubi: allow '-' to specify maximum volume size X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Currently maximum volume size can be specified only if no other arguments are used. Use '-' placeholder as volume size to allow maximum volume size to be specified together with volume id and type. Signed-off-by: Ladislav Michl --- cmd/ubi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/ubi.c b/cmd/ubi.c index 7d0d7e7a80..efc43ffde9 100644 --- a/cmd/ubi.c +++ b/cmd/ubi.c @@ -600,7 +600,8 @@ static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } /* E.g., create volume size */ if (argc == 4) { - size = simple_strtoull(argv[3], NULL, 16); + if (argv[3][0] != '-') + size = simple_strtoull(argv[3], NULL, 16); argc--; } /* Use maximum available size */ @@ -691,8 +692,9 @@ U_BOOT_CMD( " - Display volume and ubi layout information\n" "ubi check volumename" " - check if volumename exists\n" - "ubi create[vol] volume [size] [type] [id]" - " - create volume name with size\n" + "ubi create[vol] volume [size] [type] [id]\n" + " - create volume name with size ('-' for maximum" + " available size)\n" "ubi write[vol] address volume size" " - Write volume from address with size\n" "ubi write.part address volume size [fullsize]\n"