Skip to content

Commit

Permalink
Fix general OS information length checks, add aarch64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
joshrendek committed Mar 7, 2024
1 parent 65d65bd commit 8e4725d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jobs:
- run: aws s3 cp sysward s3://updates.sysward.com/
- run: aws s3 cp sysward_x86_64 s3://updates.sysward.com/
- run: aws s3 cp sysward_arm64 s3://updates.sysward.com/
- run: aws s3 cp sysward_arm64 s3://updates.sysward.com/
- run: aws s3 cp sysward_armv7l s3://updates.sysward.com/
- run: aws s3 cp sysward_armv6l s3://updates.sysward.com/
- run: aws s3 cp sysward_aarch64 s3://updates.sysward.com/
- run: aws s3 cp version s3://updates.sysward.com/
- run: aws cloudfront create-invalidation --distribution-id EXAQZU7A32C2T --paths='/*'
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ build_agent:
-ldflags "-X main.Version=`date -u +%Y%m%d`${BUILD_NUMBER}" -o sysward_armv7l
GOOS=linux GOARCH=arm CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-s' \
-ldflags "-X main.Version=`date -u +%Y%m%d`${BUILD_NUMBER}" -o sysward_armv6l
cp sysward_arm64 sysward_aarch64
echo -n `date -u +%Y%m%d`${BUILD_NUMBER} > version

docker: docker_build docker_run
Expand Down
6 changes: 6 additions & 0 deletions operating_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,19 @@ func getOsInformation() OperatingSystem {
func getTotalMemory() string {
out, _ := runner.Run("grep", "MemTotal", "/proc/meminfo")
t := strings.Split(out, ":")
if len(t) < 2 {
return "0"
}
x := strings.TrimSpace(t[1])
return x
}

func getCPUName() string {
out, _ := runner.Run("grep", "name", "/proc/cpuinfo")
t := strings.Split(out, ":")
if len(t) < 2 {
return "Unknown"
}
return strings.TrimSpace(t[1])
}

Expand Down

0 comments on commit 8e4725d

Please sign in to comment.