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

Side by Side Diff: autoupdate.py

Issue 6542009: devserver: start using payload scripts bundled with devserver (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/dev-util.git@master
Patch Set: Nits Created 9 years, 10 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 | buildutil.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 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from buildutil import BuildObject 5 from buildutil import BuildObject
6 from xml.dom import minidom 6 from xml.dom import minidom
7 7
8 import cherrypy 8 import cherrypy
9 import os 9 import os
10 import shutil 10 import shutil
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 Args: 237 Args:
238 image_path: Full path to image. 238 image_path: Full path to image.
239 Returns: 239 Returns:
240 Path to created update_payload or None on error. 240 Path to created update_payload or None on error.
241 """ 241 """
242 update_path = os.path.join(output_dir, UPDATE_FILE) 242 update_path = os.path.join(output_dir, UPDATE_FILE)
243 _LogMessage('Generating update image %s' % update_path) 243 _LogMessage('Generating update image %s' % update_path)
244 244
245 update_command = [ 245 update_command = [
246 '%s/cros_generate_update_payload' % self.scripts_dir, 246 '%s/cros_generate_update_payload' % self.devserver_dir,
247 '--image="%s"' % image_path, 247 '--image="%s"' % image_path,
248 '--output="%s"' % update_path, 248 '--output="%s"' % update_path,
249 '--noold_style', 249 '--noold_style',
250 ] 250 ]
251 251
252 if src_image: update_command.append('--src_image="%s"' % src_image) 252 if src_image: update_command.append('--src_image="%s"' % src_image)
253 if not self.vm: update_command.append('--patch_kernel') 253 if not self.vm: update_command.append('--patch_kernel')
254 if self.private_key: update_command.append('--private_key="%s"' % 254 if self.private_key: update_command.append('--private_key="%s"' %
255 self.private_key) 255 self.private_key)
256 256
(...skipping 11 matching lines...) Expand all
268 Args: 268 Args:
269 image_path: Full path to image. 269 image_path: Full path to image.
270 Returns: 270 Returns:
271 Path to created stateful update_payload or None on error. 271 Path to created stateful update_payload or None on error.
272 Raises: 272 Raises:
273 A subprocess exception if the update generator fails to generate a 273 A subprocess exception if the update generator fails to generate a
274 stateful payload. 274 stateful payload.
275 """ 275 """
276 output_gz = os.path.join(output_dir, STATEFUL_FILE) 276 output_gz = os.path.join(output_dir, STATEFUL_FILE)
277 subprocess.check_call( 277 subprocess.check_call(
278 ['%s/cros_generate_stateful_update_payload' % self.scripts_dir, 278 ['%s/cros_generate_stateful_update_payload' % self.devserver_dir,
279 '--image=%s' % image_path, 279 '--image=%s' % image_path,
280 '--output_dir=%s' % output_dir, 280 '--output_dir=%s' % output_dir,
281 ]) 281 ])
282 return STATEFUL_FILE 282 return STATEFUL_FILE
283 283
284 def FindCachedUpdateImageSubDir(self, src_image, dest_image): 284 def FindCachedUpdateImageSubDir(self, src_image, dest_image):
285 """Find directory to store a cached update. 285 """Find directory to store a cached update.
286 286
287 Given one, or two images for an update, this finds which 287 Given one, or two images for an update, this finds which
288 cache directory should hold the update files, even if they don't exist 288 cache directory should hold the update files, even if they don't exist
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 is_delta_format = self._IsDeltaFormatFile(filename) 661 is_delta_format = self._IsDeltaFormatFile(filename)
662 if label: 662 if label:
663 url = '%s/%s/%s' % (static_urlbase, label, payload_path) 663 url = '%s/%s/%s' % (static_urlbase, label, payload_path)
664 else: 664 else:
665 url = '%s/%s' % (static_urlbase, payload_path) 665 url = '%s/%s' % (static_urlbase, payload_path)
666 666
667 _LogMessage('Responding to client to use url %s to get image.' % url) 667 _LogMessage('Responding to client to use url %s to get image.' % url)
668 return self.GetUpdatePayload(hash, sha256, size, url, is_delta_format) 668 return self.GetUpdatePayload(hash, sha256, size, url, is_delta_format)
669 else: 669 else:
670 return self.GetNoUpdatePayload() 670 return self.GetNoUpdatePayload()
OLDNEW
« no previous file with comments | « no previous file | buildutil.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698