From patchwork Tue Jan 10 16:19:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 1724180 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=V5aNTtEV; dkim-atps=neutral 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrx3D3yHpz23gB for ; Wed, 11 Jan 2023 03:24:24 +1100 (AEDT) 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) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 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 From patchwork Tue Jan 10 16:19:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 1724181 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OQXy45uV; dkim-atps=neutral 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrx3S6Xxgz23gB for ; Wed, 11 Jan 2023 03:24:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AF75F856A6; Tue, 10 Jan 2023 17:21:27 +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="OQXy45uV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E666985502; Tue, 10 Jan 2023 17:19:56 +0100 (CET) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 EB62A854B1 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=/eFm/nInYUIH/oJChTbI3WPrYXXh/ukPnW+ocVm1Beo=; b=OQXy45uVq5Q1+vFUMUVzailNKf3AtlqLk2NucKJibFqwSkCf5nqNAUfFZLYUQHET8FAWeR j9aGQ64owuIMM36tuOw+0g7ZXkZ2jzFAuiQV1GEX4b3ELz1VEEi5qxmglSKRGs5FrWqmSN f892+IySB3JzfokkaYXHxwxo6cFycgs= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-557-cnPqOHjqM-q1XrZlMvsK5Q-1; Tue, 10 Jan 2023 11:19:50 -0500 X-MC-Unique: cnPqOHjqM-q1XrZlMvsK5Q-1 Received: by mail-wr1-f70.google.com with SMTP id l18-20020adfa392000000b002bbd5c680a3so1669618wrb.14 for ; Tue, 10 Jan 2023 08:19:50 -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=/eFm/nInYUIH/oJChTbI3WPrYXXh/ukPnW+ocVm1Beo=; b=rLnyA1hrlUWhLS6iOWI0bzRXlVRVUEamPGxiWF2dBXx3WipSUxJ/mKIVblpxutg6tD hy4TOO0ATeJui/mssi06bzFaOKPS+PA8GVM5OlpioPDmR83UgUwQc1PzPPFeXiznh2Gp drdWX35sxNTR/L9B+4x8fkhYwK2tbltdV96rSiJrG1eoGvl49++KIMkQWFebMj6cOEpb GFqt2ZsTPmxVJTy5/Axge8O7BmMWXWZV1hYCF1iwzUfE5E15+qDl2xEiCODashvypbJa BGUQLqouXcfQljDgc1LG9CRSouD5+nIzQRWR2Ycr49TgvmpfrJ7lf+mlUWqZmKlF4l8i 3iug== X-Gm-Message-State: AFqh2koB2GKfSOfecjS+OH9ijwnYE73fA32Icc1iLxsCxwFZUsP90aP+ JmcKMGshVqJcJ0MqDXBybM9b2oK+Nff/XysAW8PjGlFGw9CB4sRGSASKTOZB8fSxC6adYaa+3KM +dnX9a/J1s183UbrDVNnu3N8Dq7//zR2y/+hfUJX3cjZ4BgVKjx0Hh28KsjzXh1mLpg== X-Received: by 2002:a5d:6952:0:b0:274:3f67:470 with SMTP id r18-20020a5d6952000000b002743f670470mr49778969wrw.51.1673367589236; Tue, 10 Jan 2023 08:19:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXvmsJiSRlFmQ1tSsTRiASBmgaMrrgyzJ4b75W1tnX2dahIHzqj3DeyRH6gw+i2/sYaToEG2+A== X-Received: by 2002:a5d:6952:0:b0:274:3f67:470 with SMTP id r18-20020a5d6952000000b002743f670470mr49778952wrw.51.1673367589022; Tue, 10 Jan 2023 08:19:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:19:48 -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 , Simon Glass Subject: [PATCH v3 2/4] doc/README.gpt: Fix typo 'a optionnal' Date: Tue, 10 Jan 2023 17:19:33 +0100 Message-Id: <20230110161936.526455-3-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 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 Change the string 'a optionnal' to 'an optional'. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Simon Glass --- (no changes since v1) doc/README.gpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/README.gpt b/doc/README.gpt index 91e397d06f..cc2a1b7ac7 100644 --- a/doc/README.gpt +++ b/doc/README.gpt @@ -260,7 +260,7 @@ Partition type GUID: For created partition, the used partition type GUID is PARTITION_BASIC_DATA_GUID (EBD0A0A2-B9E5-4433-87C0-68B6B72699C7). -If you define 'CONFIG_PARTITION_TYPE_GUID', a optionnal parameter 'type' +If you define 'CONFIG_PARTITION_TYPE_GUID', an optional parameter 'type' can specify a other partition type guid: "uuid_disk=...;name=u-boot,size=60MiB,uuid=...; From patchwork Tue Jan 10 16:19:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 1724183 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ESoJBo3n; dkim-atps=neutral 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrx3w5LGmz23gG for ; Wed, 11 Jan 2023 03:25:00 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B2645856B2; Tue, 10 Jan 2023 17:21:38 +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="ESoJBo3n"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8AC76854B1; Tue, 10 Jan 2023 17:20:43 +0100 (CET) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 DFA108559B for ; Tue, 10 Jan 2023 17:20:37 +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=1673367636; 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=mnb+nsXRA1vPsZoKVv3xSR2cD9gCHLvvzCQpXllZRPI=; b=ESoJBo3nsQUce1L21I9CqvR5Vk9b5ssbM5IR4wu8HkfIXY3/m/AwLCXN76lVXUXPnAIPyR 4AaQ1IHUtS5mg59fYX0S36ZAtELW/dwgj+fM5uFUV/hfGrD+dnSrV6CBIRrMY1U5O2Hl46 w+VODGTOinqHQxIBklMC9vwmGjtHgJA= 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-439-95FEc_rpNUyaEUMBlf0XpQ-1; Tue, 10 Jan 2023 11:20:13 -0500 X-MC-Unique: 95FEc_rpNUyaEUMBlf0XpQ-1 Received: by mail-wm1-f69.google.com with SMTP id g9-20020a7bc4c9000000b003d214cffa4eso2684295wmk.5 for ; Tue, 10 Jan 2023 08:20:03 -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=mnb+nsXRA1vPsZoKVv3xSR2cD9gCHLvvzCQpXllZRPI=; b=tq+eaq1UQLkHrncWB9VMmNhw4DQuHO7WlCBNNU6TIgzc71KfZvfuFvOwqf4KXZdcSh ivXmjbOP1bNG15EiSfu1JNw59e1OY6otve489I7dN7/caLU0YvU9L92vr1yFYEmwEwWP MQMc64v8ZM5hIKmnKOy0Iq1vrco/dZbYZRMFIa4yJk5V6M7FYRXgLhIrrewfpDjikK9X DEhJUQv4ywZtFrthvLwYeFVeYFig6N8FBdCfQQm4mCCu7uXVB7a1r7xRbjLZwHHY4KNW /165gDj02NjwZzy5klBrovNfZoqc6gF4fE6l4OAHhlNqefym8WTsYgRe9asmmlchE0CJ MrSQ== X-Gm-Message-State: AFqh2kp/+vrrsaX7S5peeuxYr+s/7t+F/wY2iFnYRXSWjz4zda15UN/R fgUzEu3j28tUvdUgBWAElWL6+qeXjI1iydJc1Sont2X7zu08aSIwLAuEPOgtM7e8WaxVUnYBZdP rqaBuVgWzwidq54qri2No9e3ZT1CoqKeHbJmKn9fbHiD6ulQW2k3g7DowNA7hz3l2/g== X-Received: by 2002:adf:e346:0:b0:2ab:80b3:67b0 with SMTP id n6-20020adfe346000000b002ab80b367b0mr12243949wrj.61.1673367590533; Tue, 10 Jan 2023 08:19:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXtNgidBGM950w6aVLteWMBHgxSEEqUmODv+chVmT8k2ZfQqa39dNcvYz9Zcc/Zb9BlzFb9qLg== X-Received: by 2002:adf:e346:0:b0:2ab:80b3:67b0 with SMTP id n6-20020adfe346000000b002ab80b367b0mr12243938wrj.61.1673367590269; Tue, 10 Jan 2023 08:19:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:19:49 -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 , Simon Glass Subject: [PATCH v3 3/4] cmd: part: Add partition-related type command Date: Tue, 10 Jan 2023 17:19:34 +0100 Message-Id: <20230110161936.526455-4-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 X-Mailman-Approved-At: Tue, 10 Jan 2023 17:21:32 +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 This implements the following command: part type mmc 0:1 -> print partition type UUID part type mmc 0:1 uuid -> set environment variable to partition type UUID "part type" can be useful when writing a bootcmd which searches for a specific partition type to enable automatic discovery of partitions and their intended usage or mount point. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Simon Glass --- (no changes since v1) cmd/part.c | 29 +++++++++++++++++++++++++++++ doc/usage/cmd/part.rst | 18 ++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/cmd/part.c b/cmd/part.c index 9d419c967c..26b0cc84fe 100644 --- a/cmd/part.c +++ b/cmd/part.c @@ -182,6 +182,29 @@ static int do_part_number(int argc, char *const argv[]) return do_part_info(argc, argv, CMD_PART_INFO_NUMBER); } +static int do_part_type(int argc, char *const argv[]) +{ + int part; + struct blk_desc *dev_desc; + struct disk_partition info; + + if (argc < 2) + return CMD_RET_USAGE; + if (argc > 3) + return CMD_RET_USAGE; + + part = blk_get_device_part_str(argv[0], argv[1], &dev_desc, &info, 0); + if (part < 0) + return 1; + + if (argc > 2) + env_set(argv[2], info.type_guid); + else + printf("%s\n", info.type_guid); + + return 0; +} + static int do_part_types(int argc, char * const argv[]) { struct part_driver *drv = ll_entry_start(struct part_driver, @@ -218,6 +241,8 @@ static int do_part(struct cmd_tbl *cmdtp, int flag, int argc, return do_part_size(argc - 2, argv + 2); else if (!strcmp(argv[1], "number")) return do_part_number(argc - 2, argv + 2); + else if (!strcmp(argv[1], "type")) + return do_part_type(argc - 2, argv + 2); else if (!strcmp(argv[1], "types")) return do_part_types(argc - 2, argv + 2); return CMD_RET_USAGE; @@ -244,6 +269,10 @@ U_BOOT_CMD( "part number \n" " - set environment variable to the partition number using the partition name\n" " part must be specified as partition name\n" + "part type :\n" + " - print partition type\n" + "part type : \n" + " - set environment variable to partition type\n" "part types\n" " - list supported partition table types" ); diff --git a/doc/usage/cmd/part.rst b/doc/usage/cmd/part.rst index ed464b180b..8d2a280391 100644 --- a/doc/usage/cmd/part.rst +++ b/doc/usage/cmd/part.rst @@ -13,6 +13,7 @@ Synopis part start part size part number + part type : [varname] part types Description @@ -81,6 +82,17 @@ part must be specified as partition name. varname a variable to store the current partition number value into +The 'part type' command prints or sets an environment variable to the partition type UUID. + + 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 type UUID value into + The 'part types' command list supported partition table types. Examples @@ -126,6 +138,12 @@ Examples => env print varname varname=0x2 => + => part type host 0:1 + ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 + => part type host 0:1 varname + => env print varname + varname=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 + => => part types Supported partition tables: EFI, AMIGA, DOS, ISO, MAC From patchwork Tue Jan 10 16:19:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 1724182 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SKNngl3H; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrx3j1yBpz23gB for ; Wed, 11 Jan 2023 03:24:49 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DDF31856AD; Tue, 10 Jan 2023 17:21:34 +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="SKNngl3H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B96308551C; Tue, 10 Jan 2023 17:20:08 +0100 (CET) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 3184F85568 for ; Tue, 10 Jan 2023 17:19:56 +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=1673367594; 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=2g8FgAIFx9/3j72zCgOmOeXUKWTrcmP36EOph5VN+GE=; b=SKNngl3H9D3gssqN/4uYcFd7p/WaE6fZiuCPkJ1Wmm46YMIWrHhZ07uvVPMm6YpZ5Z+9Gf Prz1Z+tFPq1NOD6pIgtdjnj3ifipNqfiYIeEeB4oT7IWn4FclN6qXedtZ5BbXF6jyzBKw4 TpfJKkQpeAF4jeKAZwq6R3ItuopQKag= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-57-Jd1tDFC5MvaC_pq_VxEezA-1; Tue, 10 Jan 2023 11:19:53 -0500 X-MC-Unique: Jd1tDFC5MvaC_pq_VxEezA-1 Received: by mail-wr1-f69.google.com with SMTP id q3-20020adfab03000000b002b32e25058dso2140610wrc.5 for ; Tue, 10 Jan 2023 08:19:53 -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=2g8FgAIFx9/3j72zCgOmOeXUKWTrcmP36EOph5VN+GE=; b=O9LJjdRf9tNhmb/kWK1m81ntCc3qR2PnlgdOqj5CaIYA/+Fh7QTwajIcHVFoRJf7dr ozrIw2CaB7d22Hg6YI1kIZWeg1/JbVUpsfvJoDaxIKejYLNRrNBojL8sACI9EsgJUkhN 7P3cUYbSUPAPmEMUQ91rjhtiWe30W/PB6ozXhcHFSx136RMM9W686JKTVHjG6CYfXdgd jykEpuKyLXD6PAlLBdvmsEa5iLbl38eLw0jCn79+hhQ+RT85/VCTM1Q5RDWrEEIIHIaN Q8Z/m3sax6SnY3fdltlmXSBDYxqzLuIEzrckjcixbFAPTcvxtAMRlPZMNLMLhZcbzmf3 hzkg== X-Gm-Message-State: AFqh2krnMmIlkQ82cHSL66BgVW80ZKbLWGwlLFef5XGDv/86gEnloKJN Ni5nOTjO+VQuTJ9VZuorcg5PzZz5OhFuzKBSFPXCVth3BBcMQpN+wT1ZDi2YEJ5ht2BuT7EShIx jHe+yieeenZT+CeDlhj589frGLVUzCqEqFlnPsF8GewJ1O2wIwC35/OHnvZG7AEAIRA== X-Received: by 2002:adf:fc85:0:b0:27f:effe:977 with SMTP id g5-20020adffc85000000b0027feffe0977mr32254490wrr.38.1673367591870; Tue, 10 Jan 2023 08:19:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXv6ep/rEuQUhSn4UwCf2rTD4XHD/MwEH1PXU2bIHwJjQ0oOSPTVaB6TwndEZn0uX7YrmVERyw== X-Received: by 2002:adf:fc85:0:b0:27f:effe:977 with SMTP id g5-20020adffc85000000b0027feffe0977mr32254472wrr.38.1673367591635; Tue, 10 Jan 2023 08:19:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:19:51 -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 , Philippe Reynes , Simon Glass Subject: [PATCH v3 4/4] test/py: gpt: add test for the gpt partition type GUID identifier Date: Tue, 10 Jan 2023 17:19:35 +0100 Message-Id: <20230110161936.526455-5-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 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 Add sandbox test for the gpt partition type command, the test uses the persistent data test_gpt_disk_image.bin to check that the first partition type GUID that identifies the type of the partition has the "Linux filesystem data" type ( 0FC63DAF-8483-4772-8E79-3D69D8477DE4 ). Signed-off-by: Enric Balletbo i Serra --- (no changes since v1) test/py/tests/test_gpt.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/py/tests/test_gpt.py b/test/py/tests/test_gpt.py index cb44e1d789..73bfbf77a2 100644 --- a/test/py/tests/test_gpt.py +++ b/test/py/tests/test_gpt.py @@ -134,6 +134,29 @@ def test_gpt_save_guid(state_disk_image, u_boot_console): output = u_boot_console.run_command('printenv newguid') assert '375a56f7-d6c9-4e81-b5f0-09d41ca89efe' in output +@pytest.mark.boardspec('sandbox') +@pytest.mark.buildconfigspec('cmd_gpt') +@pytest.mark.requiredtool('sgdisk') +def test_gpt_part_type_uuid(state_disk_image, u_boot_console): + """Test the gpt partittion type UUID command.""" + + u_boot_console.run_command('host bind 0 ' + state_disk_image.path) + output = u_boot_console.run_command('part type host 0:1') + assert '0fc63daf-8483-4772-8e79-3d69d8477de4' in output + +@pytest.mark.boardspec('sandbox') +@pytest.mark.buildconfigspec('cmd_gpt') +@pytest.mark.requiredtool('sgdisk') +def test_gpt_part_type_save_uuid(state_disk_image, u_boot_console): + """Test the gpt partittion type to save UUID into a string.""" + + if u_boot_console.config.buildconfig.get('config_cmd_gpt', 'n') != 'y': + pytest.skip('gpt command not supported') + u_boot_console.run_command('host bind 0 ' + state_disk_image.path) + output = u_boot_console.run_command('part type host 0:1 newguid') + output = u_boot_console.run_command('printenv newguid') + assert '0fc63daf-8483-4772-8e79-3d69d8477de4' in output + @pytest.mark.boardspec('sandbox') @pytest.mark.buildconfigspec('cmd_gpt') @pytest.mark.buildconfigspec('cmd_gpt_rename')