diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2009-09-16 23:38:39 +0200 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2009-10-11 23:21:25 +0200 |
commit | 9c3049c02c6142e166c9472237f1f60d86153682 (patch) | |
tree | 624f892c23db814575a62debbf3e6a5981889f9b /scripts/mkcompile_h | |
parent | kbuild: Fix size_append issue for bzip2/lzma kernel (diff) | |
download | linux-9c3049c02c6142e166c9472237f1f60d86153682.tar.xz linux-9c3049c02c6142e166c9472237f1f60d86153682.zip |
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/mkcompile_h')
-rwxr-xr-x | scripts/mkcompile_h | 8 |
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/" 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 |