]> Git Repo - linux.git/commitdiff
kbuild: Use uname for LINUX_COMPILE_HOST detection
authorChris Down <[email protected]>
Tue, 20 Oct 2020 09:34:59 +0000 (10:34 +0100)
committerMasahiro Yamada <[email protected]>
Tue, 20 Oct 2020 15:46:04 +0000 (00:46 +0900)
`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 <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
scripts/mkcompile_h

index baf3ab8d9d49ce40036d9e788ac5ecd5197aac53..4ae735039daf2c554dcc2f6c46879a76fc08f851 100755 (executable)
@@ -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
This page took 0.055941 seconds and 4 git commands to generate.