From: Quentin Schulz <quentin.schulz@cherry.de>
To: Simon Glass <sjg@chromium.org>,
U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
Jerome Forissier <jerome.forissier@linaro.org>,
Julius Lehmann <lehmanju@devpi.de>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Mattijs Korpershoek <mkorpershoek@baylibre.com>,
Peter Robinson <pbrobinson@gmail.com>,
Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v2 15/18] bootstd: Provide a command to select the bootdev order
Date: Mon, 5 May 2025 10:34:34 +0200 [thread overview]
Message-ID: <5403d72f-65b3-47f8-912e-d1b64e111f00@cherry.de> (raw)
In-Reply-To: <20250501133726.2627373-16-sjg@chromium.org>
Hi Simon,
On 5/1/25 3:37 PM, Simon Glass wrote:
[...]
> diff --git a/boot/bootstd-uclass.c b/boot/bootstd-uclass.c
> index 9bee73ead58..294865feb64 100644
> --- a/boot/bootstd-uclass.c
> +++ b/boot/bootstd-uclass.c
> @@ -6,6 +6,8 @@
> * Written by Simon Glass <sjg@chromium.org>
> */
>
> +#define LOG_CATEGORY UCLASS_BOOTSTD
> +
> #include <alist.h>
> #include <blk.h>
> #include <bootdev.h>
> @@ -132,6 +134,22 @@ const char *const *const bootstd_get_bootdev_order(struct udevice *dev,
> return std->bootdev_order;
> }
>
> +void bootstd_set_bootdev_order(struct udevice *dev, const char **order_str)
> +{
> + struct bootstd_priv *std = dev_get_priv(dev);
> + const char **name;
> +
> + free(std->bootdev_order); /* leak; convert to use alist */
> +
leak? and aren't you using alist already?
[...]
> diff --git a/doc/usage/cmd/bootdev.rst b/doc/usage/cmd/bootdev.rst
> index 98a0f43c580..abede194cba 100644
> --- a/doc/usage/cmd/bootdev.rst
> +++ b/doc/usage/cmd/bootdev.rst
> @@ -13,6 +13,7 @@ Synopsis
>
> bootdev list [-p] - list all available bootdevs (-p to probe)
> bootdev hunt [-l|<spec>] - use hunt drivers to find bootdevs
> + bootdev order [clear] | [<spec> ...] - view or update bootdev order
> bootdev select <bm> - select a bootdev by name
> bootdev info [-p] - show information about a bootdev
>
> @@ -78,6 +79,27 @@ To run hunters, specify the name of the hunter to run, e.g. "mmc". If no
> name is provided, all hunters are run.
>
>
> +bootdev order
> +~~~~~~~~~~~~~
> +
> +This allows the bootdev order to be examined or set. With no argument the
> +current ordering is shown, one item per line.
> +
> +The argument can either be 'clear' or a space-separated list of labels. Each
> +label can be the name of a bootdev (e.g. "mmc1.bootdev"), a bootdev sequence
> +number ("3") or a media uclass ("mmc") with an optional sequence number (mmc2).
> +
> +Use `bootdev order clear` to clear any ordering and use the default.
> +
> +By default, the ordering is defined by the `boot_targets` environment variable
> +or, failing that, the bootstd node in the devicetree ("bootdev-order" property).
> +If no ordering is provided, then a default one is used.
> +
Not sure what's the benefit if we can simply set the environment variable?
FWIW, it's what we do in
board/theobroma-systems/common/common.c:setup_boottargets()
One of the benefits I see is dumping the order if that variable isn't
set (and also not in the DT), but shouldn't that be information we
should be getting from `bootdev list` instead?
The point I'm trying to make is do we need yet another way to set the
bootdev order? Printing the order would be welcomed I guess but that
could be as simple as printing boot_targets environment variable, the DT
property or whatever the default is if both are missing.
If we are to keep the clear command, I would use a flag instead of an
argument to be consistent with the other bootdev commands, e.g.
something like `bootdev order -c`.
> +Note that this command does not check that the ordering is valid. In fact the
> +meaning of the ordering depends on what the bootflow iterator discovers when it
> +is used. Invalid entries will result in no bootdevs being found for that entry,
> +so they are effectively skipped.
> +
> bootdev select
> ~~~~~~~~~~~~~~
>
> @@ -171,6 +193,20 @@ This shows using one of the available hunters, then listing them::
> Capacity: 0.0 MB = 0.0 GB (1 x 512)
> =>
>
> +This shows viewing and changing the ordering::
> +
> + => bootdev order
> + mmc2
> + mmc1
> + => bootdev order 'mmc usb'
> + => bootdev order
> + mmc
> + usb
> + => bootdev order clear
> + => bootdev order
> + No ordering
Shouldn't we be provided with a default one?
Cheers,
Quentin
next prev parent reply other threads:[~2025-05-05 8:34 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-01 13:37 [PATCH v2 00/18] bootstd: Useability improvements Simon Glass
2025-05-01 13:37 ` [PATCH v2 01/18] abuf: Add a helper for initing and allocating a buffer Simon Glass
2025-05-05 20:38 ` Tom Rini
2025-05-06 13:23 ` Simon Glass
2025-05-06 19:48 ` Tom Rini
2025-05-10 11:27 ` Simon Glass
2025-05-12 22:35 ` Tom Rini
2025-05-14 19:44 ` Simon Glass
2025-05-24 7:51 ` Simon Glass
2025-05-24 14:20 ` Tom Rini
2025-05-24 14:31 ` Simon Glass
2025-05-24 14:35 ` Tom Rini
2025-05-01 13:37 ` [PATCH v2 02/18] fs: boot: Update fs_read_alloc() to use abuf Simon Glass
2025-05-01 13:37 ` [PATCH v2 03/18] fs: boot: Update fs_load_alloc() " Simon Glass
2025-05-01 13:37 ` [PATCH v2 04/18] fs: boot: Update bootmeth_alloc_other() " Simon Glass
2025-05-01 13:37 ` [PATCH v2 05/18] bootstd: Add more debugging to bootmeth_efi Simon Glass
2025-05-01 13:37 ` [PATCH v2 06/18] bootstd: Add more debugging to bootmeth_extlinux Simon Glass
2025-05-01 13:37 ` [PATCH v2 07/18] bootstd: Try all bootmeths on the final partition Simon Glass
2025-05-01 13:37 ` [PATCH v2 08/18] bootstd: Fully complete iteration of a uclass Simon Glass
2025-05-01 13:37 ` [PATCH v2 09/18] test/py: Split out core of Fedora image into a new function Simon Glass
2025-05-01 13:37 ` [PATCH v2 10/18] test/py: Add an extlinux file similar to Ubuntu Simon Glass
2025-05-01 13:37 ` [PATCH v2 11/18] usb: Use more useful names for block devices Simon Glass
2025-05-01 13:37 ` [PATCH v2 12/18] sandbox: Use a unique name for each USB controller Simon Glass
2025-05-01 13:37 ` [PATCH v2 13/18] bootstd: Tweak scanning with labels Simon Glass
2025-05-01 13:37 ` [PATCH v2 14/18] bootstd: Tidy up a nested CONFIG_IS_ENABLED(BOOTSTD) Simon Glass
2025-05-01 13:37 ` [PATCH v2 15/18] bootstd: Provide a command to select the bootdev order Simon Glass
2025-05-05 8:34 ` Quentin Schulz [this message]
2025-05-05 15:37 ` Simon Glass
2025-05-05 16:41 ` Tom Rini
2025-05-06 13:24 ` Simon Glass
2025-05-01 13:37 ` [PATCH v2 16/18] bootstd: Correct the comment for bootmeth_set_order() Simon Glass
2025-05-01 13:37 ` [PATCH v2 17/18] bootstd: Expand debugging in bootdev_find_in_blk() Simon Glass
2025-05-01 13:37 ` [PATCH v2 18/18] bootstd: Mention FS state in bootmeth_read_bootflow() 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=5403d72f-65b3-47f8-912e-d1b64e111f00@cherry.de \
--to=quentin.schulz@cherry.de \
--cc=jerome.forissier@linaro.org \
--cc=lehmanju@devpi.de \
--cc=marek.vasut+renesas@mailbox.org \
--cc=mkorpershoek@baylibre.com \
--cc=pbrobinson@gmail.com \
--cc=sjg@chromium.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.