summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/find_datadir.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/find_datadir.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/find_datadir.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/find_datadir.patch b/meta/recipes-devtools/qemu/qemu/find_datadir.patch
new file mode 100644
index 0000000000..74e9ba56ce
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/find_datadir.patch
@@ -0,0 +1,37 @@
+qemu: search for datadir as in version 4.2
+
+os_find_datadir() was changed after the 4.2 release. We need to check for
+../share/qemu relative to the executable because that is where the runqemu
+configuration assumes it will be.
+
+Upstream-Status: Submitted [qemu-devel@nongnu.org]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+--- a/os-posix.c
++++ b/os-posix.c
+@@ -82,8 +82,9 @@ void os_setup_signal_handling(void)
+
+ /*
+ * Find a likely location for support files using the location of the binary.
++ * Typically, this would be "$bindir/../share/qemu".
+ * When running from the build tree this will be "$bindir/../pc-bios".
+- * Otherwise, this is CONFIG_QEMU_DATADIR.
++ * Otherwise, this is CONFIG_QEMU_DATADIR as constructed by configure.
+ */
+ char *os_find_datadir(void)
+ {
+@@ -93,6 +94,12 @@ char *os_find_datadir(void)
+ exec_dir = qemu_get_exec_dir();
+ g_return_val_if_fail(exec_dir != NULL, NULL);
+
++ dir = g_build_filename(exec_dir, "..", "share", "qemu", NULL);
++ if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
++ return g_steal_pointer(&dir);
++ }
++ g_free(dir); /* no autofree this time */
++
+ dir = g_build_filename(exec_dir, "..", "pc-bios", NULL);
+ if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
+ return g_steal_pointer(&dir);