Commit Graph

259 Commits (9f480f137dbe4eb875a70444b68e37e6cc3a3815)

Author SHA1 Message Date
shirou.wakayama 2003e4c54f [host][windows]: change platform version from build version to display version 11 months ago
shirou bffc4357e8 rename redundant test function names, such as TestCPU in cpu package 11 months ago
shirou 6e19712486 [sensors] move Temperatures from host to sensors. 11 months ago
shirou 6df9bf1af4 add SPDX License, remove old build tag, and replace import 11 months ago
shirou cbefbb023e [host][linux]: add pading on linux_arm64 1 year ago
shirou cfb7a5dc2e [host][linux]: change Line/User/Host to int8 on utmp
Generated code is uint8 on arm64. However, it is not same as other archtectures.
This commit changes by hand.
1 year ago
shirou d86a995563 [host][linux]: fix utmp size on linux/arm64 1 year ago
Jonathan Matthew 27ffa28a0d add support for OpenBSD/riscv64 1 year ago
Bryce Kahle b0d976c49b
ensure host platform are files and have contents
In a containerized deployment, it is common to mount several files from /etc. Within the container, those files will be created regardless if they exist on the host or not. In those instances, the existing code would erroneously return empty platform information.
1 year ago
shirou b10acd4894 [host]: add EnableBootTimeCache function 1 year ago
Ville Skyttä 362fa4b9c4 Avoid repeated regexp compilations 1 year ago
Xie Weineng 0de2d14a7c add deepin and uos distro 1 year ago
shirou 4b46f2b70c [host][darwin]: fix Users 1 year ago
Justin Yang 7ffb24dbe3
Merge branch 'shirou:master' into feature/netbsd-arm64-port 1 year ago
Justin Yang 4a46201e00 cpu && host: fix compile time errors 2 years ago
Matthieu MOREL c806740b34
ci(lint): ensure io/ioutil replacement (#1525)
* ci(lint): enure ioutil replacement

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update host_solaris.go
* Update process_linux_test.go
* Update net_linux_test.go
* Update net_linux_test.go
* Update process_test.go
* Update process_linux_test.go
* Update process_linux_test.go

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 years ago
Justin Yang e82d2e4ca8 host: enable uptime for NetBSD 2 years ago
shirou 0665cafa1b chore: replace deprecated ioutil package to os and io 2 years ago
shirou febdeab871 chore: change CIRCLECI environment variable to CI. 2 years ago
shirou 3748c19402 [host][linux]: remove double quote from lsb release info
fix: #1502
2 years ago
Antoine Toulme b712e59295 fix more linting reports 2 years ago
Antoine Toulme 38b94668ea allow to pass context values to override environment variables 2 years ago
Matthieu MOREL 1fb1e3e3e6 ci(lint): correct gci linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 years ago
Josh Powers e7c6b6991d
fix: moves common.Warnings to common OS files
This allows all OS types to unwrap the Warnings from errors, and not
just linux in host or windows in disk.

fixes: #1429
2 years ago
Jacob Young 02660eaf7c
Update host/host_linux.go
Use a raw string instead of escaped quotes.

Co-authored-by: shirou <shirou.faw@gmail.com>
2 years ago
Jacob Young 43566581f0 Recognize Cumulus Linux distro
Add Cumulus Linux and Kylin to debian family
2 years ago
shirou 6a5e40a517
Merge pull request #1228 from abner-chenc/master
host: add support for linux/loong64
2 years ago
shirou e563e6394e
Merge pull request #1356 from N1neSun/patch-1
fix some kylin linux bug
2 years ago
shirou 0494d7f0b9
Merge pull request #1403 from Agilicus/add-ppc64be
[host] linux/ppc: ppc64 definition from ppc64le
2 years ago
Guoqi Chen b793d83f72 host: add support for linux/loong64
Updates #1338.

Signed-off-by: Guoqi Chen <chenguoqi@loongson.cn>
Co-authored-by: Jiantao Shan <shanjiantao@loongson.cn>
2 years ago
Jeff Erbrecht a5ecb9bca5 [host] windows: use millisecond precision for BootTime()
Previously, system uptime is truncated to seconds, and then the
subtraction from `time.Now()` is performed. Because uptime does not roll
over to the next second at the same instant as `time.Now()`, then
`BootTime()` ends up not being precise, and often varies by 1 second.

This commit does the subtraction before truncating to seconds, which
results in a significantly lower chance of variance in `BootTime()`.
2 years ago
Don Bowman d7f1f76519
[host] linux/ppc: ppc64 definition from ppc64le
Same as commit fc04d2d, but for ppc64 from ppc64le definition.
2 years ago
Tobias Klauser f9a5834e0e
host: use unix.ByteSliceToString
Use ByteSliceToString provided in golang.org/x/sys/unix to convert
\0-terminated byte slices to strings.
2 years ago
shirou 5473fd114d [disk][host]: change to use type alias. 2 years ago
shirou 4ac7e99c6a [disk][host]: move back Warnings from internal to disk and host.
fix #1377
2 years ago
shirou 68452e2602 feat(host, windows): add UBR (Update Build Revision) to kernel version 2 years ago
Antoine Toulme dbc0f20fe3 code review 2 years ago
N1neSun add9158d4e fix some kylin linux bug 3 years ago
shirou ed37dc27a2
Merge pull request #1335 from tklauser/drop-darwin-386
host, process: delete darwin/386 code
3 years ago
Stuart Caie e0400cc94f Use 0 as default mach port 3 years ago
Tobias Klauser c76712b8da
host, process: delete darwin/386 code
The darwin/386 port was dropped in Go 1.15 and the imported version of
golang.org/x/sys also no longer supports the port. This module requires
at least Go 1.15 per go.mod, so it no longer builds on darwin/386
anyway.
3 years ago
Stuart Caie 55411f1178 Replace IOMainPort/IOMasterPort() and kIOMainPortDefault/kIOMasterPortDefault with NULL 3 years ago
shirou 5610fbc5d5 fix(host,linux): Check if path exists and is nonempty before reading host files 3 years ago
yueyt 15354cbdee add neokylin host info on linux 3 years ago
Martin Reindl 1d89235f34 host: add support for OpenBSD/armv7 3 years ago
Ville Skyttä f7e1f36418 refactor: remove unnecessary exec.LookPath calls
Executing the command does the lookup if needed and returns the same
error when not found, no need to do it separately.
3 years ago
Ville Skyttä 7a8feb155b [host][solaris] implement SensorsTemperaturesWithContext 3 years ago
Lammert Hellinga 001699bed7 Let almalinux be part of the rhel family 3 years ago
Matthieu MOREL 4671e649aa
enable revive linter 3 years ago
mmorel-35 1e6b445a8a gofumpt 3 years ago