2/3 Allow devserver RPC to use arbitrary payload file for update.
This add support for the payload_filename to the cros_au RPC and transports it
to chromite/lib/auto_updater.py.
BUG=chromium:709710
TEST=autoupdate_EndToEndTest
Change-Id: I22657038f57d84ba46c65388d5fe3c21759ab72a
Reviewed-on: https://chromium-review.googlesource.com/471882
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: David Haddock <dhaddock@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
diff --git a/cros_update.py b/cros_update.py
index 5d4475a..5645458 100644
--- a/cros_update.py
+++ b/cros_update.py
@@ -93,6 +93,9 @@
dest='original_build', default='',
help=('force stateful update with the same '
'version of previous rootfs partition'))
+ self.parser.add_argument('--payload_filename', action='store', type=str,
+ dest='payload_filename', default='',
+ help='A custom payload filename')
def ParseArgs(self):
"""Parse and process command line arguments."""
@@ -117,7 +120,7 @@
"""
def __init__(self, host_name, build_name, static_dir, progress_tracker=None,
log_file=None, au_tempdir=None, force_update=False,
- full_update=False, original_build=None):
+ full_update=False, original_build=None, payload_filename=None):
self.host_name = host_name
self.build_name = build_name
self.static_dir = static_dir
@@ -127,6 +130,7 @@
self.force_update = force_update
self.full_update = full_update
self.original_build = original_build
+ self.payload_filename = payload_filename
def _WriteAUStatus(self, content):
if self.progress_tracker:
@@ -200,7 +204,8 @@
tempdir=self.au_tempdir,
log_file=self.log_file,
original_payload_dir=original_payload_dir,
- yes=True)
+ yes=True,
+ payload_filename=self.payload_filename)
chromeos_AU.CheckPayloads()
version_match = chromeos_AU.PreSetupCrOSUpdate()
@@ -299,7 +304,8 @@
au_tempdir=au_tempdir,
force_update=options.force_update,
full_update=options.full_update,
- original_build=options.original_build)
+ original_build=options.original_build,
+ payload_filename=options.payload_filename)
# Set timeout the cros-update process.
try: