initscripts: make hostname.sh coreutils-compatible
authorRichard Tollerton <rich.tollerton@ni.com>
Thu, 17 Jul 2014 21:56:56 +0000 (16:56 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 18 Jul 2014 23:08:59 +0000 (00:08 +0100)
inetutils and busybox hostname utils support `hostname -F`; coreutils
hostname doesn't. So just use `cat` instead.

(From OE-Core rev: acb8674e498468088d867ffae9a458caa08d95d5)

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initscripts/initscripts-1.0/hostname.sh

index 78fb91c..95287cc 100755 (executable)
@@ -16,7 +16,7 @@ fi
 
 # Busybox hostname doesn't support -b so we need implement it on our own
 if [ -f /etc/hostname ];then
-       hostname -F /etc/hostname
+       hostname `cat /etc/hostname`
 elif [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" -o ! -z "`echo $HOSTNAME | sed -n '/^[0-9]*\.[0-9].*/p'`" ] ; then
        hostname localhost
 fi