It can be confusing to users why things are failing with missing kernel
dependencies when you don't have 'xen' in your DISTRO_FEATURES. This
should provide them with some better info.

Signed-off-by: Doug Goldstein <[email protected]>
---

The result of this change is the following output:

| DEBUG: Executing shell function do_check_xen_state
| ERROR: DISTRO_FEATURES does not contain 'xen'
| WARNING: exit code 1 from a shell command.

---
 recipes-extended/images/xen-image-minimal.bb | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/recipes-extended/images/xen-image-minimal.bb 
b/recipes-extended/images/xen-image-minimal.bb
index 26b6d06..b8c2002 100644
--- a/recipes-extended/images/xen-image-minimal.bb
+++ b/recipes-extended/images/xen-image-minimal.bb
@@ -20,6 +20,14 @@ LICENSE = "MIT"
 
 inherit core-image
 
+do_check_xen_state() {
+    if [ "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' yes', 'no', d)}" = 
"no" ]; then
+        die "DISTRO_FEATURES does not contain 'xen'"
+    fi
+}
+
+addtask check_xen_state before do_rootfs
+
 syslinux_iso_populate_append() {
        install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 
${ISODIR}${ISOLINUXDIR}
        install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 
${ISODIR}${ISOLINUXDIR}
-- 
2.4.10

-- 
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Reply via email to