Mac mini support: arm64 cross-build installed beside the binary and pushed by arch; ARM machine name from the device tree
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
b6502ba362
commit
a372378098
@@ -914,6 +914,12 @@ var cpuModel = func() string {
|
||||
}
|
||||
}
|
||||
}
|
||||
// ARM boards don't put a model name in cpuinfo; the device tree names the machine.
|
||||
for _, p := range []string{"/sys/firmware/devicetree/base/model", "/proc/device-tree/model", "/sys/devices/virtual/dmi/id/product_name"} {
|
||||
if m := strings.TrimRight(strings.TrimSpace(readStr(p)), "\x00"); m != "" {
|
||||
return m
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}()
|
||||
|
||||
|
||||
@@ -313,8 +313,13 @@ func (m *Manager) Push(ctx context.Context, name, binPath, ourArch string) PushR
|
||||
_ = json.NewDecoder(io.LimitReader(resp.Body, 64<<10)).Decode(&me)
|
||||
resp.Body.Close()
|
||||
if me.Arch != "" && ourArch != "" && me.Arch != ourArch {
|
||||
res.Error = fmt.Sprintf("architecture mismatch: node is %s, this binary is %s — build for it and deploy by hand", me.Arch, ourArch)
|
||||
return res
|
||||
// look for a sibling build: /usr/local/bin/hamlab-arm64 next to /usr/local/bin/hamlab
|
||||
alt := binPath + "-" + me.Arch
|
||||
if _, err := os.Stat(alt); err != nil {
|
||||
res.Error = fmt.Sprintf("node is %s but only a %s build is installed here (expected %s; run make deploy, which builds it)", me.Arch, ourArch, alt)
|
||||
return res
|
||||
}
|
||||
binPath = alt
|
||||
}
|
||||
f, err := os.Open(binPath)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user