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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8044BC54EBC for ; Tue, 10 Jan 2023 16:24:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9A10F85696; Tue, 10 Jan 2023 17:21:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="V5aNTtEV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 93B8585507; Tue, 10 Jan 2023 17:19:56 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 50C3B85502 for ; Tue, 10 Jan 2023 17:19:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eballetb@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673367591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LWxJ2eSxgk5QzLYap1f4rbE7wSNcgreRFkuBU/oqRmI=; b=V5aNTtEVuBraefumo/jmh3YKyxZKWAkkffLm3zc5n0HXKrrdq+TxZK2qfozLRo66PPdTmO sdI2Fauwd+cueEGARrjPotRsy7vpB9+s9XAGJJs5AU5ip1rIT22/TA2RI+yKpDnBvi5DZY x9r3c5Bqg66jyGND96WUBdfjHboUTL4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-604-CMn0tQ3jOHKVVQeVwwvx8A-1; Tue, 10 Jan 2023 11:19:49 -0500 X-MC-Unique: CMn0tQ3jOHKVVQeVwwvx8A-1 Received: by mail-wm1-f69.google.com with SMTP id c7-20020a1c3507000000b003d355c13ba8so6498064wma.6 for ; Tue, 10 Jan 2023 08:19:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LWxJ2eSxgk5QzLYap1f4rbE7wSNcgreRFkuBU/oqRmI=; b=1U+Ct9CZk/3bSWVpyOUa3J69L2rz5iXcfpONrlHhyaMpDfhj9gp/qfN940L9PpFkxG 6hFCYMs/GExyzOg7LmRO6PGIPlKvDceYwMEx2eR9++7TCHOdryZWGaCPdS7316jRCM98 VzjDFZXmb1w+flv3P5OCoOR6hLGsKD6buYwlsxFeCjCSGQ6ahNgztQAOqucL0Kobt7Ka emps1LGHKZOd6mno3puGaRGyU8X4gVZSoCOHApaJ+6fyqrehLe4hNb5h7QJTGQIHxPAo h/VS90bBpXdbEsUUCj9LqXiWyrAKmGNiFwi5tTz4cB3j9lZ0xIdCcGfiTl9DbZVTex8I dujw== X-Gm-Message-State: AFqh2ko183Wchq/g4E5Qh43VsmmHF8gytXfr0QU38eI1X1E3I3WwVzPZ C1wcq3ZZvsqJzJLkkDoFmoHG8vRRSqPjqal6mfjIGWC4TyLGqtg4/ykr0CyHQs7DjSSueZcz6Xa BKja3sromM82XxUvpco/3B/yl3sPQP6POeLDZkwAC24y7XtrCXtyiYgu90+iFAp4gkQ== X-Received: by 2002:a5d:4b85:0:b0:2b7:f2a0:6d9c with SMTP id b5-20020a5d4b85000000b002b7f2a06d9cmr11163530wrt.41.1673367587982; Tue, 10 Jan 2023 08:19:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXuvdyHQUcx7gctjCpHRV5C5dx8di/6OsjyxuXTJeigpSg5jslDT9hMt+LvMgsntaejCv0IADw== X-Received: by 2002:a5d:4b85:0:b0:2b7:f2a0:6d9c with SMTP id b5-20020a5d4b85000000b002b7f2a06d9cmr11163509wrt.41.1673367587673; Tue, 10 Jan 2023 08:19:47 -0800 (PST) Received: from fedora.. (215.red-79-157-73.dynamicip.rima-tde.net. [79.157.73.215]) by smtp.gmail.com with ESMTPSA id m1-20020a5d6241000000b002bbdaf21744sm8669803wrv.113.2023.01.10.08.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:19:47 -0800 (PST) From: Enric Balletbo i Serra X-Google-Original-From: Enric Balletbo i Serra To: u-boot@lists.denx.de Cc: xypron.glpk@gmx.de, trini@konsulko.com, Enric Balletbo i Serra , Bin Meng , Ilias Apalodimas , Roger Knecht , Simon Glass , Sughosh Ganu Subject: [PATCH v3 1/4] doc: man-page for the part command Date: Tue, 10 Jan 2023 17:19:32 +0100 Message-Id: <20230110161936.526455-2-eballetbo@redhat.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230110161936.526455-1-eballetbo@redhat.com> References: <20230110161936.526455-1-eballetbo@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Mailman-Approved-At: Tue, 10 Jan 2023 17:21:21 +0100 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.6 at phobos.denx.de X-Virus-Status: Clean Provide a man-page for the part command. Signed-off-by: Enric Balletbo i Serra --- Changes in v3: - Add the entry in doc/usage/cmd/index.rst. - Provide examples for the other sub-commands. - Fix return value chapter, 0 (true) on success and 1(false) on error. - Add reviewed by tags Changes in v2: - New patch (1) in the series to fix a trivial type - New patch (2) in the series to introduce the documentation of the part type command - Fix typo s/partittion/partition/ in commit message - Add gpt test for the part type command - Add the man-page for part command in doc/usage/cmd doc/usage/cmd/part.rst | 136 +++++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 137 insertions(+) create mode 100644 doc/usage/cmd/part.rst diff --git a/doc/usage/cmd/part.rst b/doc/usage/cmd/part.rst new file mode 100644 index 0000000000..ed464b180b --- /dev/null +++ b/doc/usage/cmd/part.rst @@ -0,0 +1,136 @@ +.. SPDX-License-Identifier: GPL-2.0+: + +part command +=============== + +Synopis +------- + +:: + + part uuid : [varname] + part list [flags] [varname] + part start + part size + part number + part types + +Description +----------- + +The `part` command is used to manage disk partition related commands. + +The 'part uuid' command prints or sets an environment variable to partition UUID + + interface + interface for accessing the block device (mmc, sata, scsi, usb, ....) + dev + device number + part + partition number + varname + an optional environment variable to store the current partition UUID value into. + +The 'part list' command prints or sets an environment variable to the list of partitions + + interface + interface for accessing the block device (mmc, sata, scsi, usb, ....) + dev + device number + part + partition number + flags + -bootable + lists only bootable partitions + varname + an optional environment variable to store the list of partitions value into. + +The 'part start' commnad sets an environment variable to the start of the partition (in blocks), +part can be either partition number or partition name. + + interface + interface for accessing the block device (mmc, sata, scsi, usb, ....) + dev + device number + part + partition number + varname + a variable to store the current start of the partition value into. + +The 'part size' command sets an environment variable to the size of the partition (in blocks), +part can be either partition number or partition name. + + interface + interface for accessing the block device (mmc, sata, scsi, usb, ....) + dev + device number + part + partition number + varname + a variable to store the current size of the partition value into. + +The 'part number' command sets an environment variable to the partition number using the partition name, +part must be specified as partition name. + + interface + interface for accessing the block device (mmc, sata, scsi, usb, ....) + dev + device number + part + partition number + varname + a variable to store the current partition number value into + +The 'part types' command list supported partition table types. + +Examples +-------- + +:: + + => host bind 0 ./test_gpt_disk_image.bin + => part uuid host 0:1 + 24156b69-3378-497f-bb3e-b982223de528 + => part uuid host 0:1 varname + => env print varname + varname=24156b69-3378-497f-bb3e-b982223de528 + => + => part list host 0 + + Partition Map for HOST device 0 -- Partition Type: EFI + + Part Start LBA End LBA Name + Attributes + Type GUID + Partition GUID + 1 0x00000800 0x00000fff "second" + attrs: 0x0000000000000000 + type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 + (data) + guid: 24156b69-3378-497f-bb3e-b982223de528 + 2 0x00001000 0x00001bff "first" + attrs: 0x0000000000000000 + type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 + (data) + guid: 5272ee44-29ab-4d46-af6c-4b45ac67d3b7 + => + => part start host 0 2 varname + => env print varname + varname=1000 + => + => part size host 0 2 varname + => env print varname + varname=c00 + => + => part number host 0 2 varname + => env print varname + varname=0x2 + => + => part types + Supported partition tables: EFI, AMIGA, DOS, ISO, MAC + +Return value +------------ + +The return value $? is set to 0 (true) if the command succededd. If an +error occurs, the return value $? is set to 1 (false). diff --git a/doc/usage/index.rst b/doc/usage/index.rst index bbd40a6e18..cf3666a77d 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -61,6 +61,7 @@ Shell commands cmd/mbr cmd/md cmd/mmc + cmd/part cmd/pause cmd/pinmux cmd/printenv -- 2.39.0