From 01de80ed09f5f431e4f559d5d4494ef0cc6afa48 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 27 Feb 2020 18:48:12 +0800 Subject: [PATCH] hostman: use "uname -m" for for fetch processor type "uname -p" command from native busybox, coreutils may return "unknown". CentOS coreutils has a patch fallback to using uts.machine if sysinfo syscall is not available Use "uname -m" for maximum compatibility --- pkg/hostman/hostinfo/hostinfohelper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/hostman/hostinfo/hostinfohelper.go b/pkg/hostman/hostinfo/hostinfohelper.go index eaf64a1971..b17d6072c8 100644 --- a/pkg/hostman/hostinfo/hostinfohelper.go +++ b/pkg/hostman/hostinfo/hostinfohelper.go @@ -95,7 +95,7 @@ func DetectCpuInfo() (*SCPUInfo, error) { if err != nil { return nil, errors.Wrap(err, "parse dmi cpuinfo") } - cpuArch, err := procutils.NewCommand("uname", "-p").Output() + cpuArch, err := procutils.NewCommand("uname", "-m").Output() if err != nil { return nil, errors.Wrap(err, "get cpu architecture") }