- if not system then
- system = nixio.uname().machine
- model = cpuinfo:match("model name.-:%s*([^\n]+)")
- if not model then
- model = cpuinfo:match("Processor.-:%s*([^\n]+)")
- end
- else
- model = cpuinfo:match("cpu model.-:%s*([^\n]+)")
- end
+ local system =
+ cpuinfo:match("system type\t+: ([^\n]+)") or
+ cpuinfo:match("Processor\t+: ([^\n]+)") or
+ cpuinfo:match("model name\t+: ([^\n]+)")
+
+ local model =
+ cpuinfo:match("machine\t+: ([^\n]+)") or
+ cpuinfo:match("Hardware\t+: ([^\n]+)") or
+ fs.readfile("/proc/diag/model") or
+ nixio.uname().machine() or
+ system