mirror of
https://github.com/oneclickvirt/basics.git
synced 2025-10-09 02:20:18 +08:00
update
This commit is contained in:
@@ -146,6 +146,7 @@ func getCpuInfo(ret *model.SystemInfo, cpuType string) (*model.SystemInfo, error
|
||||
}
|
||||
}
|
||||
// 使用 sysctl 获取信息 - 特化适配 freebsd openbsd 系统
|
||||
if checkSysctlVersion() {
|
||||
if ret.CpuModel == "" {
|
||||
cname, err := getSysctlValue("hw.model")
|
||||
if err == nil && !strings.Contains(cname, "cannot") {
|
||||
@@ -239,7 +240,8 @@ func getCpuInfo(ret *model.SystemInfo, cpuType string) (*model.SystemInfo, error
|
||||
ret.Load = load
|
||||
}
|
||||
}
|
||||
// 使用 /proc/device-tree 获取信息 - 特化适配嵌入式系统
|
||||
}
|
||||
// TODO 使用 /proc/device-tree 获取信息 - 特化适配嵌入式系统
|
||||
deviceTreeContent, err := os.ReadFile("/proc/device-tree")
|
||||
if err == nil {
|
||||
ret.CpuModel = string(deviceTreeContent)
|
||||
|
Reference in New Issue
Block a user