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

Side by Side Diff: client/cros/flashrom_util.py

Issue 6623026: Refactor site_fmap, flashrom_utils and gbb_utils module into client/cros. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | client/cros/fmap.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 """ 6 """
7 This module provides convenience routines to access Flash ROM (EEPROM). 7 This module provides convenience routines to access Flash ROM (EEPROM).
8 - flashrom_util is a low level wrapper of flashrom(8) program. 8 - flashrom_util is a low level wrapper of flashrom(8) program.
9 - FlashromUtility is a high level object which provides more advanced 9 - FlashromUtility is a high level object which provides more advanced
10 features like journaling-alike (log-based) changing. 10 features like journaling-alike (log-based) changing.
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 """ 245 """
246 (Utility) Uses fmap_decode to retrieve embedded layout of a prepared 246 (Utility) Uses fmap_decode to retrieve embedded layout of a prepared
247 firmware image. 247 firmware image.
248 Args: 248 Args:
249 conversion_map: dictionary for FMAP area name conversion 249 conversion_map: dictionary for FMAP area name conversion
250 image_blob: binary data of firmware image containing FMAP 250 image_blob: binary data of firmware image containing FMAP
251 251
252 Returns: layout structure for flashrom_util, or empty for failure. 252 Returns: layout structure for flashrom_util, or empty for failure.
253 """ 253 """
254 try: 254 try:
255 import site_fmap 255 import fmap
256 fmap_object = site_fmap.fmap_decode(image_blob)['areas'] 256 fmap_object = fmap.fmap_decode(image_blob)['areas']
257 except: 257 except:
258 # print 'decode_fmap_layout: failed to decode from image blob' 258 # print 'decode_fmap_layout: failed to decode from image blob'
259 fmap_object = [] 259 fmap_object = []
260 return _convert_fmap_layout(conversion_map, fmap_object) 260 return _convert_fmap_layout(conversion_map, fmap_object)
261 261
262 262
263 def csv_to_list(csv, delimiter=','): 263 def csv_to_list(csv, delimiter=','):
264 """ 264 """
265 (Utility) Converts a comma-separated-value (or list) to a list. 265 (Utility) Converts a comma-separated-value (or list) to a list.
266 266
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 except ImportError: 1048 except ImportError:
1049 # print 'using mocks' 1049 # print 'using mocks'
1050 utils = mock_utils() 1050 utils = mock_utils()
1051 TestError = mock_TestError 1051 TestError = mock_TestError
1052 1052
1053 1053
1054 # main stub 1054 # main stub
1055 if __name__ == "__main__": 1055 if __name__ == "__main__":
1056 # TODO(hungte) provide unit tests or command line usage 1056 # TODO(hungte) provide unit tests or command line usage
1057 pass 1057 pass
OLDNEW
« no previous file with comments | « no previous file | client/cros/fmap.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698