[edk2-devel] [PATCH v3] Revert "OvmfPkg: Update build.sh to allow building OVMF then running QEMU"

Mike Beaton posted 1 patch 7 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/edk2 tags/patchew/20230906093715.1589-1-mjsbeaton@gmail.com
OvmfPkg/build.sh | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
[edk2-devel] [PATCH v3] Revert "OvmfPkg: Update build.sh to allow building OVMF then running QEMU"
Posted by Mike Beaton 7 months, 3 weeks ago
This reverts commit 173a7a7daaad560cd69e1000faca1d2b91774c46

Fixes https://bugzilla.tianocore.org/show_bug.cgi?id=4528

The build.sh qemu option starts the correct qemu executable for the selected
architecture (build.sh -a option, or implicit) and uses the correct previously
built OVMF image for the selected architecture and build target (build.sh -b
option, or implicit).

With this revert, the above step will fail if there is no matching previously
built OVMF image. This is advantageous over rebuilding each time the build.sh
qemu option is used (as in the reverted commit), because it provides a quick
way to run a just-built OVMF image in place, while:
 a) Starting immediately (saving the time required for a rebuild on each
    usage, if the VM is started multiple times)
 b) Preserving the NVRAM contents between multiple runs (i.e. until the
    image is next rebuilt)

Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
---
 OvmfPkg/build.sh | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh
index b0334fb76e..279f0d099a 100755
--- a/OvmfPkg/build.sh
+++ b/OvmfPkg/build.sh
@@ -246,11 +246,11 @@ else
 fi
 
 #
-# Build the edk2 OvmfPkg
+# Run previously built OVMF image for current build options, in place.
+# Do not rebuild first, rather allow multiple runs of a previously built
+# image to start quickly (without rebuild), and with preserved NVRAM contents
+# between runs (until the next rebuild).
 #
-echo Running edk2 build for OvmfPkg$Processor
-build -p $PLATFORMFILE $BUILD_OPTIONS -b $BUILDTARGET -t $TARGET_TOOLS -n $THREADNUMBER -DDEBUG_ON_SERIAL_PORT=TRUE
-
 if [[ "$RUN_QEMU" == "yes" ]]; then
   if [[ ! -d $QEMU_FIRMWARE_DIR ]]; then
     mkdir $QEMU_FIRMWARE_DIR
@@ -265,3 +265,10 @@ if [[ "$RUN_QEMU" == "yes" ]]; then
   $QEMU_COMMAND "$@"
   exit $?
 fi
+
+#
+# Build the edk2 OvmfPkg
+#
+echo Running edk2 build for OvmfPkg$Processor
+build -p $PLATFORMFILE $BUILD_OPTIONS -b $BUILDTARGET -t $TARGET_TOOLS -n $THREADNUMBER
+exit $?
-- 
2.40.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108320): https://edk2.groups.io/g/devel/message/108320
Mute This Topic: https://groups.io/mt/101189234/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3] Revert "OvmfPkg: Update build.sh to allow building OVMF then running QEMU"
Posted by Ard Biesheuvel 7 months, 3 weeks ago
On Wed, 6 Sept 2023 at 11:38, Mike Beaton <mjsbeaton@gmail.com> wrote:
>
> This reverts commit 173a7a7daaad560cd69e1000faca1d2b91774c46
>
> Fixes https://bugzilla.tianocore.org/show_bug.cgi?id=4528
>
> The build.sh qemu option starts the correct qemu executable for the selected
> architecture (build.sh -a option, or implicit) and uses the correct previously
> built OVMF image for the selected architecture and build target (build.sh -b
> option, or implicit).
>
> With this revert, the above step will fail if there is no matching previously
> built OVMF image. This is advantageous over rebuilding each time the build.sh
> qemu option is used (as in the reverted commit), because it provides a quick
> way to run a just-built OVMF image in place, while:
>  a) Starting immediately (saving the time required for a rebuild on each
>     usage, if the VM is started multiple times)
>  b) Preserving the NVRAM contents between multiple runs (i.e. until the
>     image is next rebuilt)
>
> Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>

Merged as #4791

Thanks for the patch, and for your patience.


> ---
>  OvmfPkg/build.sh | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh
> index b0334fb76e..279f0d099a 100755
> --- a/OvmfPkg/build.sh
> +++ b/OvmfPkg/build.sh
> @@ -246,11 +246,11 @@ else
>  fi
>
>  #
> -# Build the edk2 OvmfPkg
> +# Run previously built OVMF image for current build options, in place.
> +# Do not rebuild first, rather allow multiple runs of a previously built
> +# image to start quickly (without rebuild), and with preserved NVRAM contents
> +# between runs (until the next rebuild).
>  #
> -echo Running edk2 build for OvmfPkg$Processor
> -build -p $PLATFORMFILE $BUILD_OPTIONS -b $BUILDTARGET -t $TARGET_TOOLS -n $THREADNUMBER -DDEBUG_ON_SERIAL_PORT=TRUE
> -
>  if [[ "$RUN_QEMU" == "yes" ]]; then
>    if [[ ! -d $QEMU_FIRMWARE_DIR ]]; then
>      mkdir $QEMU_FIRMWARE_DIR
> @@ -265,3 +265,10 @@ if [[ "$RUN_QEMU" == "yes" ]]; then
>    $QEMU_COMMAND "$@"
>    exit $?
>  fi
> +
> +#
> +# Build the edk2 OvmfPkg
> +#
> +echo Running edk2 build for OvmfPkg$Processor
> +build -p $PLATFORMFILE $BUILD_OPTIONS -b $BUILDTARGET -t $TARGET_TOOLS -n $THREADNUMBER
> +exit $?
> --
> 2.40.1.windows.1
>
>
>
> 
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108321): https://edk2.groups.io/g/devel/message/108321
Mute This Topic: https://groups.io/mt/101189234/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-