Use alternatives mechanism to prevent confliction of attempted
installing su binary among busybox, shadow and util-linux.
[YOCTO #4926]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
ALTERNATIVE_TARGET[reset] = "${base_bindir}/reset"
BBCLASSEXTEND = "native nativesdk"
+
+python do_package_prepend () {
+ if '--enable-su' in d.getVar('EXTRA_OECONF', True).split():
+ alt_name = "su"
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, '%s/%s' % (d.getVar('bindir', True), alt_name))
+ d.appendVar('ALTERNATIVE_%s' % (d.getVar('PN', True)), ' ' + alt_name)
+}