]> code.ossystems Code Review - openembedded-core.git/commitdiff
xz: use update-alternatives
authorAllen Wild <allenwild93@gmail.com>
Sun, 6 May 2018 23:00:02 +0000 (19:00 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 15 May 2018 09:00:27 +0000 (10:00 +0100)
Installing xz and busybox together may cause conflicts for xz, xzcat,
unxz, and their lzma variants. In the default configuration, xzcat is
silently replaced with a symlink to busybox. If busybox is compiled with
CONFIG_XZ=y, its postinst fails during do_rootfs.

Using update-alternatives to xz handles these conflicts properly.

Signed-off-by: Allen Wild <allenwild93@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-extended/xz/xz_5.2.3.bb

index c0f8b82f6415b7c78bd19892c1328ff0e0ba7746..65168920d1d561792e987d947b69f9cd0c5df496 100644 (file)
@@ -31,6 +31,11 @@ PACKAGES =+ "liblzma"
 
 FILES_liblzma = "${libdir}/liblzma*${SOLIBS}"
 
+inherit update-alternatives
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "xz xzcat unxz \
+                     lzma lzcat unlzma"
+
 BBCLASSEXTEND = "native nativesdk"
 
 export CONFIG_SHELL="/bin/sh"