diff mbox series

[v2,1/3] automation: preserve built xen.efi

Message ID ef79d2ffd9b2bad03094b5f08d7e994764d63208.1728008940.git-series.marmarek@invisiblethingslab.com (mailing list archive)
State New
Headers show
Series automation: add smoke test for xen.efi on x86_64 | expand

Commit Message

Marek Marczykowski-Górecki Oct. 4, 2024, 2:29 a.m. UTC
It will be useful for further tests.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
Changes in v2:
- deduplicate via collect_xen_artifacts function
---
 automation/scripts/build | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/automation/scripts/build b/automation/scripts/build
index b3c71fb6fb60..302feeed2eea 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -41,19 +41,29 @@  cp xen/.config xen-config
 # Directory for the artefacts to be dumped into
 mkdir -p binaries
 
+collect_xen_artifacts()
+{
+    local f
+    for f in xen/xen xen/xen.efi; do
+        if [[ -f $f ]]; then
+            cp $f binaries/
+        fi
+    done
+}
+
 if [[ "${CPPCHECK}" == "y" ]] && [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     # Cppcheck analysis invokes Xen-only build
     xen/scripts/xen-analysis.py --run-cppcheck --cppcheck-misra -- -j$(nproc)
 
     # Preserve artefacts
-    cp xen/xen binaries/xen
+    collect_xen_artifacts
     cp xen/cppcheck-report/xen-cppcheck.txt xen-cppcheck.txt
 elif [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     # Xen-only build
     make -j$(nproc) xen
 
     # Preserve artefacts
-    cp xen/xen binaries/xen
+    collect_xen_artifacts
 else
     # Full build.  Figure out our ./configure options
     cfgargs=()
@@ -101,5 +111,5 @@  else
     # even though dist/ contains everything, while some containers don't even
     # build Xen
     cp -r dist binaries/
-    if [[ -f xen/xen ]] ; then cp xen/xen binaries/xen; fi
+    collect_xen_artifacts
 fi