From adf74c75ededd5d359f2db5ebc6da68c5a4070aa Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 13 Apr 2020 09:22:08 -0700 Subject: [PATCH] wgengine: also diagnose not-yet-rebooted system updates on Arch --- wgengine/userspace.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wgengine/userspace.go b/wgengine/userspace.go index 0f6d4cfde..b5e05e8b6 100644 --- a/wgengine/userspace.go +++ b/wgengine/userspace.go @@ -746,6 +746,15 @@ func diagnoseLinuxTUNFailure(logf logger.Logf) { if !bytes.Contains(dpkgOut, kernel) { logf("kernel/drivers/net/tun.ko found on disk, but not for current kernel; are you in middle of a system update and haven't rebooted? found: %s", dpkgOut) } + case "arch": + findOut, err := exec.Command("find", "/lib/modules/", "-path", "*/net/tun.ko*").CombinedOutput() + if len(bytes.TrimSpace(findOut)) == 0 || err != nil { + logf("tun module not loaded nor found on disk") + return + } + if !bytes.Contains(findOut, kernel) { + logf("kernel/drivers/net/tun.ko found on disk, but not for current kernel; are you in middle of a system update and haven't rebooted? found: %s", findOut) + } } } @@ -753,5 +762,8 @@ func linuxDistro() string { if _, err := os.Stat("/etc/debian_version"); err == nil { return "debian" } + if _, err := os.Stat("/etc/arch-release"); err == nil { + return "arch" + } return "" }