The following commit has been merged in the linux branch: commit 9c3049c02c6142e166c9472237f1f60d86153682 Author: Felipe Contreras felipe.contreras@gmail.com Date: Thu Sep 17 00:38:39 2009 +0300
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
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 6a12dd9..f060763 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h @@ -66,9 +66,13 @@ UTS_TRUNCATE="sed -e s/(.{1,$UTS_LEN}).*/\1/" echo #define LINUX_COMPILE_HOST "`hostname | $UTS_TRUNCATE`"
if [ -x /bin/dnsdomainname ]; then - echo #define LINUX_COMPILE_DOMAIN "`dnsdomainname | $UTS_TRUNCATE`" + domain=`dnsdomainname 2> /dev/null` 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 echo #define LINUX_COMPILE_DOMAIN fi