blob: 7f4c6d934994858e41cbea4a2d77d51aa420fd8c [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
44SYSROOT_PREPROCESS_FUNCS += "qemuwrapper_sysroot_preprocess"
45
46qemuwrapper_sysroot_preprocess () {
47 sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
48}
49
50INHIBIT_DEFAULT_DEPS = "1"