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)
}
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
}
// 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
}
// 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"