From: Jan Kiszka <[email protected]>

Analogously to the kernel, rename the config for qemuamd64 and construct
its name in a python snippet. This will allow to add another machine
for the same architecture which will share the Jailhouse package with
qemuamd64.

Signed-off-by: Jan Kiszka <[email protected]>
---
 .../jailhouse/files/{qemuamd64_config.h => x86-64_config.h}   |  0
 recipes-jailhouse/jailhouse/jailhouse.inc                     | 11 +++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
 rename recipes-jailhouse/jailhouse/files/{qemuamd64_config.h => 
x86-64_config.h} (100%)

diff --git a/recipes-jailhouse/jailhouse/files/qemuamd64_config.h 
b/recipes-jailhouse/jailhouse/files/x86-64_config.h
similarity index 100%
rename from recipes-jailhouse/jailhouse/files/qemuamd64_config.h
rename to recipes-jailhouse/jailhouse/files/x86-64_config.h
diff --git a/recipes-jailhouse/jailhouse/jailhouse.inc 
b/recipes-jailhouse/jailhouse/jailhouse.inc
index 20ee3e4..2caf601 100644
--- a/recipes-jailhouse/jailhouse/jailhouse.inc
+++ b/recipes-jailhouse/jailhouse/jailhouse.inc
@@ -9,6 +9,13 @@
 # SPDX-License-Identifier: GPL-2.0
 #
 
+python() {
+    machine = d.getVar('MACHINE', True)
+    if machine in ['qemuamd64']:
+        machine = 'x86-64'
+    d.setVar('JAILHOUSE_CONFIG', machine + '_config.h')
+}
+
 DESCRIPTION = "Jailhouse partitioning hypervisor"
 
 LICENSE = "GPL-2.0 & BSD-2-clause"
@@ -16,7 +23,7 @@ LICENSE = "GPL-2.0 & BSD-2-clause"
 SRC_URI = " \
     git://github.com/siemens/jailhouse;branch=next \
     file://debian/ \
-    file://${MACHINE}_config.h"
+    file://${JAILHOUSE_CONFIG}"
 
 S = "${WORKDIR}/git"
 
@@ -30,7 +37,7 @@ dpkg_runbuild_prepend() {
         # Install device trees only on non-x86 archs as they only exist there
         echo "configs{,/*}/dts/*.dtb etc/jailhouse/dts" >> 
${S}/debian/jailhouse.install
     fi
-    cp ${WORKDIR}/${MACHINE}_config.h ${S}/include/jailhouse/config.h
+    cp ${WORKDIR}/${JAILHOUSE_CONFIG} ${S}/include/jailhouse/config.h
     sed -i 's/@PV@/${PV}/' ${S}/debian/changelog
     sed -i 's/@KERNEL_NAME@/${KERNEL_NAME}/' ${S}/debian/control
 }
-- 
2.16.4

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to