[edk2-devel] [PATCH 1/2] OvmfPkg/build.sh: use newer '-drive if=pflash' syntax when running qemu

Jordan Justen jordan.l.justen at intel.com
Wed Jul 24 17:26:34 UTC 2019


On 2019-07-24 05:27:28, Philippe Mathieu-Daudé wrote:
> On 7/24/19 4:54 AM, Jordan Justen wrote:
> > On 2019-07-23 18:51:00,  wrote:
> >> Specify the firmware to use via the newer '-drive if=pflash' syntax
> >> which allows specifying the raw format and readonly parameters. This
> >> avoids warnings with newer version of QEMU.
> >>
> >> Signed-off-by: Rebecca Cran <rebecca at bsdio.com>
> >> ---
> >>  OvmfPkg/build.sh | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh
> >> index a2c4eff2a5..e2890ff762 100755
> >> --- a/OvmfPkg/build.sh
> >> +++ b/OvmfPkg/build.sh
> >> @@ -268,7 +268,7 @@ if [[ "$RUN_QEMU" == "yes" ]]; then
> >>    fi
> >>    ln -sf $FV_DIR/OVMF.fd $QEMU_FIRMWARE_DIR/bios.bin
> >>    if [[ "$ENABLE_FLASH" == "yes" ]]; then
> >> -    QEMU_COMMAND="$QEMU_COMMAND -pflash $QEMU_FIRMWARE_DIR/bios.bin"
> >> +    QEMU_COMMAND="$QEMU_COMMAND -drive if=pflash,format=raw,readonly,file=$QEMU_FIRMWARE_DIR/bios.bin"
> > 
> > It looks like we set ENABLE_FLASH for qemu 1.6 and newer. Does this
> > work on 1.6?
> > 
> > Also, I don't think we want readonly. Read-write should allow
> > non-volatile variables to persist across multiple boot.
> 
> This flash only contains the CODE, not the non-volatile VARS, using
> readonly makes sense to me.

That's not the case here. The build.sh support uses a combined
code/vars binary. Originally the qemu pflash support only supported a
single binary. At this point we can probably assume that a new enough
version of qemu is available that supports multiple pflash devices, so
build.sh could be upgraded to use the split binaries.

Hmm, it looks like qemu 2.0 is when the multiple flash device support
was added: https://wiki.qemu.org/ChangeLog/2.0

The build.sh script currently attempts to detect 1.6 and newer for
flash support. pflash first appeared in 1.1, but kvm support was added
in 1.6. I think it'd be reasonable to alter the script to not use
flash for qemu < 2.0, to enable using separate code and vars binaries.

-Jordan

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#44325): https://edk2.groups.io/g/devel/message/44325
Mute This Topic: https://groups.io/mt/32580104/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list