> 2025年3月29日 01:07,Bastian Blank <bbl...@thinkmo.de> 写道:
>
> Hi
>
> On Fri, Mar 28, 2025 at 10:13:56PM +0800, Miao Wang wrote:
>> The EFI ROMs are tested during the CI process using the following
>> command:
>>
>> qemu-system-x86_64 -cpu kvm64 -machine pc -bios OVMF.fd \
>> -smp cpus=1,cores=1,sockets=1 -m 1G \
>> -chardev stdio,mux=on,id=char0 \
>> -nographic -monitor none -serial chardev:char0 \
>> -device virtio-rng-pci \
>> -netdev user,id=net0 \
>> -device <nic-model>,netdev=net0,id=net0,romfile="fw_file",bootindex=1
>
> This does not work in Trixie
> - qemu 1:10.0.0~rc1+ds-1
> - ipxe-qemu 1.21.1+git20250317.42a29d56+dfsg-1
> - ovmf 2025.02-4
>
> It immediately goes to the EDK2 included PXE support.
That's the expected behavior.
>
> So which exact versions is your test using?
>
>> It seems that you are expecting the iPXE stack in the ROMs, i.e.
>> to be able to execute iPXE scripts, which is not actually intended usage.
>> The ROMs for EFI boot only provides the firmware with the driver of
>> the virtual NIC from iPXE, without the iPXE stack. The upper PXE stack
>> is from the firmware. So if everything works as intended, you are
>> expected to see ``>>Start PXE over IPv4." instead of ``iPXE initialising
>> devices..."
>
> So this is not actually a iPXE and you should not call it that.
ipxe-qemu contains actually ROMs compiled from iPXE for qemu to be able to
pxe boot.
The upstream source of qemu contains such ROMs as blobs, which can be found
in [1], and the command-line to generate them can be found in [2], which
includes the option CONFIG=qemu, which introduces EFI_DOWNGRADE_UX in [3].
The macro disables the ipxe stack and leaves only basic NIC driver, which
is described in [4]. We also use CONFIG=qemu when compiling the ROMs in
the ipxe-qemu package. So the ROMs in the ipxe-qemu package provide at
least the same functionality as those in the upstream qemu source.
The introduction of CONFIG=qemu, and the removal of iPXE stack in UEFI ROMs,
is since 1.21.1+git20220113.fbbdc3926+dfsg-1, when Sven Geuer back-ported
changes from ubuntu, since ipxe is not actively maintained for about 5 years,
and the discussion of this change in ubuntu can be found in [5].
Personally, I'm in favor of this change and agree the opinion in [5].
Furthermore, we now are unable to include the iPXE stack back into the ROMS,
since we will hit the 256KB limit if doing so. The reason of the 256KB limit
can be found in #1095073.
> Is this change properly documented?
>
Sven Geuer did not include this change in NEWS. I think this change is worth
to be mentioned in NEWS. I'll manage this to be recorded in NEWS if the
policy permits.
Cheers,
Miao Wang
[1]: https://github.com/qemu/qemu/tree/master/pc-bios
[2]: https://github.com/qemu/qemu/blob/master/roms/Makefile#L124-L132
[3]: https://github.com/ipxe/ipxe/blob/master/src/config/qemu/general.h#L10
[4]:
https://github.com/ipxe/ipxe/commit/a15c0d7e868a881d4416ad20eddad1854ff95005
[5]: https://bugs.launchpad.net/maas/+bug/1789319/comments/16