kbuild: Use uname for LINUX_COMPILE_HOST detection
PATCH 1/1 kbuild: Use uname for LINUX_COMPILE_HOST detection
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).
--- scripts/mkcompile_h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mkcompile_h +1 -1
@@ -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
Signature · 1 line
2.28.0
Quoted 11 lines · Chris Down
hostnamemay not be present on some systems as it's not mandated by POSIX/SUSv4. This isn't just a theoretical problem: on Arch Linux,hostnameis provided byinetutils, which isn't part of the base distribution.
./scripts/mkcompile_h: line 38: hostname: command not foundUse
uname -ninstead, which is more likely to be available (and mandated by standards).
Quoted 6 lines
Signed-off-by Chris Down <[email protected]>Cc Masahiro Yamada <[email protected]>Cc Michal Marek <[email protected]>---
Applied to linux-kbuild. Thanks.
Quoted 19 lines
scripts/mkcompile_h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/mkcompile_h +1
-2@@ -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
Signature · 2 lines
Best Regards Masahiro Yamada