All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: cip-dev@lists.cip-project.org
Cc: jan.kiszka@siemens.com, quirin.gylstorff@siemens.com,
	Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [isar-cip-core][PATCH 1/2] refactor deploy of OVMF binaries
Date: Tue, 25 Apr 2023 11:32:45 +0800	[thread overview]
Message-ID: <20230425033246.1199444-1-felix.moessbauer@siemens.com> (raw)

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 --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
-
-
-- 
2.39.2



             reply	other threads:[~2023-04-25 12:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25  3:32 Felix Moessbauer [this message]
2023-04-25  3:32 ` [isar-cip-core][PATCH 2/2] generalize deployment of self compiled firmware Felix Moessbauer
2023-05-01 11:29   ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230425033246.1199444-1-felix.moessbauer@siemens.com \
    --to=felix.moessbauer@siemens.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=jan.kiszka@siemens.com \
    --cc=quirin.gylstorff@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.