aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/features_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/host/features_linux.go')
-rw-r--r--pkg/host/features_linux.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/host/features_linux.go b/pkg/host/features_linux.go
index 142e58e3b..408e219eb 100644
--- a/pkg/host/features_linux.go
+++ b/pkg/host/features_linux.go
@@ -5,6 +5,7 @@ package host
import (
"fmt"
+ "os/exec"
"regexp"
"runtime"
"runtime/debug"
@@ -37,6 +38,7 @@ func init() {
checkFeature[FeatureVhciInjection] = checkVhciInjection
checkFeature[FeatureWifiEmulation] = checkWifiEmulation
checkFeature[Feature802154Emulation] = check802154Emulation
+ checkFeature[FeatureSwap] = checkSwap
}
func checkCoverage() string {
@@ -287,6 +289,16 @@ func check802154Emulation() string {
return ""
}
+func checkSwap() string {
+ if err := osutil.IsAccessible("/proc/swaps"); err != nil {
+ return err.Error()
+ }
+ if _, err := exec.LookPath("mkswap"); err != nil {
+ return "mkswap is not available"
+ }
+ return ""
+}
+
func requireKernel(x, y int) string {
info := new(unix.Utsname)
if err := unix.Uname(info); err != nil {