| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """ gft_report.py: Device detail reports for factory process. | 6 """ gft_report.py: Device detail reports for factory process. |
| 7 | 7 |
| 8 The reports for factory is currently a python native dict. | 8 The reports for factory is currently a python native dict. |
| 9 | 9 |
| 10 You can use CreateReport() to create a native report, | 10 You can use CreateReport() to create a native report, |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 progress_messsage="Reading RW VPD", | 200 progress_messsage="Reading RW VPD", |
| 201 show_progress=verbose).strip()) | 201 show_progress=verbose).strip()) |
| 202 | 202 |
| 203 # Probed hardware components | 203 # Probed hardware components |
| 204 report['probed_components'] = dict( | 204 report['probed_components'] = dict( |
| 205 [(key, ', '.join(value)) for key, value in probed_components.items()]) | 205 [(key, ', '.join(value)) for key, value in probed_components.items()]) |
| 206 | 206 |
| 207 # Firmware write protection status | 207 # Firmware write protection status |
| 208 wp_status_message = ( | 208 wp_status_message = ( |
| 209 'main: %s\nec: %s' % | 209 'main: %s\nec: %s' % |
| 210 (gft_common.SystemOutput('flashrom -p internal:bus=spi --wp-status'), | 210 (gft_common.SystemOutput('flashrom -p internal:bus=lpc --wp-status'), |
| 211 gft_common.SystemOutput('flashrom -p internal:bus=lpc --wp-status'))) | 211 gft_common.SystemOutput('flashrom -p internal:bus=spi --wp-status'))) |
| 212 report['wp_status'] = wp_status_message.splitlines() | 212 report['wp_status'] = wp_status_message.splitlines() |
| 213 | 213 |
| 214 # TODO(hungte) we may also add these data in future: | 214 # TODO(hungte) we may also add these data in future: |
| 215 # rootfs hash, dump_kernel_config, lsb-release from release image, | 215 # rootfs hash, dump_kernel_config, lsb-release from release image, |
| 216 # gooftool version, result of dev_vboot_debug, | 216 # gooftool version, result of dev_vboot_debug, |
| 217 # /var/log/factory.log and any other customized data | 217 # /var/log/factory.log and any other customized data |
| 218 | 218 |
| 219 # Verbose log. Should be prepared before the last step. | 219 # Verbose log. Should be prepared before the last step. |
| 220 if verbose_log_path and os.path.exists(verbose_log_path): | 220 if verbose_log_path and os.path.exists(verbose_log_path): |
| 221 verbose_log = gft_common.ReadFile(verbose_log_path).splitlines() | 221 verbose_log = gft_common.ReadFile(verbose_log_path).splitlines() |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 if options.report_path: | 319 if options.report_path: |
| 320 print "Saved report to: %s" % options.report_path | 320 print "Saved report to: %s" % options.report_path |
| 321 with open(options.report_path, "wb") as report_handle: | 321 with open(options.report_path, "wb") as report_handle: |
| 322 report_handle.write(data) | 322 report_handle.write(data) |
| 323 else: | 323 else: |
| 324 print data | 324 print data |
| 325 | 325 |
| 326 | 326 |
| 327 if __name__ == "__main__": | 327 if __name__ == "__main__": |
| 328 main() | 328 main() |
| OLD | NEW |