On 28/01/2020 22:31, Andrea Bolognani wrote:
> On Thu, 2020-01-23 at 16:11 +1100, David Gibson wrote:
>> On Wed, Jan 22, 2020 at 06:14:37PM +1100, Alexey Kardashevskiy wrote:
>>> On 22/01/2020 17:32, David Gibson wrote:
>>>> I'm not thinking of "grub" as a separate option - that would be the
>>>> same as "vof". Using vof + no -kernel we'd need to scan the disks in
>>>> the same way SLOF does, and look for a boot partition, which will
>>>> probably contain a GRUB image.
>>>
>>> I was hoping we can avoid that by allowing
>>> "-kernel grub" and let grub do filesystems and MBR/GPT.
>>
>> I don't want that to be the only way, because I want the GRUB
>> installed by the OS installer to be the GRUB we use.
>
> Agreed, the bootloader and the kernel should live inside the guest
> image and not on the host's filesystem.
Well, I tried. Added simple MBR+GPT parser, loaded ELF and discovered
that load_elf32/64 does not parse ELFs from memory, only from files.
Anyone keen on fixing that? :) My current workaround is to load grub
from the disk, then store it /tmp and load this as it was passed via
-kernel which is ugly..
--
Alexey