| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # | 2 # |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """ | 7 """ |
| 8 gooftool: Google Factory Tool, providing all Google Required Test | 8 gooftool: Google Factory Tool, providing all Google Required Test |
| 9 functionality. | 9 functionality. |
| 10 """ | 10 """ |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 ErrorDie('upload_report: failed to upload.') | 305 ErrorDie('upload_report: failed to upload.') |
| 306 return True | 306 return True |
| 307 | 307 |
| 308 | 308 |
| 309 @GFTLogCommand | 309 @GFTLogCommand |
| 310 def wpfw(): | 310 def wpfw(): |
| 311 """ Enables and verifies firmware write protection. """ | 311 """ Enables and verifies firmware write protection. """ |
| 312 if g_options.debug_dryrun_wpfw: | 312 if g_options.debug_dryrun_wpfw: |
| 313 ErrorMsg('wpfw is by-passed. This device CANNOT be qualified.') | 313 ErrorMsg('wpfw is by-passed. This device CANNOT be qualified.') |
| 314 return True | 314 return True |
| 315 if EnableWriteProtect('bios') and EnableWriteProtect('ec'): | 315 if EnableWriteProtect('ec') and EnableWriteProtect('bios'): |
| 316 return True | 316 return True |
| 317 ErrorDie('wpfw: failed to enable firmware write protection.') | 317 ErrorDie('wpfw: failed to enable firmware write protection.') |
| 318 | 318 |
| 319 | 319 |
| 320 @GFTLogCommand | 320 @GFTLogCommand |
| 321 def prepare_wipe(): | 321 def prepare_wipe(): |
| 322 """ Prepares system to reboot for transitioning to release state. """ | 322 """ Prepares system to reboot for transitioning to release state. """ |
| 323 if g_options.debug_dryrun_prepare_wipe: | 323 if g_options.debug_dryrun_prepare_wipe: |
| 324 ErrorMsg('prepare_wipe is by-passed. This device CANNOT be qualified.') | 324 ErrorMsg('prepare_wipe is by-passed. This device CANNOT be qualified.') |
| 325 return True | 325 return True |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 parser.add_option('--upload_method', metavar='METHOD:PARAM', | 417 parser.add_option('--upload_method', metavar='METHOD:PARAM', |
| 418 help='assign the upload method (see gft_upload).') | 418 help='assign the upload method (see gft_upload).') |
| 419 | 419 |
| 420 # Write Protection Wiping, and Finalization | 420 # Write Protection Wiping, and Finalization |
| 421 parser.add_option('--wpfw', action='store_true', | 421 parser.add_option('--wpfw', action='store_true', |
| 422 help='enable and verify firmware write protection') | 422 help='enable and verify firmware write protection') |
| 423 parser.add_option('--prepare_wipe', action='store_true', | 423 parser.add_option('--prepare_wipe', action='store_true', |
| 424 help='prepare for wiping factory tests and ' | 424 help='prepare for wiping factory tests and ' |
| 425 'transit to release mode in next reboot') | 425 'transit to release mode in next reboot') |
| 426 parser.add_option('--verify', action='store_true', | 426 parser.add_option('--verify', action='store_true', |
| 427 help='runs: --verify_switch-wp, --verify_switch_dev, ' | 427 help='runs: --verify_switch_wp, --verify_switch_dev, ' |
| 428 '--verify_hwid, --verify_keys') | 428 '--verify_hwid, --verify_keys') |
| 429 parser.add_option('--finalize', action='store_true', | 429 parser.add_option('--finalize', action='store_true', |
| 430 help='runs: --verify, --wpfw, ' | 430 help='runs: --verify, --wpfw, ' |
| 431 '--create_report, --upload_report, --prepare_wipe') | 431 '--create_report, --upload_report, --prepare_wipe') |
| 432 return parser | 432 return parser |
| 433 | 433 |
| 434 | 434 |
| 435 ######################################################################## | 435 ######################################################################## |
| 436 # main entry | 436 # main entry |
| 437 | 437 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 return_value = 1 | 477 return_value = 1 |
| 478 executed_commands = executed_commands + 1 | 478 executed_commands = executed_commands + 1 |
| 479 | 479 |
| 480 if executed_commands == 0: | 480 if executed_commands == 0: |
| 481 parser.print_help() | 481 parser.print_help() |
| 482 return return_value | 482 return return_value |
| 483 | 483 |
| 484 | 484 |
| 485 if __name__ == '__main__': | 485 if __name__ == '__main__': |
| 486 sys.exit(_main()) | 486 sys.exit(_main()) |
| OLD | NEW |