blob: 97b44ad2e5758dd6275230c748b03a50b931a4d9 [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
Patrick Williams93c203f2021-10-06 16:15:23 -050021# Wrapper script to run binaries under qemu user-mode emulation
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080022set -x
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023
Brad Bishop19323692019-04-05 15:28:33 -040024if [ ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'True', 'False', d)} = False -a "${PN}" != "nativesdk-qemuwrapper-cross" ]; then
25 echo "qemuwrapper: qemu usermode is not supported"
26 exit 1
Patrick Williamsc124f4f2015-09-15 14:41:29 -050027fi
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080028
29
30$qemu_binary $qemu_options "\$@"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031EOF
32
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033 chmod +x ${D}${bindir_crossscripts}/${MLPREFIX}qemuwrapper
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034}
35
Patrick Williamsc0f7c042017-02-23 20:41:17 -060036SYSROOT_DIRS += "${bindir_crossscripts}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037
38INHIBIT_DEFAULT_DEPS = "1"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080039
40BBCLASSEXTEND = "nativesdk"