All of lore.kernel.org
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Tom Hale <tom@hale.ee>,
	u-boot@lists.denx.de,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Tom Rini <trini@konsulko.com>
Subject: Re: Boot from specified partition (or FS) UUID without knowing Device ID
Date: Sat, 19 Feb 2022 10:51:10 +0900	[thread overview]
Message-ID: <20220219015110.GC6672@laputa> (raw)
In-Reply-To: <f493c852-92ba-9555-9960-5514b52c4d9f@gmx.de>

On Fri, Feb 18, 2022 at 06:41:18PM +0100, Heinrich Schuchardt wrote:
> On 2/18/22 18:07, Tom Rini wrote:
> > On Fri, Feb 18, 2022 at 02:01:41PM +0700, Tom Hale wrote:
> > 
> > > I want to have a fallback boot situation where boot is first tried from one
> > > partition, and then from another partition (on a different device) if the
> > > first partition isn't available (eg, if the first device fails).
> > > 
> > > Can I boot from a specific FS UUID or a partition UUID without knowing a
> > > particular device ID?  (I'm not sure if my devices will always be detected
> > > in a repeatable order).
> > > 
> > > Can fatload be used with only a partition UUID?  Or can I somehow get the
> > > dev number from the UUID?
> 
> The UEFI boot manager uses device paths which comprise the partition
> GUIDs. Currently we use the full device path.
> 
> Windows and efibootmgr just store the partition and the file path in
> boot options and non-U-Boot UEFI implementation will work fine with

What do you mean by "efibootmgr"?
It sounds to be the name of U-Boot's implementation of UEFI Boot Manager.

> this. E.g.
> 
> HD(2,GPT,12345678-1234-5678-ABCD-123456789ABC,0x109000,0x32000)/File(\EFI\debian\shimx64.efi)

This is called a short path and already supported in U-Boot UEFI implementation.
See efi_dp_find_obj().

> I think this approach should also be adopted for U-Boot when the file is
> on a GPT partition.

To be clear, setting a device path in a boot option is not boot manager's
responsibility, but efidebug's, at least for now.
So even now, if efidebug is modified to allow for a short path, it should
work with current "efibootmgr" (although I have never tried it before).

# FYI, the current implementation of creating a "full" device path from
# U-Boot's probe mechanism/DM has a fatal problem of uniqueness. I have
# mentioned the issue partially in my "removable media" support RFC but
# will have to address it fully in the future.

-Takahiro Akashi

> Would this solve your problem?
> 
> Best regards
> 
> Heinrich
> 
> > 
> > As UUIDs are unique per device but our device probe order is (nominally,
> > there's counter examples) static, this would be a more board specific
> > way of going than knowing which media is which device.
> > 
> 

  reply	other threads:[~2022-02-19  1:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18  7:01 Boot from specified partition (or FS) UUID without knowing Device ID Tom Hale
2022-02-18 17:07 ` Tom Rini
2022-02-18 17:41   ` Heinrich Schuchardt
2022-02-19  1:51     ` AKASHI Takahiro [this message]
2022-02-19  1:55       ` Heinrich Schuchardt

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=20220219015110.GC6672@laputa \
    --to=takahiro.akashi@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=tom@hale.ee \
    --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.