From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Roman Shaposhnik <roman@zededa.com>,
Xen-devel <xen-devel@lists.xenproject.org>, <grub-devel@gnu.org>
Subject: Re: multiboot2 and module2 boot issues via GRUB2
Date: Tue, 30 Mar 2021 20:08:13 +0100 [thread overview]
Message-ID: <23baec07-a3ae-949a-a1fb-09100efd53e5@citrix.com> (raw)
In-Reply-To: <CAMmSBy8Wpwgj3V0U8OhsZCgyAxOjTeHDMt-Vw+om1koopmxTsg@mail.gmail.com>
On 30/03/2021 19:28, Roman Shaposhnik wrote:
> Hi!
>
> seems like I've run into an issue with multiboot2 and module2
> commands that I can't quite explain. Since it may be something
> super simply and silly -- I wanted to reach out here before I do
> a GRUB/Xen/LK source deepdive.
>
> So here's the deal: whenever I boot straight up Linux kernel
> I can do the following sequence of commands:
> linux /kernel
> initrd foo.cpio.gz bar.cpio.gz
> and have linux kernel effectively stack content of bar.cpio.gz
> on top of foo.cpio.gz and present a unified initramfs that way.
>
> I'm trying to replicate it with Xen, but:
> multiboot2 /boot/xen.gz
> module2 /kernel
> module2 foo.cpio.gz
> module2 bar.cpio.gz
> only seems to be picking up foo.cpio.gz
>
> Has anyone run into this issue before?
I can explain why that happens. Not sure if it counts as a feature, bug
or mis-expectation, but CC'ing grub-devel for their input.
The initrd command is presumably concatenating those two files together
in memory, and presenting Linux a single initrd pointer.
For the module2 example, you're putting 3 distinct files in memory, and
giving Xen a list 3 modules.
Xen is capable of taking various things via modules, such as an
XSM/Flask policy, or microcode, so has logic to identify these if
present and separate them from "other stuff". However, there is a
hardcoded expectation that the first module is the dom0 kernel, and the
next unrecognised module, if present, is *the* initrd.
I expect that Xen isn't handing bar.cpio.gz on to dom0, but I'm not sure
whether passing two distinct initrd-like-things to Linux is even possible.
What you presumably want is some `initrd` side effect in Grub so you can
write `module2 foo.cpio.gz bar.cpio.gz` and have it concatenate things
together in memory and present one MB2 module, but I suspect that exact
syntax might be ambiguous with command line handling. I have no idea
whether such a command currently exists.
~Andrew
next prev parent reply other threads:[~2021-03-30 19:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 18:28 multiboot2 and module2 boot issues via GRUB2 Roman Shaposhnik
2021-03-30 19:08 ` Andrew Cooper [this message]
2021-04-01 1:06 ` Roman Shaposhnik
2021-04-01 7:31 ` Jan Beulich
2021-04-01 8:44 ` Roger Pau Monné
2021-04-01 19:43 ` Andrew Cooper
2021-04-06 8:19 ` Jan Beulich
2021-04-06 17:37 ` Roman Shaposhnik
2021-04-06 17:51 ` Andrew Cooper
2021-04-06 18:03 ` Roman Shaposhnik
2021-04-06 18:41 ` Andrew Cooper
2021-04-07 20:50 ` Glenn Washburn
2021-04-08 16:48 ` Daniel Kiper
2021-03-30 19:35 ` Elliott Mitchell
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=23baec07-a3ae-949a-a1fb-09100efd53e5@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=grub-devel@gnu.org \
--cc=roman@zededa.com \
--cc=xen-devel@lists.xenproject.org \
/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;
as well as URLs for NNTP newsgroup(s).