Skip to content

Commit ac6f059

Browse files
nefelim4agKevinOConnor
authored andcommitted
util: use dmi data on x86 instead of device-tree
Signed-off-by: Timofey Titovets <[email protected]>
1 parent fe09e2e commit ac6f059

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

klippy/util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@ def get_cpu_info():
127127

128128
def get_device_info():
129129
try:
130-
f = open('/proc/device-tree/model', 'r')
130+
path = '/proc/device-tree/model'
131+
if not os.access(path, os.F_OK):
132+
path = "/sys/class/dmi/id/product_name"
133+
if not os.access(path, os.F_OK):
134+
return "?"
135+
f = open(path, 'r')
131136
data = f.read()
132137
f.close()
133138
except (IOError, OSError) as e:

0 commit comments

Comments
 (0)