]> code.ossystems Code Review - openembedded-core.git/commitdiff
qemuwrapper-cross: enable multilib and nativesdk variants of the script
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>
Mon, 11 Jun 2018 13:38:20 +0000 (16:38 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 18 Jun 2018 09:59:33 +0000 (10:59 +0100)
Previously only one global variant of the script was created,
which caused numerous issues:

1) multilib was not properly supported due to multilib variants each
needing their own version of the qemu binary and library paths to be set
2) nativesdk was not properly supported for the same reason

This patch also moves setting LD_LIBRARY_PATH directly into the
recipe, as passing it down from other recipes did not work when
said recipes were allarch, and adjusts calls to qemuwrapper from
postinst-intercepts, so that its correct variant is selected.

Also, the various qemu fallbacks in qemuwrapper script are all removed,
as they are no longer necessary.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/fontcache.bbclass
meta/classes/pixbufcache.bbclass
meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
scripts/postinst-intercepts/update_font_cache
scripts/postinst-intercepts/update_gio_module_cache
scripts/postinst-intercepts/update_gtk_immodules_cache
scripts/postinst-intercepts/update_pixbuf_cache

index e76331131ee4438003d3569366594fe436215bf6..f71a754a4dd4b47d88a41f4a8d84b9e03873f987 100644 (file)
@@ -17,7 +17,7 @@ FONTCONFIG_CACHE_PARAMS ?= "-v"
 FONTCONFIG_CACHE_ENV ?= "FC_DEBUG=1"
 fontcache_common() {
 if [ -n "$D" ] ; then
-       $INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} \
+       $INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} \
                'bindir="${bindir}"' \
                'libdir="${libdir}"' \
                'base_libdir="${base_libdir}"' \
index b3e507f61b67443792d29841ea5ff9a4b26cf260..3378ff2c8061d6b9f8daeed4147bbcae511a1b90 100644 (file)
@@ -12,7 +12,7 @@ PACKAGE_WRITE_DEPS += "qemu-native gdk-pixbuf-native"
 
 pixbufcache_common() {
 if [ "x$D" != "x" ]; then
-       $INTERCEPT_DIR/postinst_intercept update_pixbuf_cache ${PKG} mlprefix=${MLPREFIX} libdir=${libdir} \
+       $INTERCEPT_DIR/postinst_intercept update_pixbuf_cache ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} libdir=${libdir} \
                bindir=${bindir} base_libdir=${base_libdir}
 else
 
index c983fbae6676033bdc7c18d2f032e7dcc032c07e..4b1b46d0bb329ae1c3ed6b9f85b88e470ada9383 100644 (file)
@@ -13,38 +13,21 @@ do_populate_sysroot[depends] = ""
 do_install () {
        install -d ${D}${bindir_crossscripts}/
 
-       echo "#!/bin/sh" > ${D}${bindir_crossscripts}/qemuwrapper
        qemu_binary=${@qemu_target_binary(d)}
-       qemu_options='${QEMU_OPTIONS}'
-       echo "$qemu_binary $qemu_options \"\$@\"" >> ${D}${bindir_crossscripts}/qemuwrapper
-       fallback_qemu_bin=
-       case $qemu_binary in
-               "qemu-i386")
-                       fallback_qemu_bin=qemu-x86_64
-                       ;;
-               "qemu-x86_64")
-                       fallback_qemu_bin=qemu-i386
-                       ;;
-               *)
-                       ;;
-       esac
-
-       if [ -n "$fallback_qemu_bin" ]; then
-
-               cat >> ${D}${bindir_crossscripts}/qemuwrapper << EOF
-rc=\$?
-if [ \$rc = 255 ]; then
-       $fallback_qemu_bin "\$@"
-       rc=\$?
-fi
-exit \$rc
-EOF
+       qemu_options='${QEMU_OPTIONS} -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir}'
+
+       cat >> ${D}${bindir_crossscripts}/${MLPREFIX}qemuwrapper << EOF
+#!/bin/sh
+set -x
 
-       fi
+$qemu_binary $qemu_options "\$@"
+EOF
 
-       chmod +x ${D}${bindir_crossscripts}/qemuwrapper
+       chmod +x ${D}${bindir_crossscripts}/${MLPREFIX}qemuwrapper
 }
 
 SYSROOT_DIRS += "${bindir_crossscripts}"
 
 INHIBIT_DEFAULT_DEPS = "1"
+
+BBCLASSEXTEND = "nativesdk"
index bf65e19a41de5001420768b894bfd7ed659aa845..20e9048adfcc6ba4d6b0f709ee01700de7813607 100644 (file)
@@ -2,6 +2,5 @@
 
 set -e
 
-PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir} \
-                                       -E ${fontconfigcacheenv} $D${bindir}/fc-cache --sysroot=$D --system-only ${fontconfigcacheparams}
+PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D -E ${fontconfigcacheenv} $D${bindir}/fc-cache --sysroot=$D --system-only ${fontconfigcacheparams}
 chown -R root:root $D${fontconfigcachedir}
index fc3f9d0d6ced1cc8e1b240635d83b7355d44e4d4..d1f0140947e288ed46f37956d7c9c6d14035207b 100644 (file)
@@ -2,8 +2,7 @@
 
 set -e
 
-PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
-       $D${libexecdir}/${binprefix}gio-querymodules $D${libdir}/gio/modules/
+PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libexecdir}/${binprefix}gio-querymodules $D${libdir}/gio/modules/
 
 [ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
        chown root:root $D${libdir}/gio/modules/giomodule.cache
index e2b9ff74382123886c96a71af1af8c7894407898..d85d3622c21d6304a8ad3e2fe6b0cb5c37da1ff2 100644 (file)
@@ -3,15 +3,13 @@
 set -e
 
 if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then
-    PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
-        $D/${bindir}/gtk-query-immodules-2.0 \
+    PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D/${bindir}/gtk-query-immodules-2.0 \
         > $D${libdir}/gtk-2.0/2.10.0/immodules.cache &&
         sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache
         chown root:root $D${libdir}/gtk-2.0/2.10.0/immodules.cache
 fi
 if [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then
-    PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
-        $D/${bindir}/gtk-query-immodules-3.0 \
+    PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D/${bindir}/gtk-query-immodules-3.0 \
         > $D${libdir}/gtk-3.0/3.0.0/immodules.cache &&
         sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache
         chown root:root $D${libdir}/gtk-3.0/3.0.0/immodules.cache
index 5d44075fb4c49b93661fa64c6ae98d033e6fda30..ebea07c356a381fc7fcbe237c7e816a7e41aeec1 100644 (file)
@@ -5,7 +5,6 @@ set -e
 export GDK_PIXBUF_MODULEDIR=$D${libdir}/gdk-pixbuf-2.0/2.10.0/loaders
 export GDK_PIXBUF_FATAL_LOADER=1
 
-PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
-    $D${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
+PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
     >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \
     sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache