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>
This commit is contained in:
Felipe Contreras 2009-09-17 00:38:39 +03:00 committed by Sam Ravnborg
parent 58242b2b06
commit 9c3049c02c

View file

@ -66,9 +66,13 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\" echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
if [ -x /bin/dnsdomainname ]; then if [ -x /bin/dnsdomainname ]; then
echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname | $UTS_TRUNCATE`\" domain=`dnsdomainname 2> /dev/null`
elif [ -x /bin/domainname ]; then elif [ -x /bin/domainname ]; then
echo \#define LINUX_COMPILE_DOMAIN \"`domainname | $UTS_TRUNCATE`\" domain=`domainname 2> /dev/null`
fi
if [ -n "$domain" ]; then
echo \#define LINUX_COMPILE_DOMAIN \"`echo $domain | $UTS_TRUNCATE`\"
else else
echo \#define LINUX_COMPILE_DOMAIN echo \#define LINUX_COMPILE_DOMAIN
fi fi