]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - rpc/dial.go
Add basic support for OpenBSD
[safcm/safcm.git] / rpc / dial.go
index f300370aba3f75eb7ff55b7fc9eb0be2c15d9871..ef280191ef57b23ca8f03461a97af206e23ecc67 100644 (file)
@@ -113,7 +113,7 @@ compat_sha512sum() {
        sha512sum "$1"
 }
 `
-       case "freebsd":
+       case "freebsd", "openbsd":
                compat = `
 dir_stat='41777 0 0'
 file_stat="100700 $(id -u) $(id -g)"
@@ -274,7 +274,7 @@ f
 }
 
 func connGetGoos(stdin io.Writer, stdout *bufio.Reader) (string, error) {
-       _, err := fmt.Fprintln(stdin, "uname -o")
+       _, err := fmt.Fprintln(stdin, "uname")
        if err != nil {
                return "", err
        }
@@ -287,12 +287,14 @@ func connGetGoos(stdin io.Writer, stdout *bufio.Reader) (string, error) {
        // NOTE: Adapt helper uploading in dialSSH() when adding new systems
        var goos string
        switch x {
-       case "GNU/Linux":
+       case "Linux":
                goos = "linux"
        case "FreeBSD":
                goos = "freebsd"
+       case "OpenBSD":
+               goos = "openbsd"
        default:
-               return "", fmt.Errorf("unsupported OS %q (`uname -o`)", x)
+               return "", fmt.Errorf("unsupported OS %q (`uname`)", x)
        }
        return goos, nil
 }