Patchwork [v2,5/6] initscripts: make hostname.sh coreutils-compatible

login
register
mail settings
Submitter Ben Shelton
Date July 17, 2014, 9:56 p.m.
Message ID <e42e7279d246813dc21a9498524b7e61412a0349.1405633546.git.ben.shelton@ni.com>
Download mbox | patch
Permalink /patch/75957/
State Accepted
Commit 0327db6b074f339f5ac9c919facb5e7e733829df
Headers show

Comments

Ben Shelton - July 17, 2014, 9:56 p.m.
From: Richard Tollerton <rich.tollerton@ni.com>

inetutils and busybox hostname utils support `hostname -F`; coreutils
hostname doesn't. So just use `cat` instead.

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
---
 meta/recipes-core/initscripts/initscripts-1.0/hostname.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh b/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
index 78fb91c..95287cc 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
@@ -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