From patchwork Thu Dec 22 10:30:29 2022 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: 1718860 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=PU+m2Wc+; 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 4NdCJs2tQ9z1ydb for ; Fri, 23 Dec 2022 01:25:33 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 81C1485465; Thu, 22 Dec 2022 15:24:49 +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="PU+m2Wc+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E8160852D0; Thu, 22 Dec 2022 11:30:52 +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 5CDB2851D7 for ; Thu, 22 Dec 2022 11:30:50 +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=1671705049; 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=n/9UCbMw0z8PNglSi3H2sQCTYL/ztko0ivOW2ChYxW0=; b=PU+m2Wc+RfM/pyFrrwsxRXiw9WhOgnT5szTwxsI+kvMeZOVcFcTeE1oOD4QBPcRe9yqN0w 6q9Vi9sHZdHbJyQOMtFtw/oljK2pdbbaGdoVIn7h1B3e0A899lKEFOZZ7ExizP5ucS1wIz gX30ZaUg1gWI01Chtu41mJ2zyGp2TFA= 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-435-PmqhT79gPzi4TrLLY0Aj2A-1; Thu, 22 Dec 2022 05:30:47 -0500 X-MC-Unique: PmqhT79gPzi4TrLLY0Aj2A-1 Received: by mail-wr1-f69.google.com with SMTP id u9-20020adfa189000000b00242121eebe2so296147wru.3 for ; Thu, 22 Dec 2022 02:30:47 -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=n/9UCbMw0z8PNglSi3H2sQCTYL/ztko0ivOW2ChYxW0=; b=7wBP894RhlUXQjg7sJHH+R4h724JQxw575soF8o3InaGuqrphJDxJ0FvUYBUSPgUHc WGolj0sK3I/+KZvrgcaxBPD/tDu5bWtCXVt0cCwOCFm8TDKSjtb59MSs5Awinoosk25N lYwXglj0snK+7dQyiXlXrG2Oty5Ns/VYt/JZw9mN9nhvmUPbaht48hPStV8EcpfUL33h vrs5zcGfG3H+OYurtGnmPha1V19rc13komsBEI7j7xKBORcGk/X+qPnMv/UdyQatNHr6 62Tn4+yiKg7R/8dr+wp0mhZ41Ox2gSnTjEQxOr7YKCghmgpaVQ5NNz+yEVLxfQdbW5KB Q2yQ== X-Gm-Message-State: AFqh2kqsEzYZ/fX2NdU2Ch/dnvj8iwhFrzIs6/LiA7a+iKQVcCDJgQd4 dUOdymhAvl1zv3ui4RCabDVbrUpHYtpv9yUWM7VuLldJVVAVw1K9u3zoRGOPCAsVF0txWm7/eNE M0sz6s4Vn3QnkBM3GqgeG6tVH97kk6IOBtHJz99rPzaQ8F1/Q5X5Dsp15RBHkI58nTw== X-Received: by 2002:a05:600c:1e10:b0:3d3:404a:8a1a with SMTP id ay16-20020a05600c1e1000b003d3404a8a1amr6757802wmb.11.1671705045948; Thu, 22 Dec 2022 02:30:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXug5lfNdfHzU21yDxb7JSBEdO7mYlaCtbSn0EVv0aYDP36W6fuKOZn77et6U7rK6APx9lh87g== X-Received: by 2002:a05:600c:1e10:b0:3d3:404a:8a1a with SMTP id ay16-20020a05600c1e1000b003d3404a8a1amr6757781wmb.11.1671705045644; Thu, 22 Dec 2022 02:30:45 -0800 (PST) Received: from localhost.localdomain ([109.167.21.147]) by smtp.gmail.com with ESMTPSA id q2-20020a1cf302000000b003d1cc0464a2sm581037wmq.8.2022.12.22.02.30.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 02:30:45 -0800 (PST) From: Enric Balletbo i Serra X-Google-Original-From: Enric Balletbo i Serra To: u-boot@lists.denx.de Cc: trini@konsulko.com, xypron.glpk@gmx.de, Enric Balletbo i Serra Subject: [PATCH v2 1/4] doc: man-page for the part command Date: Thu, 22 Dec 2022 11:30:29 +0100 Message-Id: <20221222103032.149098-2-eballetbo@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221222103032.149098-1-eballetbo@redhat.com> References: <20221222103032.149098-1-eballetbo@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Mailman-Approved-At: Thu, 22 Dec 2022 15:24:36 +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 Reviewed-by: Simon Glass --- 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 | 97 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 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..be931e520f --- /dev/null +++ b/doc/usage/cmd/part.rst @@ -0,0 +1,97 @@ +.. 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' 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' 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' 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. + +Example +------- + +This example shows listing supported partition types:: + + U-Boot> part types + Supported partition tables: EFI, AMIGA, DOS, ISO, MAC + +Return value +------------ + +The return value $? is always 0 (true). From patchwork Thu Dec 22 10:30:30 2022 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: 1718861 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=Cg+GzM0d; 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 4NdCK65kgwz1ydb for ; Fri, 23 Dec 2022 01:25:46 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D30588546F; Thu, 22 Dec 2022 15:24:50 +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="Cg+GzM0d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6A411851FF; Thu, 22 Dec 2022 11:30:54 +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 7244C85215 for ; Thu, 22 Dec 2022 11:30:51 +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=1671705050; 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=0vXcndvO1gYKF8eiZukzM/DTjpTOiVJzbJ3m+hIDS7w=; b=Cg+GzM0d1qiLovQrn34Ian7HbkOKVZEVHaC6sj/XFwWt0GBWwekoHU9hnvRgREsbJFGtLT 0FuvUUTNv413f3U4ViPO41eVJXNuYeOF6BfBs8k9IpeAza/A4qVmHYHSbiN4VCOcgYC/Du KacMSByjuLpEIWE6SPTQH+YEy4aIVkA= 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-458-KPzLWOfdM92IUM9aDxDu1w-1; Thu, 22 Dec 2022 05:30:49 -0500 X-MC-Unique: KPzLWOfdM92IUM9aDxDu1w-1 Received: by mail-wr1-f70.google.com with SMTP id e10-20020adf9bca000000b0026e2396ab34so297408wrc.18 for ; Thu, 22 Dec 2022 02:30: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=0vXcndvO1gYKF8eiZukzM/DTjpTOiVJzbJ3m+hIDS7w=; b=V941gXBHZhh4b9K/jvZHCB6DcPBt/Kts6vka6f7PMK77F4GywqtW/s5SKDhbWhrLMD N0M95OUc8ktX0aXgJ2o6aTJfxP4np/aJjCl8col2pTmiTZY+9b4fAltcszb9TCb9WPnc VB0KVQUdvoxVRiTiNjjbbnNOuzy6U30xgGP0lVbZuJfwK0E82b6MO35+lcldt/LBzk+B kXtqCDOKwYBfRPd06dwoheM3vRBaXBuBLUxDgixwo0cRAJU9p9JUWGYoUcclA7GULi7U IwUjA/jCRnCHYr9YIy3LOCBj4sUUG7J20FQPXx/ml41c0x+1DdizrdOT7rwMAk7r6Nj+ UY7g== X-Gm-Message-State: AFqh2kqbjLk68asS3ZLuQLBo1CANMEPdikz+Ef/WswTcFRGlJgsc3aBQ 97belscyGt0JHIVXL6APmwhKb+/ysjPJy9K65uRCr2OTYkKFCskgPY7cK/14zyVyW10vJ5CMr2G Zp4x3jh1wdlkMxbhytuU+FnbgrH2aulswkW6wNYPPOAwXuHhBKBF/l5klhWII2kgR0Q== X-Received: by 2002:a05:600c:a10:b0:3d2:2904:dfe9 with SMTP id z16-20020a05600c0a1000b003d22904dfe9mr6729013wmp.21.1671705047766; Thu, 22 Dec 2022 02:30:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXubeRw64lXeDzD+fajg8hD+TbQbqRwUvGhzGc6okrKOjQ1edmuSIBEEaDCcubIWKLk923jM5w== X-Received: by 2002:a05:600c:a10:b0:3d2:2904:dfe9 with SMTP id z16-20020a05600c0a1000b003d22904dfe9mr6728996wmp.21.1671705047497; Thu, 22 Dec 2022 02:30:47 -0800 (PST) Received: from localhost.localdomain ([109.167.21.147]) by smtp.gmail.com with ESMTPSA id q2-20020a1cf302000000b003d1cc0464a2sm581037wmq.8.2022.12.22.02.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 02:30:47 -0800 (PST) From: Enric Balletbo i Serra X-Google-Original-From: Enric Balletbo i Serra To: u-boot@lists.denx.de Cc: trini@konsulko.com, xypron.glpk@gmx.de, Enric Balletbo i Serra Subject: [PATCH v2 2/4] doc/README.gpt: Fix typo 'a optionnal' Date: Thu, 22 Dec 2022 11:30:30 +0100 Message-Id: <20221222103032.149098-3-eballetbo@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221222103032.149098-1-eballetbo@redhat.com> References: <20221222103032.149098-1-eballetbo@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Mailman-Approved-At: Thu, 22 Dec 2022 15:24:36 +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 +- doc/usage/cmd/part.rst | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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=...; diff --git a/doc/usage/cmd/part.rst b/doc/usage/cmd/part.rst index be931e520f..0d098c7e3f 100644 --- a/doc/usage/cmd/part.rst +++ b/doc/usage/cmd/part.rst @@ -45,7 +45,7 @@ The 'part list' command prints or sets an environment variable to the list of pa varname an optional environment variable to store the list of partitions value into. -The 'part start' sets an environment variable to the start of the partition (in blocks), +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 @@ -57,7 +57,7 @@ part can be either partition number or partition name. varname a variable to store the current start of the partition value into. -The 'part size' sets an environment variable to the size of the partition (in blocks), +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 @@ -69,7 +69,7 @@ part can be either partition number or partition name. varname a variable to store the current size of the partition value into. -The 'part number' sets an environment variable to the partition number using the partition name, +The 'part number' command sets an environment variable to the partition number using the partition name, part must be specified as partition name. interface From patchwork Thu Dec 22 10:30:31 2022 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: 1718863 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=WaPmsZ2Z; 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 4NdCKM623gz23dT for ; Fri, 23 Dec 2022 01:25:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CF8D685477; Thu, 22 Dec 2022 15:24: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=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="WaPmsZ2Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1FE67852D0; Thu, 22 Dec 2022 11:30: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 6B71F851D7 for ; Thu, 22 Dec 2022 11:30:53 +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=1671705052; 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=3HZhiRKOMwW0E5zcWURNwxTYpMdgNAZHf4VEYz7r04Y=; b=WaPmsZ2ZXXD10Qu0nPgIRlWhKQa53I8oJ/xRKuBQZpbsJn3FRtR6Bj36V6Ws1D40oEsj9P h47KmNgBRLzND2YHckUH5yz2mQkQZO2zQ5rSo8NgO+mrOcbILtzM9GC13m4YJmx3aVAusB Ep5EOBzw3jPyw+i5lvCU0ixxMgqoHdQ= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-619-TxuAZO5IP9-2mI_tp17I7A-1; Thu, 22 Dec 2022 05:30:51 -0500 X-MC-Unique: TxuAZO5IP9-2mI_tp17I7A-1 Received: by mail-wr1-f71.google.com with SMTP id n12-20020adfc60c000000b0026647ef69f4so299582wrg.10 for ; Thu, 22 Dec 2022 02:30:51 -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=3HZhiRKOMwW0E5zcWURNwxTYpMdgNAZHf4VEYz7r04Y=; b=BbLPTF330dS4fniocXv48RgvYZilgRcTRdlLbO06liYkMSjefesNfIBv2pFD0DLqvZ xJ1SzfQUPUktnxcoiX2B1XySf1UDzlmVcVsReWkYJbuPRuInTxVz5gsatH/uVEEmKi7h /klDEIZt4fxdPHa7Bw8DUbtMpw/daj1zQzQdSnPBAptuyPASHfJ/ZIV0AYvDFiFykz+/ rk/pBOsRreswYayxWFWqzAR3wS2OzOp4jE+9P86/FGgTx5j3lwbHxZDRuRhU8DUanFyK j+J6gKMiLpAjGA97q8J4G1OX/CsetIYQSQzBTMCz0jZsTPlStwPYl82nx6Ts4dZl8rwt pIIQ== X-Gm-Message-State: AFqh2kqLFQkOFNP/Nd4xnF2nSZcInyquIepHX0hXOF68/sXTHNYFYhSr pQvfHwVw7cgupLced3ILVvXhg4mfxa68KMRGhMwOCjN+uPsQpeJLc0K7leWP8A4U0Dv7lh/zP5d +akXd8J7IsQg2j0NMS6VzaaSjCxeAbXizyA3qYE27jwUs/s/4Pvi2EO2daHOSwxLPPw== X-Received: by 2002:a05:600c:3ac3:b0:3d1:cfcb:7d19 with SMTP id d3-20020a05600c3ac300b003d1cfcb7d19mr4339296wms.32.1671705049821; Thu, 22 Dec 2022 02:30:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXtQBzIxBFdRZS9NFt7MwqR/K6C1tGEM5ZgT/mCh4IDkJV0GiqWk01RQXSpff/bdQ3Bf9x1c5w== X-Received: by 2002:a05:600c:3ac3:b0:3d1:cfcb:7d19 with SMTP id d3-20020a05600c3ac300b003d1cfcb7d19mr4339279wms.32.1671705049548; Thu, 22 Dec 2022 02:30:49 -0800 (PST) Received: from localhost.localdomain ([109.167.21.147]) by smtp.gmail.com with ESMTPSA id q2-20020a1cf302000000b003d1cc0464a2sm581037wmq.8.2022.12.22.02.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 02:30:49 -0800 (PST) From: Enric Balletbo i Serra X-Google-Original-From: Enric Balletbo i Serra To: u-boot@lists.denx.de Cc: trini@konsulko.com, xypron.glpk@gmx.de, Enric Balletbo i Serra Subject: [PATCH v2 3/4] cmd: part: Add partition-related type command Date: Thu, 22 Dec 2022 11:30:31 +0100 Message-Id: <20221222103032.149098-4-eballetbo@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221222103032.149098-1-eballetbo@redhat.com> References: <20221222103032.149098-1-eballetbo@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Mailman-Approved-At: Thu, 22 Dec 2022 15:24:36 +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 | 12 ++++++++++++ 2 files changed, 41 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 0d098c7e3f..85cca0f0c7 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. Example From patchwork Thu Dec 22 10:30:32 2022 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: 1718864 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=bry2UXiO; 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 4NdCKb4ygLz1ydb for ; Fri, 23 Dec 2022 01:26:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7491E8547B; Thu, 22 Dec 2022 15:24:54 +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="bry2UXiO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6D774852B0; Thu, 22 Dec 2022 11:30:58 +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 E035F852AA for ; Thu, 22 Dec 2022 11:30:55 +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=1671705054; 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=nDJn2Y+t0Ps2fUkwy3zSsCSgEXmLVaQYfzkmYV7H11I=; b=bry2UXiOWinZJGF1tOimLN0APi2O5hcFgCWVpJFFEk9YVjcNBKw3P0oS0AwZjMw92Xop8k 1Tk7HiyPQl9683CuxPAh53JiU5m401xleQNmAdaYuU0c28cYn5KuitLIdmIqyb3uWNyXYG g8+v3vi3zu2hoD6NQvhMfcn8BX4RBGo= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-551-rqcspPTbNmSq-5aNVhrUJA-1; Thu, 22 Dec 2022 05:30:53 -0500 X-MC-Unique: rqcspPTbNmSq-5aNVhrUJA-1 Received: by mail-wm1-f71.google.com with SMTP id v188-20020a1cacc5000000b003cf76c4ae66so2161768wme.7 for ; Thu, 22 Dec 2022 02:30: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=nDJn2Y+t0Ps2fUkwy3zSsCSgEXmLVaQYfzkmYV7H11I=; b=Crtly7h+xBbTLSvZUlGPr9CXhC5eYLPkoUxNmApQx5XmAybMS5o4lDkuTNaetsdARf Nqw0YZ6JuR/VWLQdUaJVEWsOY9soifxU4QKB49sdwuFR2dBRbOJduQjNMu4g5y3rXlOZ rriMbtzUDG+5TkCL3vAxeXxYAINM4fjv/YhIwSX9ksw/3mLbIf0ffR1s77YmkHAbr6eW uTIjO0YP5zZbeNMjAFIJfvus77tHPIb00ohHGzslpk0JQ/L0Kiy2ctvj+rk9Uubxy3Ya d51rnbAExxhHTXgptzQnc3QMocBKlNEcTG4AhOCoDCHvUW+pvMJWSejZvqL6MOhhjQUw pxiA== X-Gm-Message-State: AFqh2koZPDMgU5BX3WFWWrt+iGjQYJLVDSGO753+assdNBSqx2FFgBPw 2YTWvLba6MYxrysX9TgwryCmaGg8Xc82N4+ZxvW0U5mSu1rbufxXwhBu3SEegJcM1Kq3+CZIRdm ddRMjzxIzIy13+Jz4fy/qQPbeSlZcZh/T4WKr7sUHM8TRGcLaXa+ZeYnZthuR6xDPQg== X-Received: by 2002:a05:600c:4998:b0:3cf:68d3:3047 with SMTP id h24-20020a05600c499800b003cf68d33047mr3782401wmp.41.1671705051775; Thu, 22 Dec 2022 02:30:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXsEDyRDa9EZ8eJHraC+jEvGXhU4Kfkma+le7kucrNiHRibA/DLN7ataTPwacCBUCCTmqC5O7w== X-Received: by 2002:a05:600c:4998:b0:3cf:68d3:3047 with SMTP id h24-20020a05600c499800b003cf68d33047mr3782380wmp.41.1671705051527; Thu, 22 Dec 2022 02:30:51 -0800 (PST) Received: from localhost.localdomain ([109.167.21.147]) by smtp.gmail.com with ESMTPSA id q2-20020a1cf302000000b003d1cc0464a2sm581037wmq.8.2022.12.22.02.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 02:30:51 -0800 (PST) From: Enric Balletbo i Serra X-Google-Original-From: Enric Balletbo i Serra To: u-boot@lists.denx.de Cc: trini@konsulko.com, xypron.glpk@gmx.de, Enric Balletbo i Serra , Philippe Reynes , Simon Glass Subject: [PATCH v2 4/4] test/py: gpt: add test for the gpt partition type GUID identifier Date: Thu, 22 Dec 2022 11:30:32 +0100 Message-Id: <20221222103032.149098-5-eballetbo@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221222103032.149098-1-eballetbo@redhat.com> References: <20221222103032.149098-1-eballetbo@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Mailman-Approved-At: Thu, 22 Dec 2022 15:24:36 +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')