Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(860)

Unified Diff: src/platform/dev/autoupdate.py

Issue 2131015: Add more images support for system and EC firmware. (Closed) Base URL: ssh://git@chromiumos-git/chromiumos
Patch Set: self-documenting code Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/dev/autoupdate.py
diff --git a/src/platform/dev/autoupdate.py b/src/platform/dev/autoupdate.py
index 6c5dfbc6e11d60d60e7c29590da1df54e6f0b2ef..0dd296c12d7fd181284d33dfb3ae7b4a138b2246 100644
--- a/src/platform/dev/autoupdate.py
+++ b/src/platform/dev/autoupdate.py
@@ -194,7 +194,11 @@ class Autoupdate(BuildObject):
'oempartitionimg_image': 'generic-oem.gz',
'oempartitionimg_checksum': 'AtiI8B64agHVN+yeBAyiNMX3+HM=',
'stateimg_image': 'generic-state.gz',
- 'stateimg_checksum': 'AtiI8B64agHVN+yeBAyiNMX3+HM='
+ 'stateimg_checksum': 'AtiI8B64agHVN+yeBAyiNMX3+HM=',
+ 'systemrom_image': 'generic-systemrom.gz',
+ 'systemrom_checksum': 'AtiI8B64agHVN+yeBAyiNMX3+HM=',
+ 'ecrom_image': 'generic-ecrom.gz',
+ 'ecrom_checksum': 'AtiI8B64agHVN+yeBAyiNMX3+HM=',
},
{
'qual_ids': set([6]),
@@ -205,7 +209,11 @@ class Autoupdate(BuildObject):
'oempartitionimg_image': '6-oem.gz',
'oempartitionimg_checksum': 'AtiI8B64agHVN+yeBAyiNMX3+HM=',
'stateimg_image': '6-state.gz',
- 'stateimg_checksum': 'AtiI8B64agHVN+yeBAyiNMX3+HM='
+ 'stateimg_checksum': 'AtiI8B64agHVN+yeBAyiNMX3+HM=',
+ 'systemrom_image': '6-systemrom.gz',
+ 'systemrom_checksum': 'AtiI8B64agHVN+yeBAyiNMX3+HM=',
+ 'ecrom_image': '6-ecrom.gz',
+ 'ecrom_checksum': 'AtiI8B64agHVN+yeBAyiNMX3+HM=',
},
]
The server will look for the files by name in the static files
@@ -220,18 +228,21 @@ class Autoupdate(BuildObject):
self.factory_config = output['config']
success = True
for stanza in self.factory_config:
- for kind in ('factory', 'oempartitionimg', 'release', 'stateimg'):
- stanza[kind + '_size'] = \
- os.path.getsize(self.static_dir + '/' + stanza[kind + '_image'])
- if validate_checksums:
- factory_checksum = self.GetHash(self.static_dir + '/' +
- stanza[kind + '_image'])
- if factory_checksum != stanza[kind + '_checksum']:
- print 'Error: checksum mismatch for %s. Expected "%s" but file ' \
- 'has checksum "%s".' % (stanza[kind + '_image'],
- stanza[kind + '_checksum'],
- factory_checksum)
- success = False
+ for key in stanza.copy().iterkeys():
+ suffix = '_image'
+ if key.endswith(suffix):
+ kind = key[:-len(suffix)]
+ stanza[kind + '_size'] = \
+ os.path.getsize(self.static_dir + '/' + stanza[kind + '_image'])
+ if validate_checksums:
+ factory_checksum = self.GetHash(self.static_dir + '/' +
+ stanza[kind + '_image'])
+ if factory_checksum != stanza[kind + '_checksum']:
+ print 'Error: checksum mismatch for %s. Expected "%s" but file ' \
+ 'has checksum "%s".' % (stanza[kind + '_image'],
+ stanza[kind + '_checksum'],
+ factory_checksum)
+ success = False
if validate_checksums:
if success is False:
raise Exception('Checksum mismatch in conf file.')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698