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

Unified Diff: autoupdate.py

Issue 4106009: Add vm flag to the devserver to not patch the kernel. (Closed) Base URL: http://git.chromium.org/git/dev-util.git
Patch Set: ws Created 10 years, 2 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 | devserver.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: autoupdate.py
diff --git a/autoupdate.py b/autoupdate.py
index bca62e1f7c4b1b9209d37974c370d37b9934b67b..1618760cdd34406d9bdaf711b73514da6ab2ea19 100644
--- a/autoupdate.py
+++ b/autoupdate.py
@@ -31,7 +31,8 @@ class Autoupdate(BuildObject):
def __init__(self, serve_only=None, test_image=False, urlbase=None,
factory_config_path=None, client_prefix=None, forced_image=None,
- use_cached=False, port=8080, src_image='', *args, **kwargs):
+ use_cached=False, port=8080, src_image='', vm=False, *args,
+ **kwargs):
super(Autoupdate, self).__init__(*args, **kwargs)
self.serve_only = serve_only
self.factory_config = factory_config_path
@@ -45,6 +46,7 @@ class Autoupdate(BuildObject):
self.forced_image = forced_image
self.use_cached = use_cached
self.src_image = src_image
+ self.vm = vm
def _GetSecondsSinceMidnight(self):
"""Returns the seconds since midnight as a decimal value."""
@@ -218,13 +220,18 @@ class Autoupdate(BuildObject):
"""
image_dir = os.path.dirname(image_path)
update_path = os.path.join(image_dir, 'update.gz')
+ patch_kernel_flag = '--patch_kernel'
_LogMessage('Generating update image %s' % update_path)
+ # Don't patch the kernel for vm images as they don't need the patch.
+ if self.vm:
+ patch_kernel_flag = ''
+
mkupdate_command = (
'%s/cros_generate_update_payload --image="%s" --output="%s" '
- '--patch_kernel --noold_style --src_image="%s"' % (
- self.scripts_dir, image_path,
- update_path, self.src_image))
+ '%s --noold_style --src_image="%s"' % (
+ self.scripts_dir, image_path, update_path, patch_kernel_flag,
+ self.src_image))
_LogMessage(mkupdate_command)
if os.system(mkupdate_command) != 0:
_LogMessage('Failed to create base update file')
« no previous file with comments | « no previous file | devserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698