From 1736046db88e13842e67396da8ee7b02ece75443 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Mon, 8 Jun 2009 14:18:48 +0200 Subject: [PATCH] make DEVICEDB depending on model type --- lib/python/Components/Harddisk.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py index 0d141248..18616bf2 100755 --- a/lib/python/Components/Harddisk.py +++ b/lib/python/Components/Harddisk.py @@ -329,19 +329,27 @@ class Partition: return False DEVICEDB = \ + {"dm8000": + { + # dm8000: + "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.1/1-1.1:1.0": "Front USB Slot", + "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.2/1-1.2:1.0": "Back, upper USB Slot", + "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0": "Back, lower USB Slot", + "/devices/platform/brcm-ehci-1.1/usb2/2-1/2-1:1.0/host1/target1:0:0/1:0:0:0": "DVD Drive", + }, + "dm800": { - # dm8000: - "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.1/1-1.1:1.0": "Front USB Slot", - "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.2/1-1.2:1.0": "Back, upper USB Slot", - "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0": "Back, lower USB Slot", - "/devices/platform/brcm-ehci-1.1/usb2/2-1/2-1:1.0/host1/target1:0:0/1:0:0:0": "DVD Drive", # dm800: "/devices/platform/brcm-ehci.0/usb1/1-2/1-2:1.0": "Upper USB Slot", "/devices/platform/brcm-ehci.0/usb1/1-1/1-1:1.0": "Lower USB Slot", + }, + "dm7025": + { # dm7025: "/devices/pci0000:00/0000:00:14.1/ide1/1.0": "CF Card Slot", #hdc "/devices/pci0000:00/0000:00:14.1/ide0/0.0": "Internal Harddisk" } + } class HarddiskManager: def __init__(self): @@ -519,7 +527,8 @@ class HarddiskManager: description = open("/sys" + phys + "/model").read().strip() except IOError, s: print "couldn't read model: ", s - for physdevprefix, pdescription in DEVICEDB.items(): + from Tools.HardwareInfo import HardwareInfo + for physdevprefix, pdescription in DEVICEDB.get(HardwareInfo().device_name,{}).items(): if phys.startswith(physdevprefix): description = pdescription -- 2.30.2