aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Tools/HardwareInfo.py
blob: f5c45345a26ca2b7f820904e96709f703154eb94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class HardwareInfo:
	def __init__(self):
		self.device = "unknown"
		try:
			file = open("/proc/stb/info/model", "r")
			self.device = file.readline().strip()
			file.close()
		except:
			print "----------------"
			print "you should upgrade to new drivers for the hardware detection to work properly"
			print "----------------"
			print "fallback to detect hardware via /proc/cpuinfo!!"
			try:
				rd = open("/proc/cpuinfo", "r").read()
				if rd.find("Brcm4380 V4.2") != 0:
					self.device = "dm8000"
					print "dm8000 detected!"
				elif rd.find("Brcm7401 V0.0") != 0:
					self.device = "dm800"
					print "dm800 detected!"
				elif rd.find("MIPS 4KEc V4.8") != 0:
					self.device = "dm7025"
					print "dm7025 detected!"
			except:
				pass

	def get_device_name(self):
		return self.device
	
	device_name = property(get_device_name)