OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/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 '''Test utility for verifying ChromeOS firmware.''' | 6 '''Test utility for verifying ChromeOS firmware.''' |
7 | 7 |
8 import datetime | 8 import datetime |
9 import functools | 9 import functools |
10 import getopt | 10 import getopt |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 continue # ignore line breaks | 791 continue # ignore line breaks |
792 if not CHROS_IF.exec_exists(prog): | 792 if not CHROS_IF.exec_exists(prog): |
793 missing_execs.append(prog) | 793 missing_execs.append(prog) |
794 if missing_execs: | 794 if missing_execs: |
795 usage('Program(s) %s not found in PATH' % ' '.join(missing_execs), 1) | 795 usage('Program(s) %s not found in PATH' % ' '.join(missing_execs), 1) |
796 | 796 |
797 if 'image_file' not in opt_dictionary: | 797 if 'image_file' not in opt_dictionary: |
798 usage(retv=1) | 798 usage(retv=1) |
799 | 799 |
800 FST.init_fw_test(opt_dictionary, CHROS_IF) | 800 FST.init_fw_test(opt_dictionary, CHROS_IF) |
| 801 |
| 802 if not FLASHROM_HANDLER.firmware_sections_equal(): |
| 803 # This is a temporary measure needed to address the fact that the |
| 804 # development BIOS image is built with 'normal' firmware in section B |
| 805 # and 'development' firmware in section A. SAFT operation requires |
| 806 # 'normal' flavor in both sections. Note that this fix does not affect |
| 807 # the file of the new image, only the flashrom contents. |
| 808 CHROS_IF.log('modify firmware A to match B') |
| 809 FLASHROM_HANDLER.copy_from_to('b', 'a') |
801 CHROS_IF.log('program the new image') | 810 CHROS_IF.log('program the new image') |
802 FLASHROM_HANDLER.write_whole() | 811 FLASHROM_HANDLER.write_whole() |
803 CHROS_IF.log('restart') | 812 CHROS_IF.log('restart') |
804 CHROS_IF.run_shell_command('reboot') | 813 CHROS_IF.run_shell_command('reboot') |
805 return 0 | 814 return 0 |
806 | 815 |
807 | 816 |
808 if __name__ == '__main__': | 817 if __name__ == '__main__': |
809 try: | 818 try: |
810 main(sys.argv) | 819 main(sys.argv) |
811 except (getopt.GetoptError, ImportError): | 820 except (getopt.GetoptError, ImportError): |
812 usage(sys.exc_info()[1], 1) | 821 usage(sys.exc_info()[1], 1) |
813 except (FwError, flashrom_handler.FlashromHandlerError): | 822 except (FwError, flashrom_handler.FlashromHandlerError): |
814 MSG = 'Error: %s' % str(sys.exc_info()[1]) | 823 MSG = 'Error: %s' % str(sys.exc_info()[1]) |
815 print MSG | 824 print MSG |
816 CHROS_IF.log(MSG) | 825 CHROS_IF.log(MSG) |
817 sys.exit(1) | 826 sys.exit(1) |
818 | 827 |
819 sys.exit(0) | 828 sys.exit(0) |
OLD | NEW |