Skip to contentSkip to conversation

xz: use update-alternatives

PATCH New Allen Wild 1 participant 1 message May 6, 2018

lore
Share & tools
lore

Allen Wild

author
#0 lore raw

PATCH 1/1 xz: use update-alternatives

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.

---
 meta/recipes-extended/xz/xz_5.2.3.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-extended/xz/xz_5.2.3.bb +5 -0
index c0f8b82f64..65168920d1 100644
@@ -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"
Signature · 1 line
2.17.0