linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: Use uname for LINUX_COMPILE_HOST detection
@ 2020-10-20  9:34 Chris Down
  2020-10-22  4:25 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Down @ 2020-10-20  9:34 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel, Michal Marek, Masahiro Yamada

`hostname` may not be present on some systems as it's not mandated by
POSIX/SUSv4. This isn't just a theoretical problem: on Arch Linux,
`hostname` is provided by `inetutils`, which isn't part of the base
distribution.

    ./scripts/mkcompile_h: line 38: hostname: command not found

Use `uname -n` instead, which is more likely to be available (and
mandated by standards).

Signed-off-by: Chris Down <chris@chrisdown.name>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 scripts/mkcompile_h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index baf3ab8d9d49..4ae735039daf 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -35,7 +35,7 @@ else
 	LINUX_COMPILE_BY=$KBUILD_BUILD_USER
 fi
 if test -z "$KBUILD_BUILD_HOST"; then
-	LINUX_COMPILE_HOST=`hostname`
+	LINUX_COMPILE_HOST=`uname -n`
 else
 	LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
 fi
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: Use uname for LINUX_COMPILE_HOST detection
  2020-10-20  9:34 [PATCH] kbuild: Use uname for LINUX_COMPILE_HOST detection Chris Down
@ 2020-10-22  4:25 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2020-10-22  4:25 UTC (permalink / raw)
  To: Chris Down
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List, Michal Marek

On Tue, Oct 20, 2020 at 6:35 PM Chris Down <chris@chrisdown.name> wrote:
>
> `hostname` may not be present on some systems as it's not mandated by
> POSIX/SUSv4. This isn't just a theoretical problem: on Arch Linux,
> `hostname` is provided by `inetutils`, which isn't part of the base
> distribution.
>
>     ./scripts/mkcompile_h: line 38: hostname: command not found
>
> Use `uname -n` instead, which is more likely to be available (and
> mandated by standards).
>
> Signed-off-by: Chris Down <chris@chrisdown.name>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: linux-kbuild@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---

Applied to linux-kbuild. Thanks.


>  scripts/mkcompile_h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
> index baf3ab8d9d49..4ae735039daf 100755
> --- a/scripts/mkcompile_h
> +++ b/scripts/mkcompile_h
> @@ -35,7 +35,7 @@ else
>         LINUX_COMPILE_BY=$KBUILD_BUILD_USER
>  fi
>  if test -z "$KBUILD_BUILD_HOST"; then
> -       LINUX_COMPILE_HOST=`hostname`
> +       LINUX_COMPILE_HOST=`uname -n`
>  else
>         LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
>  fi
> --
> 2.28.0
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-22  4:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20  9:34 [PATCH] kbuild: Use uname for LINUX_COMPILE_HOST detection Chris Down
2020-10-22  4:25 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).