Skip to contentSkip to conversation

fontcache : fix build warning when using qemu usermode

PATCH New Jibin Xu 1 participant 1 message Dec 28, 2017

lore
Share & tools
lore

Jibin Xu

author
#0 lore raw

PATCH 1/1 fontcache : fix build warning when using qemu usermode

fontcache uses qemu usermode by default, but some architecture such as Intel skylake does not support qemu usermode, this can lead to a build warning as below:
"WARNING: The postinstall intercept hook 'update_font_cache' failed".

Add a judgement of qemu usermode to fix the build warning.

---
 meta/classes/fontcache.bbclass | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
meta/classes/fontcache.bbclass +11 -7
index e76331131e..3eb868fa08 100644
@@ -17,13 +17,17 @@ 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} \
-		'bindir="${bindir}"' \
-		'libdir="${libdir}"' \
-		'base_libdir="${base_libdir}"' \
-		'fontconfigcachedir="${FONTCONFIG_CACHE_DIR}"' \
-		'fontconfigcacheparams="${FONTCONFIG_CACHE_PARAMS}"' \
-		'fontconfigcacheenv="${FONTCONFIG_CACHE_ENV}"'
+	if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true','false', d)}; then
+		$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} \
+			'bindir="${bindir}"' \
+			'libdir="${libdir}"' \
+			'base_libdir="${base_libdir}"' \
+			'fontconfigcachedir="${FONTCONFIG_CACHE_DIR}"' \
+			'fontconfigcacheparams="${FONTCONFIG_CACHE_PARAMS}"' \
+			'fontconfigcacheenv="${FONTCONFIG_CACHE_ENV}"'
+	else
+		exit 1
+	fi
 else
 	${FONTCONFIG_CACHE_ENV} fc-cache ${FONTCONFIG_CACHE_PARAMS}
 fi
Signature · 1 line
2.13.0