From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Matthew Garrett <mgarrett@aurora.tech>,
Simon Glass <sjg@chromium.org>,
AKASHI Takahiro <akashi.tkhro@gmail.com>,
Dmitry Rokosov <ddrokosov@salutedevices.com>,
Francis Laniel <francis.laniel@amarulasolutions.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Jerome Forissier <jerome.forissier@linaro.org>,
Mattijs Korpershoek <mkorpershoek@baylibre.com>,
Tom Rini <trini@konsulko.com>
Subject: [PATCH 2/8] part_find: Enable for sandbox and correct radix and calls
Date: Mon, 9 Dec 2024 09:27:55 -0700 [thread overview]
Message-ID: <20241209162801.288363-3-sjg@chromium.org> (raw)
In-Reply-To: <20241209162801.288363-1-sjg@chromium.org>
Enable this command for sandbox and the EFI app.
Recent work removed the if_type member. Update the code to use the new
method for obtaining the interface type.
Use hex so that large partition numbers (>=10) work correctly.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
cmd/Kconfig | 1 +
cmd/part_find.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 8fc76778d87..c8ca55194c0 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1552,6 +1552,7 @@ config CMD_PART
config CMD_PART_FIND
bool "part_find"
depends on PARTITIONS
+ default y if SANDBOX || EFI_APP
select HAVE_BLOCK_DEVICE
select PARTITION_UUIDS
select PARTITION_TYPE_GUID
diff --git a/cmd/part_find.c b/cmd/part_find.c
index 8c071d3c374..38919935641 100644
--- a/cmd/part_find.c
+++ b/cmd/part_find.c
@@ -107,7 +107,7 @@ static int part_find(int argc, char *const argv[])
&loader_part_no)) {
char env[256];
- ret = snprintf(env, sizeof(env), "%s %d:%d", blk_get_if_type_name(desc->if_type), desc->devnum, loader_part_no);
+ ret = snprintf(env, sizeof(env), "%s %x:%x", blk_get_if_type_name(desc->if_type), desc->devnum, loader_part_no);
if (ret < 0 || ret == sizeof(env))
return CMD_RET_FAILURE;
if (env_set("target_part", env))
@@ -123,7 +123,7 @@ static int part_find(int argc, char *const argv[])
break;
if (strcasecmp(argv[1], info.type_guid) == 0) {
char env[256];
- ret = snprintf(env, sizeof(env), "%s %d:%d", blk_get_if_type_name(desc->if_type), desc->devnum, i);
+ ret = snprintf(env, sizeof(env), "%s %x:%x", blk_get_uclass_name(desc->uclass_id), desc->devnum, i);
if (ret < 0 || ret == sizeof(env))
return CMD_RET_FAILURE;
env_set("target_part", env);
--
2.34.1
next prev parent reply other threads:[~2024-12-09 16:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 16:27 [PATCH 0/8] efi: Add docs and tests and a few tweaks Simon Glass
2024-12-09 16:27 ` [PATCH 1/8] fdtdec: Correct devicetree symbol for EFI app Simon Glass
2024-12-09 16:27 ` Simon Glass [this message]
2024-12-09 16:27 ` [PATCH 3/8] doc: test: Add docs and test for part_find Simon Glass
2024-12-10 8:15 ` Heinrich Schuchardt
2024-12-10 16:16 ` Simon Glass
2024-12-10 17:08 ` Tom Rini
2024-12-16 0:29 ` Simon Glass
2024-12-16 8:05 ` Heinrich Schuchardt
2024-12-09 16:27 ` [PATCH 4/8] efi: Drop config.h Simon Glass
2024-12-09 16:27 ` [PATCH 5/8] cmd: Refactor part_find() into separate functions Simon Glass
2024-12-09 16:27 ` [PATCH 6/8] addr_find: Use a simple lmb allocation Simon Glass
2024-12-09 16:28 ` [PATCH 7/8] doc: test: Add docs and test for addr_find Simon Glass
2024-12-09 16:28 ` [PATCH 8/8] efi: Avoid a memory leak in efi_bind_block() on error path Simon Glass
2024-12-10 8:10 ` Heinrich Schuchardt
2024-12-16 15:15 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241209162801.288363-3-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=akashi.tkhro@gmail.com \
--cc=ddrokosov@salutedevices.com \
--cc=francis.laniel@amarulasolutions.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jerome.forissier@linaro.org \
--cc=mgarrett@aurora.tech \
--cc=mkorpershoek@baylibre.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox