Patchwork [1/2] e2fsprogs: use update-alt for chattr

login
register
mail settings
Submitter Saul Wold
Date June 13, 2014, 6:19 p.m.
Message ID <1402683587-7488-1-git-send-email-sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/73785/
State Accepted
Commit bcef58953abd45c8d4d34e93f2666d6ad61a836f
Headers show

Comments

Saul Wold - June 13, 2014, 6:19 p.m.
Both busybox and e2fsprogs provide chattr, ensure that they are delivered
to the same location and use update-alternatives to ensure the correct
links are there.

[YOCTO #6407]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch

diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb
index 2bdd724..5302554 100644
--- a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb
@@ -54,6 +54,8 @@  do_install () {
 	fi
 
 	oe_multilib_header ext2fs/ext2_types.h
+	install -d ${D}${base_bindir}
+	mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs
 }
 
 RDEPENDS_e2fsprogs = "e2fsprogs-badblocks"
@@ -73,3 +75,10 @@  FILES_libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*"
 FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so"
 
 BBCLASSEXTEND = "native"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "chattr"
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr"
+ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs"