From ce11e9ca5f434eb1f2c0c468df2b2a369a332f33 Mon Sep 17 00:00:00 2001 From: shirou Date: Mon, 1 Jan 2024 22:07:23 +0900 Subject: [PATCH 1/2] [linux][disk]: fix Rdev cast --- disk/disk_linux.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/disk/disk_linux.go b/disk/disk_linux.go index d96109fa7..ada9f9e76 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -507,8 +507,8 @@ func SerialNumberWithContext(ctx context.Context, name string) (string, error) { if err := unix.Stat(name, &stat); err != nil { return "", err } - major := unix.Major(stat.Rdev) - minor := unix.Minor(stat.Rdev) + major := unix.Major(uint64(stat.Rdev)) + minor := unix.Minor(uint64(stat.Rdev)) sserial, _ := udevData(ctx, major, minor, "E:ID_SERIAL") if sserial != "" { @@ -541,8 +541,8 @@ func LabelWithContext(ctx context.Context, name string) (string, error) { if err := unix.Stat(common.HostDevWithContext(ctx, name), &stat); err != nil { return "", err } - major := unix.Major(stat.Rdev) - minor := unix.Minor(stat.Rdev) + major := unix.Major(uint64(stat.Rdev)) + minor := unix.Minor(uint64(stat.Rdev)) label, err := udevData(ctx, major, minor, "E:ID_FS_LABEL") if err != nil { From 13218ce5b1e1184425fdd11343ebfdfa944bd237 Mon Sep 17 00:00:00 2001 From: shirou Date: Wed, 10 Jan 2024 23:08:22 +0900 Subject: [PATCH 2/2] feat: add linux, mips on build test --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 3f5cd8416..864b1f666 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ build_test: ## test only buildable GOOS=linux GOARCH=loong64 go test ./... | $(BUILD_FAIL_PATTERN) GOOS=linux GOARCH=riscv64 go test ./... | $(BUILD_FAIL_PATTERN) GOOS=linux GOARCH=s390x go test ./... | $(BUILD_FAIL_PATTERN) + GOOS=linux GOARCH=mips go test ./... | $(BUILD_FAIL_PATTERN) GOOS=freebsd GOARCH=amd64 go test ./... | $(BUILD_FAIL_PATTERN) GOOS=freebsd GOARCH=386 go test ./... | $(BUILD_FAIL_PATTERN) GOOS=freebsd GOARCH=arm go test ./... | $(BUILD_FAIL_PATTERN)