Re: [PATCH 1/2] host/rootfs: use initramfs in "make run"

Alyssa Ross
2022-09-08T10:53:05Z

[-- Attachment #1: Type: text/plain, Size: 2503 bytes --]

José Pekkarinen <jose.pekkarinen@unikie.com> writes:

> On Thu, Sep 1, 2022 at 1:47 PM Alyssa Ross <hi@alyssa.is> wrote:
>
>> This will allow us to stop compiling e.g. the virtio-blk module into
>> the kernel, because it will be loaded by the initramfs.
>>
>> This introduces some duplication between the rootfs and initramfs's
>> Makefiles. I don't think it's worth the effort at the moment to try
>> to reduce that, because it would come at the expense of additional
>> complexity in the Makefiles. We can revisit this later if we want to.
>>
>> Signed-off-by: Alyssa Ross <hi@alyssa.is>
>
> Hi,
>
> This patchset introduces errors in the default qemu
>
> configuration of spectrum, where it is possible to see in the
> console log attempts to load broken aliases like:
>
> modprobe: FATAL: Module acpi:PNP0C0F: not found in directory
> /lib/modules/5.18.0

This is pretty much expected. The only job of the initramfs is to get
the root filesystem mounted, so most kernel modules are not included in
it to keep the size down. It just contains modules related to block
devices, dm-verity, ext4, etc. If a we try to load a driver in
initramfs, and it isn't available, that's fine, because when we get to
the root filesystem, we run mdevd-coldplug again, and the module will be
loaded at that point.

The reason this didn't happen before when testing Spectrum in a VM is
that since all the drivers we needed were built in to the kernel, the
the block device nodes would be available before userspace even started,
meaning that the initramfs simply wouldn't have any time to try and fail
loading any other drivers before the rootfs was ready. On hardware,
where the appropriate drivers wouldn't have been built in, I assume
these messages would already have been normal without this change,
although I didn't test.

> As well as valid modules load failures like:
>
> modprobe: ERROR: could not insert 'vfio_pci': Invalid argument

I wasn't able to reproduce this, with this series applied on top of
commit c0b9dff8653b59f5d2a24bb539cba6c91d3f7506,
Nixpkgs commit 4d05083dd894b73941e2e7d3b4f428b0ce1c7007, running
Spectrum with `make run' in the host/rootfs directory. I started netvm
and verified that the QEMU ethernet device was successfully passed
through as well, so vfio-pci was definitely working.

Does that differ to the versions you were using to test? If so, could
you try with those versions and let me know if that works for you?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]