mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kbuild: use hostname -s along uname to obtain LINUX_COMPILE_HOST
@ 2022-03-30 18:23 FraSharp
  2022-04-01 14:04 ` Masahiro Yamada
  2022-04-01 15:17 ` [PATCH v2] " FraSharp
  0 siblings, 2 replies; 8+ messages in thread
From: FraSharp @ 2022-03-30 18:23 UTC (permalink / raw)
  Cc: f.duca00, Francesco Duca, Masahiro Yamada, Michal Marek,
	Nick Desaulniers, linux-kbuild, linux-kernel

From: Francesco Duca <s23265@iisve.it>

* On some systems (e.g. macOS), using commands like 'uname -n' or
  'hostname' will print something similar to "hostname.domain"
  ("Francescos-Air.fritz.box" for example), which is very annoying.
  What works instead is 'hostname -s', which will only write hostname
  without the domain ("Francescos-Air" for example),
  but also keep 'uname -n', as some systems as Arch Linux does not have
  'hostname' as command.

* This commit is complementary to
  1e66d50ad3a1dbf0169b14d502be59a4b1213149
  ("kbuild: Use uname for LINUX_COMPILE_HOST detection")

Signed-off-by: Francesco Duca <s23265@iisve.it>
---
 scripts/mkcompile_h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index ca40a5258..6054e3eee 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -34,7 +34,7 @@ else
 	LINUX_COMPILE_BY=$KBUILD_BUILD_USER
 fi
 if test -z "$KBUILD_BUILD_HOST"; then
-	LINUX_COMPILE_HOST=`uname -n`
+	LINUX_COMPILE_HOST=$(hostname -s || uname -n)
 else
 	LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
 fi
-- 
2.32.0 (Apple Git-132)


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

end of thread, other threads:[~2022-04-01 17:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 18:23 [PATCH] kbuild: use hostname -s along uname to obtain LINUX_COMPILE_HOST FraSharp
2022-04-01 14:04 ` Masahiro Yamada
2022-04-01 14:19   ` Masahiro Yamada
2022-04-01 15:06     ` Francesco Duca
2022-04-01 15:22       ` Masahiro Yamada
2022-04-01 15:39         ` Francesco Duca
2022-04-01 15:17 ` [PATCH v2] " FraSharp
2022-04-01 17:21   ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®