blob: 53b302d65714feedf39f8c15873c7247017472d1 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "QEMU wrapper script"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4
5S = "${WORKDIR}"
6
7inherit qemu
8
9do_install () {
10 install -d ${D}${bindir_crossscripts}/
11
12 echo "#!/bin/sh" > ${D}${bindir_crossscripts}/qemuwrapper
13 qemu_binary=${@qemu_target_binary(d)}
14 qemu_options='${QEMU_OPTIONS}'
15 echo "$qemu_binary $qemu_options \"\$@\"" >> ${D}${bindir_crossscripts}/qemuwrapper
16 fallback_qemu_bin=
17 case $qemu_binary in
18 "qemu-i386")
19 fallback_qemu_bin=qemu-x86_64
20 ;;
21 "qemu-x86_64")
22 fallback_qemu_bin=qemu-i386
23 ;;
24 *)
25 ;;
26 esac
27
28 if [ -n "$fallback_qemu_bin" ]; then
29
30 cat >> ${D}${bindir_crossscripts}/qemuwrapper << EOF
31rc=\$?
32if [ \$rc = 255 ]; then
33 $fallback_qemu_bin "\$@"
34 rc=\$?
35fi
36exit \$rc
37EOF
38
39 fi
40
41 chmod +x ${D}${bindir_crossscripts}/qemuwrapper
42}
43
Patrick Williamsc0f7c042017-02-23 20:41:17 -060044SYSROOT_DIRS += "${bindir_crossscripts}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045
46INHIBIT_DEFAULT_DEPS = "1"