[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiboot2 and module2 boot issues via GRUB2


  • To: Roman Shaposhnik <roman@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <grub-devel@xxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 30 Mar 2021 20:08:13 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9VD8Ex+jjCHS1bOeQS6HAdC2uGW47/bL6H+BbZGc01g=; b=W+cOWjAP/RzlCJb/BNhNaPgsqZgkaP2quHOlaje31hOmH9WNGhpKE35ZxUttsHHonN6PuOvknRFXNgafjwBQxixZtinJRjATUEIMfThyCKHedOuk8UH63TpelZOE2G1sC15s7TXX67MOvJJHRNCyOG562izAQzvrLI+tODQF2cSaNNxovA+LRE5GRepzQCbvkwEJv2aLeb2+X87QJEoed3UEkIJdLZLsZbGpjjQCz+L5zecNHLd4UZRRmU7lndjb0bqS97gW4PnaDSpduOfQsL3muDHcpH4hJbRJvg7fxfs9ve1h1KfWDwqeVH7mq3McbhVEr0I0tNkPyAdSL9v3tA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nyoNqieBytD2H2J3JisUHocXLkpis7ZVcK9OUk5ObDXa/lNBffnDTK8PhFFd7+5jRkIC38CDZREn9v3ruIL43uYQOaar0G+ABHzoMcN+mf70hzuSQVMxVO4hdcdFXWYmhwrA8bBY/VaZ8J0yr6N6Rq/LAsX4fVQXXVq3FP0E2cnSrvgOpz7HWIEjTApv2HXsNHk1mcLGGUgrzoYT3kB0WuFzzUrq9DhRcpv57oggJ1MpMK0JJAAOzEpiFZWBESwaz3Dhb2Zh4eAKyXB51E33wpoHr/FqVudEQuoIVzkTKWWZ3dK+nuiROMr09s0tk5DTZ/FpBIxEjC7WlNN2I1Jqmw==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Delivery-date: Tue, 30 Mar 2021 19:08:41 +0000
  • Ironport-hdrordr: A9a23:lETBSK8WwodC7MzRPWpuk+FJcL1zdoIgy1knxilNYDRvWIixi9 2ukPMH1RX9lTYWXzUalcqdPbSbKEmyybdc2qNUGbu5RgHptC+TLI9k5Zb/2DGIIUHD38Zn/+ Nbf6B6YeecMXFTkdv67A6kE9wp3dmA9+SSif3Dymp2JDsKV4hL6QBlBgGHVmh/QwdbDZQ0fa DsmvZvjTymZHgRc4CHHXEDRefOvJnmk5jhbB4ACXccmXSzpBmv76P3FAXd4wcGX1p0sM0f2E Xmsyi83KWstPmn1gTRvlW80716kMbso+EzffCkpdMSLlzX+2KVTaRnH4aPpTUk5NyogWxa6+ XkhzcFE4BN52jKfmezyCGdqzXI9Do18XftxRu5rBLY0KrEbQk3AcZAmo5VGyGxgyFL3KAeod B29lmUuJZNARTLkD6V3amsazhQmlepun1nqOYPjhVkIPojQYVMpo8S9l49KuZmIAvG7ukcYY tTJf3H6O0TWV2XaG2xhBgW/PWcGl43HhuAX3EYvN2U3zV8jBlCvjUl7f1asXEa+J0nTZ5Yo8 zCL6RzjblLCvQbdKRnGY46MIaKI12IZSiJHHOZIFzhGq1CE3XRq6Tv6LFwwO2xYpQHwLY7hZ ypaiIViUcCP2bVTeGe1pxC9R7ABE+nWy72981Y759l/pXhWbvCK0S4ORETuvrlh89aLtzQWv 61Np4TKeTkN3HSFYFA2BC7c4VOKEMZTNYetr8AKhyzi/OODrevmv3Qcf7VKraoOy0jQHnDDn wKWyW2C95H6mytR3/kkDncU37gYSXEjNFNOZmf29JW5JkGN4VKvARQo0++/Nu3JTpLtbFzXE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zkMKvHAYyWHwHal/Sgafomp3WTr3TuRTbHHHxtjywFmXky4OkXFMzv0LAl8tp/RBj4gNY1y/ K6Y=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.