diff mbox series

[isar-cip-core,3/4] recipes-devtools/ovmf-binaries: Adapt to sbuild environment

Message ID 20220729083931.419731-4-Quirin.Gylstorff@siemens.com (mailing list archive)
State Handled Elsewhere
Headers show
Series Add support for ISAR with sbuild | expand

Commit Message

Quirin Gylstorff July 29, 2022, 8:39 a.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Due to sbuild we can no longer access the build chroot with all installed
packages.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 .../ovmf-binaries/files/control.tmpl           | 11 -----------
 recipes-devtools/ovmf-binaries/files/rules     | 17 +++++++++++++++++
 .../ovmf-binaries/ovmf-binaries_0.1.bb         | 18 +++++++++++-------
 3 files changed, 28 insertions(+), 18 deletions(-)
 delete mode 100644 recipes-devtools/ovmf-binaries/files/control.tmpl
 create mode 100644 recipes-devtools/ovmf-binaries/files/rules

Comments

Jan Kiszka July 29, 2022, 8:59 a.m. UTC | #1
On 29.07.22 10:39, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> Due to sbuild we can no longer access the build chroot with all installed
> packages.
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  .../ovmf-binaries/files/control.tmpl           | 11 -----------
>  recipes-devtools/ovmf-binaries/files/rules     | 17 +++++++++++++++++
>  .../ovmf-binaries/ovmf-binaries_0.1.bb         | 18 +++++++++++-------
>  3 files changed, 28 insertions(+), 18 deletions(-)
>  delete mode 100644 recipes-devtools/ovmf-binaries/files/control.tmpl
>  create mode 100644 recipes-devtools/ovmf-binaries/files/rules
> 
> diff --git a/recipes-devtools/ovmf-binaries/files/control.tmpl b/recipes-devtools/ovmf-binaries/files/control.tmpl
> deleted file mode 100644
> index 54641d6..0000000
> --- a/recipes-devtools/ovmf-binaries/files/control.tmpl
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -Source: ${PN}
> -Section: misc
> -Priority: optional
> -Standards-Version: 3.9.6
> -Maintainer: ${MAINTAINER}
> -Build-Depends: debhelper (>= 9), ${DEBIAN_BUILD_DEPENDS}
> -
> -Package: ${PN}
> -Architecture: ${DPKG_ARCH}
> -Depends: ${DEBIAN_DEPENDS}
> -Description: ${DESCRIPTION}
> diff --git a/recipes-devtools/ovmf-binaries/files/rules b/recipes-devtools/ovmf-binaries/files/rules
> new file mode 100644
> index 0000000..dcbef80
> --- /dev/null
> +++ b/recipes-devtools/ovmf-binaries/files/rules
> @@ -0,0 +1,17 @@
> +#!/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
> index 6524300..0f4592a 100644
> --- a/recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb
> +++ b/recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb
> @@ -14,18 +14,22 @@ 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://control.tmpl"
> +SRC_URI = "file://rules"
>  
>  DEBIAN_BUILD_DEPENDS = "ovmf"
> -TEMPLATE_FILES = "control.tmpl"
> -TEMPLATE_VARS += "PN DEBIAN_DEPENDS MAINTAINER DESCRIPTION DPKG_ARCH DEBIAN_BUILD_DEPENDS"
>  
>  SSTATETASKS = ""
>  
> -do_extract_ovmf() {
> +do_install() {
> +     install -v -d ${D}/var/share
> +     touch ${D}/var/share/test
> +}
> +
> +do_deploy() {
>      install -m 0755 -d ${DEPLOY_DIR_IMAGE}
> -    cp -r ${BUILDCHROOT_DIR}/usr/share/OVMF ${DEPLOY_DIR_IMAGE}
> -    chown $(id -u):$(id -g) ${DEPLOY_DIR_IMAGE}/OVMF
> +    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
> +
>  
> -addtask do_extract_ovmf after do_install_builddeps before do_dpkg_build

Same question here: Move to the front? Or is there anything
sbuild-specific in this recipe?

Jan
diff mbox series

Patch

diff --git a/recipes-devtools/ovmf-binaries/files/control.tmpl b/recipes-devtools/ovmf-binaries/files/control.tmpl
deleted file mode 100644
index 54641d6..0000000
--- a/recipes-devtools/ovmf-binaries/files/control.tmpl
+++ /dev/null
@@ -1,11 +0,0 @@ 
-Source: ${PN}
-Section: misc
-Priority: optional
-Standards-Version: 3.9.6
-Maintainer: ${MAINTAINER}
-Build-Depends: debhelper (>= 9), ${DEBIAN_BUILD_DEPENDS}
-
-Package: ${PN}
-Architecture: ${DPKG_ARCH}
-Depends: ${DEBIAN_DEPENDS}
-Description: ${DESCRIPTION}
diff --git a/recipes-devtools/ovmf-binaries/files/rules b/recipes-devtools/ovmf-binaries/files/rules
new file mode 100644
index 0000000..dcbef80
--- /dev/null
+++ b/recipes-devtools/ovmf-binaries/files/rules
@@ -0,0 +1,17 @@ 
+#!/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
index 6524300..0f4592a 100644
--- a/recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb
+++ b/recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb
@@ -14,18 +14,22 @@  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://control.tmpl"
+SRC_URI = "file://rules"
 
 DEBIAN_BUILD_DEPENDS = "ovmf"
-TEMPLATE_FILES = "control.tmpl"
-TEMPLATE_VARS += "PN DEBIAN_DEPENDS MAINTAINER DESCRIPTION DPKG_ARCH DEBIAN_BUILD_DEPENDS"
 
 SSTATETASKS = ""
 
-do_extract_ovmf() {
+do_install() {
+     install -v -d ${D}/var/share
+     touch ${D}/var/share/test
+}
+
+do_deploy() {
     install -m 0755 -d ${DEPLOY_DIR_IMAGE}
-    cp -r ${BUILDCHROOT_DIR}/usr/share/OVMF ${DEPLOY_DIR_IMAGE}
-    chown $(id -u):$(id -g) ${DEPLOY_DIR_IMAGE}/OVMF
+    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
+
 
-addtask do_extract_ovmf after do_install_builddeps before do_dpkg_build