Patchwork [CONSOLIDATED,PULL,10/43] coreutils_*.bb: Sync up file path with busybox and minor cleanup

login
register
mail settings
Submitter Saul Wold
Date April 20, 2012, 4:45 p.m.
Message ID <7dcff6e7656e0930fb9102df201cb2021b3c1eb6.1334940120.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/26285/
State New
Headers show

Comments

Saul Wold - April 20, 2012, 4:45 p.m.
From: Mark Hatle <mark.hatle@windriver.com>

We need to ensure that the filepaths used by coreutils and busybox are
the same.  Do this for base64, mktemp and df.  Also remove references
to hostname/uptime in 8.14 version as these were only relevant for the
older 6.9 version.

su from the 6.9 version is removed, as it should come from shadow.

(No PR bumps, as the previous patch did that.)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/recipes-core/coreutils/coreutils_6.9.bb  |   10 +++++++---
 meta/recipes-core/coreutils/coreutils_8.14.bb |   23 +++--------------------
 2 files changed, 10 insertions(+), 23 deletions(-)

Patch

diff --git a/meta/recipes-core/coreutils/coreutils_6.9.bb b/meta/recipes-core/coreutils/coreutils_6.9.bb
index 32ea321..597d457 100644
--- a/meta/recipes-core/coreutils/coreutils_6.9.bb
+++ b/meta/recipes-core/coreutils/coreutils_6.9.bb
@@ -34,7 +34,7 @@  ALTERNATIVE_PRIORITY = "100"
 ALTERNATIVE_LINKS = ""
 
 # [ gets a special treatment and is not included in this
-bindir_progs = "base64 basename cksum comm csplit cut dir dircolors dirname du \
+bindir_progs = "basename cksum comm csplit cut dir dircolors dirname du \
                 env expand expr factor fmt fold groups head hostid id install \
                 join link logname md5sum mkfifo nice nl nohup od paste pathchk \
                 pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \
@@ -43,7 +43,7 @@  bindir_progs = "base64 basename cksum comm csplit cut dir dircolors dirname du \
 ALTERNATIVE_LINKS += "${bindir}/${@' ${bindir}/'.join((d.getVar('bindir_progs', True)).split())}"
 
 # hostname gets a special treatment and is not included in this
-base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
+base_bindir_progs = "base64 cat chgrp chmod chown cp date dd df echo false kill ln ls mkdir \
                      mknod mv pwd rm rmdir sleep stty sync touch true uname"
 ALTERNATIVE_LINKS += "${base_bindir}/${@' ${base_bindir}/'.join((d.getVar('base_bindir_progs', True)).split())}"
 
@@ -69,12 +69,16 @@  do_install_append() {
 	# hostname and uptime separated. busybox's versions are preferred
 	mv ${D}${bindir}/hostname ${D}${base_bindir}/hostname.${PN}
 	mv ${D}${bindir}/uptime ${D}${bindir}/uptime.${PN}
+
+	# remove su, it should come from shadow or another package
+	rm ${D}${bindir}/su
 }
 
 pkg_postinst_${PN} () {
-	# Special cases. uptime and hostname is broken, prefer busybox's version. [ needs to be treated separately.
+	# Special cases. uptime and hostname is broken, prefer busybox's version.
 	update-alternatives --install ${bindir}/uptime uptime uptime.${PN} 10
 	update-alternatives --install ${base_bindir}/hostname hostname hostname.${PN} 10
+	# [ needs to be treated separately.
 	update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100
 }
 
diff --git a/meta/recipes-core/coreutils/coreutils_8.14.bb b/meta/recipes-core/coreutils/coreutils_8.14.bb
index 9ccb813..9994526 100644
--- a/meta/recipes-core/coreutils/coreutils_8.14.bb
+++ b/meta/recipes-core/coreutils/coreutils_8.14.bb
@@ -24,7 +24,7 @@  EXTRA_OECONF_virtclass-native = "--without-gmp"
 ALTERNATIVE_PRIORITY = "100"
 ALTERNATIVE_LINKS = ""
 
-# [ df mktemp base64 gets a special treatment and is not included in this
+# [ gets a special treatment and is not included in this
 bindir_progs = "basename chcon cksum comm csplit cut dir dircolors dirname du \
                 env expand expr factor fmt fold groups head hostid id install \
                 join link logname md5sum mkfifo nice nl nohup nproc od paste pathchk \
@@ -33,18 +33,14 @@  bindir_progs = "basename chcon cksum comm csplit cut dir dircolors dirname du \
                 tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
 ALTERNATIVE_LINKS += "${bindir}/${@' ${bindir}/'.join((d.getVar('bindir_progs', True)).split())}"
 
-# hostname gets a special treatment and is not included in this
-base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
-                     mknod mv pwd rm rmdir sleep stty sync touch true uname"
+base_bindir_progs = "base64 cat chgrp chmod chown cp date dd df echo false kill ln ls mkdir \
+                     mknod mktemp mv pwd rm rmdir sleep stty sync touch true uname"
 ALTERNATIVE_LINKS += "${base_bindir}/${@' ${base_bindir}/'.join((d.getVar('base_bindir_progs', True)).split())}"
 
 sbindir_progs= "chroot"
 ALTERNATIVE_LINKS += "${sbindir}/${@' ${sbindir}/'.join((d.getVar('sbindir_progs', True)).split())}"
 
 # Manual file provides for manually controlled alternatives
-MANUAL_ALTERNATIVE_LINKS += "${base_bindir}/df:${bindir}/df.${PN}"
-MANUAL_ALTERNATIVE_LINKS += "${base_bindir}/mktemp:${bindir}/mktemp.${PN}"
-MANUAL_ALTERNATIVE_LINKS += "${base_bindir}/base64:${bindir}/base64.${PN}"
 MANUAL_ALTERNATIVE_LINKS += "${bindir}/[:${bindir}/lbracket.${PN}"
 
 do_install_append() {
@@ -54,9 +50,6 @@  do_install_append() {
 	install -d ${D}${sbindir}
 	for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i; done
 
-	# Process the special items due to mismatch with busybox
-	for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done
-
 	# [ requires special handling because [.coreutils will cause the sed stuff
 	# in update-alternatives to fail, therefore use lbracket - the name used
 	# for the actual source file.
@@ -69,21 +62,11 @@  do_install_append() {
 pkg_postinst_${PN} () {
 	# Special cases. [ needs to be treated separately.
 	update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100
-	
-	# Special cases. base64, mktemp and df need to be treated separately, because busybox have them in base_binding not bindir
-	update-alternatives --install ${base_bindir}/base64 base64 ${bindir}/base64.${PN} 100;
-	update-alternatives --install ${base_bindir}/mktemp mktemp ${bindir}/mktemp.${PN} 100;
-	update-alternatives --install ${base_bindir}/df df ${bindir}/df.${PN} 100;
 }
 
 pkg_prerm_${PN} () {
 	# The special cases
-	update-alternatives --remove hostname hostname.${PN}
-	update-alternatives --remove uptime uptime.${PN}
 	update-alternatives --remove '[' 'lbracket.${PN}'
-	update-alternatives --remove base64 ${bindir}/base64.${PN}
-	update-alternatives --remove mktemp ${bindir}/mktemp.${PN}
-	update-alternatives --remove df ${bindir}.df.${PN}
 }
 
 BBCLASSEXTEND = "native"