Commit Graph

239 Commits (fb83fb22d68f468adf2a01a9ed4963e7d980cfd7)

Author SHA1 Message Date
Antoine Toulme b712e59295 fix more linting reports
Antoine Toulme 38b94668ea allow to pass context values to override environment variables
Matthieu MOREL 1fb1e3e3e6 ci(lint): correct gci linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
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
Jacob Young 02660eaf7c
Update host/host_linux.go
Use a raw string instead of escaped quotes.

Co-authored-by: shirou <shirou.faw@gmail.com>
Jacob Young 43566581f0 Recognize Cumulus Linux distro
Add Cumulus Linux and Kylin to debian family
shirou 6a5e40a517
Merge pull request #1228 from abner-chenc/master
host: add support for linux/loong64
shirou e563e6394e
Merge pull request #1356 from N1neSun/patch-1
fix some kylin linux bug
shirou 0494d7f0b9
Merge pull request #1403 from Agilicus/add-ppc64be
[host] linux/ppc: ppc64 definition from ppc64le
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>
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()`.
Don Bowman d7f1f76519
[host] linux/ppc: ppc64 definition from ppc64le
Same as commit fc04d2d, but for ppc64 from ppc64le definition.
Tobias Klauser f9a5834e0e
host: use unix.ByteSliceToString
Use ByteSliceToString provided in golang.org/x/sys/unix to convert
\0-terminated byte slices to strings.
shirou 5473fd114d [disk][host]: change to use type alias.
shirou 4ac7e99c6a [disk][host]: move back Warnings from internal to disk and host.
fix #1377
shirou 68452e2602 feat(host, windows): add UBR (Update Build Revision) to kernel version
Antoine Toulme dbc0f20fe3 code review
N1neSun add9158d4e fix some kylin linux bug
shirou ed37dc27a2
Merge pull request #1335 from tklauser/drop-darwin-386
host, process: delete darwin/386 code
Stuart Caie e0400cc94f Use 0 as default mach port
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.
Stuart Caie 55411f1178 Replace IOMainPort/IOMasterPort() and kIOMainPortDefault/kIOMasterPortDefault with NULL
shirou 5610fbc5d5 fix(host,linux): Check if path exists and is nonempty before reading host files
yueyt 15354cbdee add neokylin host info on linux
Martin Reindl 1d89235f34 host: add support for OpenBSD/armv7
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.
Ville Skyttä 7a8feb155b [host][solaris] implement SensorsTemperaturesWithContext
Lammert Hellinga 001699bed7 Let almalinux be part of the rhel family
Matthieu MOREL 4671e649aa
enable revive linter
mmorel-35 1e6b445a8a gofumpt
mmorel-35 eb5f6203d8 gofmt
shirou b1186a68ed
Merge pull request #1191 from shirou/feature/update_mac_cgo
[disk][host][mac] fix deprecated code in macOS Monterey
Matthieu MOREL b673968d5d
enable errorlint linter
shirou 4c3edcfe56 [mac] fix deprecated code in macOS Monterey
shirou d2e27c1712 fix dependabot v2 deletion.
shirou 0969c9436b delete v2 directory, move v3 to top #1078
shirou 0fdf65fa3e Change to use yusufpapurcu/wmi from StackExchange/wmi.
shirou e032a1c81d
Merge pull request #1059 from d1ss0nanz/issue1058
use ioreg to read IOPlatformUUID as HostID
Lars Meyer a7d936d0a4 [host][windows] Fix Windows 11 reporting
While ProductName remains "Windows 10", versions with Build no. >= 22000
are Windows 11.
odinje a3e22baec0 Ensure rhel platform family for Rocky Linux
shirou 2782a109dc
Merge pull request #1010 from gdbinit/openbsd-wrong-users-number-patch
Fix wrong OpenBSD user count
Daniel Stutz 9916462c47 use ioreg to read IOPlatformUUID as HostID
Guillaume Ballet 992d17af94 add support for OpenBSD arm64
Mykola Terelia 84e8e51bf9 Added missing distributions to the suse platform family
fG! ab33d5ec89
Fix wrong user count
There are empty entries in OpenBSD's utmp that have a line and time entry but no user logged in (the entry is "cleared" after user logs out but not totally as expected in the code here). Current checks are insufficient so check if Name field is empty and skip in that case.
shirou f377a07e5a fix test and openbsd errors.
Ryan Fitzpatrick 8046134504
Fix VirtualizationWithContext() race in linux
shirou 6c9f3bdcae [host][linux] Change to use unix.SysInfo_t to get Uptime in Linux
Sergey Vinogradov 5209442b3c Refactor "host" package
Lomanic 8a625ec054 [host][process][darwin] Go-fmt code from mktypes.sh from #917