aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2009-09-16 17:38:39 -0400
committerSam Ravnborg <sam@ravnborg.org>2009-10-11 17:21:25 -0400
commit9c3049c02c6142e166c9472237f1f60d86153682 (patch)
tree624f892c23db814575a62debbf3e6a5981889f9b /scripts
parent58242b2b065557f8467a8630f7c9b2b4b2eb891f (diff)
kbuild: fix warning when domainname is not available
Otherwise we get: "dnsdomainname: Unknown host" Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Acked-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mkcompile_h8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index 6a12dd9f1181..f060763c0c6a 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -66,9 +66,13 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
66 echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\" 66 echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
67 67
68 if [ -x /bin/dnsdomainname ]; then 68 if [ -x /bin/dnsdomainname ]; then
69 echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname | $UTS_TRUNCATE`\" 69 domain=`dnsdomainname 2> /dev/null`
70 elif [ -x /bin/domainname ]; then 70 elif [ -x /bin/domainname ]; then
71 echo \#define LINUX_COMPILE_DOMAIN \"`domainname | $UTS_TRUNCATE`\" 71 domain=`domainname 2> /dev/null`
72 fi
73
74 if [ -n "$domain" ]; then
75 echo \#define LINUX_COMPILE_DOMAIN \"`echo $domain | $UTS_TRUNCATE`\"
72 else 76 else
73 echo \#define LINUX_COMPILE_DOMAIN 77 echo \#define LINUX_COMPILE_DOMAIN
74 fi 78 fi