From 3766a1ab3b8154a2f2917ef6356b55ddaff868fb Mon Sep 17 00:00:00 2001 From: Mans Matulewicz Date: Fri, 26 Oct 2018 09:27:06 +0200 Subject: [PATCH] making compiling work on raspberry pi's --- ...int_linux.go => checkpoint_linux_amd64.go} | 0 checkpoint/checkpoint_linux_arm.go | 23 +++++++++++++++++++ 2 files changed, 23 insertions(+) rename checkpoint/{checkpoint_linux.go => checkpoint_linux_amd64.go} (100%) create mode 100644 checkpoint/checkpoint_linux_arm.go diff --git a/checkpoint/checkpoint_linux.go b/checkpoint/checkpoint_linux_amd64.go similarity index 100% rename from checkpoint/checkpoint_linux.go rename to checkpoint/checkpoint_linux_amd64.go diff --git a/checkpoint/checkpoint_linux_arm.go b/checkpoint/checkpoint_linux_arm.go new file mode 100644 index 000000000..b1c5ac37a --- /dev/null +++ b/checkpoint/checkpoint_linux_arm.go @@ -0,0 +1,23 @@ +package checkpoint + +import ( + "syscall" +) + +func getKernelVersion() string { + var uts syscall.Utsname + syscall.Uname(&uts) + return cstringToString(uts.Release[:]) +} + +func cstringToString(c []uint8) string { + s := make([]byte, len(c)) + i := 0 + for ; i < len(c); i++ { + if c[i] == 0 { + break + } + s[i] = uint8(c[i]) + } + return string(s[:i]) +}