diff mbox series

[isar-cip-core,1/2] refactor deploy of OVMF binaries

Message ID 20230425033246.1199444-1-felix.moessbauer@siemens.com (mailing list archive)
State Accepted
Headers show
Series [isar-cip-core,1/2] refactor deploy of OVMF binaries | expand

Commit Message

Felix Moessbauer April 25, 2023, 3:32 a.m. UTC
Instead of deploying the OVMF binaries via a dummy package, we directly
deploy them as part of the imaging. This avoids the insertion of the
dummy package into the apt repo, speeds up the build and simplifies the
logic.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 kas/opt/ebg-swu.yml                           |  2 +-
 recipes-core/images/deploy-ovmf.inc           | 21 +++++++++++
 recipes-devtools/ovmf-binaries/files/rules    | 17 ---------
 .../ovmf-binaries/ovmf-binaries_0.1.bb        | 35 -------------------
 4 files changed, 22 insertions(+), 53 deletions(-)
 create mode 100644 recipes-core/images/deploy-ovmf.inc
 delete mode 100644 recipes-devtools/ovmf-binaries/files/rules
 delete mode 100644 recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb
diff mbox series

Patch

diff --git a/kas/opt/ebg-swu.yml b/kas/opt/ebg-swu.yml
index 203a6b9..1c12ad5 100644
--- a/kas/opt/ebg-swu.yml
+++ b/kas/opt/ebg-swu.yml
@@ -25,7 +25,7 @@  local_conf_header:
     INITRAMFS_INSTALL:append = " initramfs-abrootfs-hook"
   firmware-binaries: |
     # Add ovmf binaries for qemu
-    IMAGER_BUILD_DEPS:append:qemu-amd64 = " ovmf-binaries"
+    CIP_IMAGE_OPTIONS:append:qemu-amd64 = " deploy-ovmf.inc"
     # not needed for Debian 11 and later
     DISTRO_APT_SOURCES:append:qemu-amd64:buster = " conf/distro/debian-buster-backports.list"
     DISTRO_APT_PREFERENCES:append:qemu-amd64:buster = " conf/distro/preferences.ovmf-snakeoil.conf"
diff --git a/recipes-core/images/deploy-ovmf.inc b/recipes-core/images/deploy-ovmf.inc
new file mode 100644
index 0000000..0ec8762
--- /dev/null
+++ b/recipes-core/images/deploy-ovmf.inc
@@ -0,0 +1,21 @@ 
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2023
+#
+# Authors:
+#  Felix Moessbauer <felix.moessbauer@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+# This recipe deploys the OVMF binaries to run the image in QEMU
+# Note: x86 only
+
+IMAGER_INSTALL += "ovmf"
+
+do_deploy_ovmf_binaries[cleandirs] += "${DEPLOY_DIR_IMAGE}/OVMF"
+do_deploy_ovmf_binaries() {
+    cp -v ${BUILDCHROOT_DIR}/usr/share/OVMF/*.fd ${DEPLOY_DIR_IMAGE}/OVMF
+}
+
+addtask deploy_ovmf_binaries after do_install_imager_deps before do_image
diff --git a/recipes-devtools/ovmf-binaries/files/rules b/recipes-devtools/ovmf-binaries/files/rules
deleted file mode 100644
index dcbef80..0000000
--- a/recipes-devtools/ovmf-binaries/files/rules
+++ /dev/null
@@ -1,17 +0,0 @@ 
-#!/usr/bin/make -f
-#
-# Copyright (c) Siemens AG, 2022
-#
-# Authors:
-#  Quirin Gylstorff <quirin.gylstorff@siemens.com>
-#
-# This file is subject to the terms and conditions of the MIT License.
-# See COPYING.MIT file in the top-level directory.
-#
-
-override_dh_auto_configure:
-	mkdir -p /home/builder/ovmf-binaries/image/var/share/
-	cp -r /usr/share/OVMF /home/builder/ovmf-binaries/image/var/share/
-
-%:
-	dh $@
diff --git a/recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb b/recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb
deleted file mode 100644
index 0f4592a..0000000
--- a/recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb
+++ /dev/null
@@ -1,35 +0,0 @@ 
-#
-# CIP Core, generic profile
-#
-# Copyright (c) Siemens AG, 2020
-#
-# Authors:
-#  Quirin Gylstorff <quirin.gylstorff@siemens.com>
-#
-# SPDX-License-Identifier: MIT
-#
-
-inherit dpkg-raw
-
-DESCRIPTION = "Copy the OVMF biniaries from the build changeroot to the deploy dir"
-
-# this is a empty debian package
-SRC_URI = "file://rules"
-
-DEBIAN_BUILD_DEPENDS = "ovmf"
-
-SSTATETASKS = ""
-
-do_install() {
-     install -v -d ${D}/var/share
-     touch ${D}/var/share/test
-}
-
-do_deploy() {
-    install -m 0755 -d ${DEPLOY_DIR_IMAGE}
-    dpkg --extract ${WORKDIR}/${PN}_${PV}*.deb ${WORKDIR}
-    cp -r ${WORKDIR}/var/share/OVMF ${DEPLOY_DIR_IMAGE}
-}
-addtask do_deploy after do_dpkg_build before do_deploy_deb
-
-