Index: gft_hwcomp.py |
diff --git a/gft_hwcomp.py b/gft_hwcomp.py |
index b1efbd3a04cde1e71377c7cbe1b0d2b8ba709ec4..f98d8abbcfa7399e569f1d03824b3549dd2b3f29 100755 |
--- a/gft_hwcomp.py |
+++ b/gft_hwcomp.py |
@@ -45,11 +45,13 @@ class HardwareComponents(object): |
'part_id_flash_chip', |
'part_id_ec_flash_chip', |
'part_id_hwqual', |
+ 'part_id_keyboard', |
'part_id_storage', |
'part_id_tpm', |
'part_id_wireless', |
'vendor_id_touchpad', |
'version_rw_firmware', |
+ 'version_3g_firmware', |
] |
_pci_cids = [ |
'part_id_chipset', |
@@ -289,6 +291,14 @@ class HardwareComponents(object): |
part_id = gft_common.SystemOutput(cmd).strip() |
return part_id |
+ def get_part_id_keyboard(self): |
+ # VPD value "initial_locale"="en-US" should be listed. |
Louis
2011/04/11 02:43:12
Could you change the example as following to match
|
+ image_file = self.load_main_firmware() |
+ part_id = gft_common.SystemOutput( |
+ 'vpd -i RO_VPD -l -f %s | grep keyboard_layout | cut -f4 -d\\"' % |
Louis
2011/04/11 02:43:12
shall we escape -f %s like
-f \\"%s\\"
Ignore
|
+ image_file).strip() |
+ return part_id or self._not_present |
+ |
def get_part_id_tpm(self): |
""" Returns Manufacturer_info : Chip_Version """ |
cmd = 'tpm_version' |
@@ -392,6 +402,35 @@ class HardwareComponents(object): |
return 'A=%d, B=%d' % (versions[0], versions[1]) |
return '%d' % versions[0] |
+ def get_version_3g_firmware(self): |
+ version = 'Unknown' |
+ # TODO(hungte) use mm.py directly to prevent the need of shell scripting |
+ modem_status = gft_common.SystemOutput('modem status').splitlines() |
+ if not modem_status: |
+ return self._not_present |
+ |
+ # status format: |
+ # Manufacturer: $VENDOR |
+ # Modem: $MODEM |
+ # Version: $VERSION_MAY_BE_MULTILINE |
+ def ParseInfo(name): |
+ data = [line for line in modem_status if line.find('%s: ' % name) >= 0] |
+ assert len(data) < 2 |
+ return data[0].split(': ', 1)[1].strip() |
+ |
+ version = ParseInfo('Version') |
+ vendor = ParseInfo('Manufacturer') |
+ modem = ParseInfo('Modem') |
+ |
+ if vendor == 'Samsung' and modem == 'GT-Y3300X': |
+ # The real version is in "Version:" +2 lines |
+ version = '' |
+ for i, line in enumerate(modem_status): |
+ if 'Version: ' in line: |
+ version = modem_status[i + 2].strip() |
+ break |
+ return version or 'Unknown' |
+ |
def _read_gbb_component(self, name): |
image_file = self.load_main_firmware() |
if not image_file: |