From 54b33bd6a7853653f74d33e6cf3e22d5193bbb64 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sun, 14 Oct 2012 14:32:08 -0400 Subject: [PATCH] fix DXG detection --- frontend/ui/device.lua | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/frontend/ui/device.lua b/frontend/ui/device.lua index 90295c98a..813fc1520 100644 --- a/frontend/ui/device.lua +++ b/frontend/ui/device.lua @@ -7,9 +7,13 @@ function Device:getModel() local std_out = io.popen("grep 'MX' /proc/cpuinfo | cut -d':' -f2 | awk {'print $2'}", "r") local cpu_mod = std_out:read() if not cpu_mod then - return nil + local ret = os.execute("grep 'Hardware : Mario Platform' /proc/cpuinfo", "r") + if ret ~= 0 then + return nil + else + return "KindleDXG" + end end - if cpu_mod == "MX50" then local f = lfs.attributes("/sys/devices/system/fl_tps6116x/fl_tps6116x0/fl_intensity") if f then @@ -19,12 +23,7 @@ function Device:getModel() end elseif cpu_mod == "MX35" then -- check if we are running on Kindle 3 (additional volume input) - local f = lfs.attributes("/dev/input/event2") - if f then - return "Kindle3" - else - return "KindleDXG" - end + return "Kindle3" elseif cpu_mod == "MX3" then return "Kindle2" else