]> code.ossystems Code Review - openembedded-core.git/commitdiff
coreutils: fix hostname conflict with other packages
authorChen Qi <Qi.Chen@windriver.com>
Fri, 9 Feb 2018 07:49:32 +0000 (15:49 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 16 Feb 2018 18:05:25 +0000 (18:05 +0000)
The hostname utility is also provided by busybox and net-tools. So
use alternatives mechanism to manage it in coreutils. Make its priority
higher than busybox. As hostname is not built by default for coreutils,
we make its priority lower than net-tools.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/coreutils/coreutils_8.29.bb

index 8df88020e37329a0424ab1de07c1958e49a5b7d6..0b8acc5884fd255c15fed99b167d8bebb585b339 100644 (file)
@@ -52,7 +52,7 @@ bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname
                 tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
 
 # 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 = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
                      mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
 
 sbindir_progs= "chroot"
@@ -95,6 +95,8 @@ do_install_append() {
 inherit update-alternatives
 
 ALTERNATIVE_PRIORITY = "100"
+# Make hostname's priority higher than busybox but lower than net-tools
+ALTERNATIVE_PRIORITY[hostname] = "90"
 ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df"
 ALTERNATIVE_${PN}-doc = "base64.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1  hostname.1"