blob: a0448a180397a2af7a8e1cc77a41616c54bdd1a0 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "QEMU wrapper script"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002HOMEPAGE = "http://qemu.org"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003LICENSE = "MIT"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004
5S = "${WORKDIR}"
6
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007DEPENDS += "qemu-native"
8
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009inherit qemu
10
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011do_populate_sysroot[depends] = ""
12
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013do_install () {
14 install -d ${D}${bindir_crossscripts}/
15
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016 qemu_binary=${@qemu_target_binary(d)}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080017 qemu_options='${QEMU_OPTIONS} -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir}'
Patrick Williamsc124f4f2015-09-15 14:41:29 -050018
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019 cat >> ${D}${bindir_crossscripts}/${MLPREFIX}qemuwrapper << EOF
20#!/bin/sh
21set -x
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022
Brad Bishop19323692019-04-05 15:28:33 -040023if [ ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'True', 'False', d)} = False -a "${PN}" != "nativesdk-qemuwrapper-cross" ]; then
24 echo "qemuwrapper: qemu usermode is not supported"
25 exit 1
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026fi
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080027
28
29$qemu_binary $qemu_options "\$@"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030EOF
31
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080032 chmod +x ${D}${bindir_crossscripts}/${MLPREFIX}qemuwrapper
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033}
34
Patrick Williamsc0f7c042017-02-23 20:41:17 -060035SYSROOT_DIRS += "${bindir_crossscripts}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036
37INHIBIT_DEFAULT_DEPS = "1"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080038
39BBCLASSEXTEND = "nativesdk"