cros_generate_update_payload: Switch update_engine to major version 2
Per this change, we switch the update payload generation on the server side to
major version 2. This new version includes smaller payloads (5%-10%) and has the
capability to install multiple partitions (in comparison to a fixed two, kernel
and root.) This affects all boards. For more information about the client
support and the needed stepping stone refer to the attached issue.
BUG=chromium:794404
TEST=cros flash
TEST=paygen release builders tryjob
Change-Id: I9e4cc9391fd0c5d5720e980f450882d9385c7061
Reviewed-on: https://chromium-review.googlesource.com/1234822
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/scripts/cros_generate_update_payload_unittest.py b/scripts/cros_generate_update_payload_unittest.py
index ddcb6c9..dd60302 100644
--- a/scripts/cros_generate_update_payload_unittest.py
+++ b/scripts/cros_generate_update_payload_unittest.py
@@ -8,6 +8,7 @@
from __future__ import print_function
import os
+import tempfile
from chromite.lib import cros_build_lib
from chromite.lib import cros_test_lib
@@ -110,6 +111,8 @@
}
self.PatchObject(cros_build_lib, 'GetImageDiskPartitionInfo',
return_value=fake_partitions)
+ self.PatchObject(tempfile, 'NamedTemporaryFile',
+ return_value=type('file', (object,), {'name': temp}))
cros_generate_update_payload.main([
'--image', '/dev/null',
'--src_image', '/dev/null',
@@ -117,10 +120,10 @@
])
self.assertCommandContains([
- '--major_version=1',
- '--new_image=' + temp,
- '--new_kernel=' + temp,
- '--old_image=' + temp,
- '--old_kernel=' + temp,
+ '--major_version=2',
+ '--partition_names=root:kernel',
+ '--new_partitions=' + ':'.join([temp, temp]),
+ '--new_postinstall_config_file=' + temp,
+ '--old_partitions=' + ':'.join([temp, temp]),
'--rootfs_partition_size=4',
])