On Di, 23.09.25 16:25, Itxaka Serrano Garcia ([email protected]) 
wrote:

> On Tue, Sep 23, 2025 at 4:11 PM Lennart Poettering <[email protected]>
> wrote:
>
> > On Di, 23.09.25 09:26, Itxaka Serrano Garcia (
> > [email protected]) wrote:
> >
> > > Also a small thing, there is nothing on the docs on how to select a
> > profile
> > > via Type 1 entries, is that even possible? Does it go into the efi stanza
> > > like EFI_FILE@PROFILE_NUMBER or something?
> >
> > You have to prefix the cmdline you pass to the UKI with "@4" to selec
> > profile 4, and so on.
> >
> > Hence, it's part of the cmdline in a way, but also not, as we strip it
> > before measuring things. That's the reason we use this weird "@" based
> > syntax, to indicate visually that this is something that is not really
> > like a regular kernel cmdline argument.
> >
>
> But in a measured UKI the cmdline is, or more specifically it can be,
> inmutable, so you have to know when building your cmdline for your uki
> which profile is going to be? Or do you mean using the `options` key in a
> Type 1 entry?

The "options" key is what I meant. And sd-stub in the UKI will strip
out the "@n" prefix, and not measure it as part of the cmdline. It
will also not pass it to the invoked kernel. (it will measure it
separately though)

> I think that's very confusing, plus nowhere in the docs, which makes it
> even more confusing hehe. No wonder I could not make it work with
> Type 1.

It is documented to some degree, see systemd-stub man page, there's a whole 
section
about multi-profile UKIs. Quoting the relevant sentences:

      The profile to boot may be controlled via the UKI's own command
      line: if the first argument starts with "@", followed by a
      positive integer number in decimal, it selects the profile to
      boot into. If the first argument is not specified like that, the
      UKI will automatically boot into profile 0.

(It doesn't clarify what this means for measurements though, maybe we should
change that.)

Lennart

--
Lennart Poettering, Berlin

Reply via email to