X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=rpc%2Fdial.go;h=ef280191ef57b23ca8f03461a97af206e23ecc67;hb=444e9874424580361e00547b597d213370045057;hp=680cb87df39ae0c999ce789d5d53bb168ed64b80;hpb=304a68c565d58ae52dd39cf6e2d6ef52cada7d19;p=safcm%2Fsafcm.git diff --git a/rpc/dial.go b/rpc/dial.go index 680cb87..ef28019 100644 --- a/rpc/dial.go +++ b/rpc/dial.go @@ -112,6 +112,17 @@ compat_stat() { compat_sha512sum() { sha512sum "$1" } +` + case "freebsd", "openbsd": + compat = ` +dir_stat='41777 0 0' +file_stat="100700 $(id -u) $(id -g)" +compat_stat() { + stat -f '%p %u %g' "$1" +} +compat_sha512sum() { + sha512 -q "$1" +} ` default: return fmt.Errorf("internal error: no support for %q", goos) @@ -263,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 } @@ -276,10 +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 } @@ -298,7 +313,7 @@ func connGetGoarch(stdin io.Writer, stdout *bufio.Reader) (string, error) { // NOTE: Adapt cmd/safcm-remote/build.sh when adding new architectures var goarch string switch x { - case "x86_64": + case "x86_64", "amd64": goarch = "amd64" case "armv7l": goarch = "armv7l"