From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: Quentin Schulz <quentin.schulz@cherry.de>,
U-Boot Mailing List <u-boot@lists.denx.de>,
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>
Subject: Re: [PATCH v2 15/18] bootstd: Provide a command to select the bootdev order
Date: Mon, 5 May 2025 10:41:43 -0600 [thread overview]
Message-ID: <20250505164143.GG5430@bill-the-cat> (raw)
In-Reply-To: <CAFLszTh1Sm9ymBDRLqwncaSHyRVYiabsQvd-hUrzLwo2iOvUnQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3419 bytes --]
On Mon, May 05, 2025 at 05:37:33PM +0200, Simon Glass wrote:
> Hi Quentin,
>
> On Mon, 5 May 2025 at 10:34, Quentin Schulz <quentin.schulz@cherry.de> wrote:
> >
> > 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?
>
> Not for this, yet.
>
> >
> > [...]
> >
> > > 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?
>
> The environment variable is there to maintain backwards compatibility
> with the distro scripts. It now seems that we are unlikely to ever
> drop those, but you never know.
Repeating myself from some other discussion before, it's not just "distro
scripts", managing things with the environment is an intentional
feature, not a backwards compatible legacy thing. Solutions to "boot
this device" that do not have some support for using the environment to
modify things as needed are unlikely to be flexible enough for all use
cases.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2025-05-05 16:41 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
2025-05-05 15:37 ` Simon Glass
2025-05-05 16:41 ` Tom Rini [this message]
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=20250505164143.GG5430@bill-the-cat \
--to=trini@konsulko.com \
--cc=jerome.forissier@linaro.org \
--cc=lehmanju@devpi.de \
--cc=marek.vasut+renesas@mailbox.org \
--cc=mkorpershoek@baylibre.com \
--cc=pbrobinson@gmail.com \
--cc=quentin.schulz@cherry.de \
--cc=sjg@chromium.org \
--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.