From 1d4e02d8bab3f0aff945dcb6a3d828af53472b64 Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Wed, 22 Aug 2018 22:29:27 +0800 Subject: futility: cmd_update: Add vboot1 updater logic There are still many devices running vboot1 and we need to support them as well. There is no way to determine if a firmware is vboot2 or not, so we can only rely on the system property "fw_vboot2". If fw_vboot2 is 0, then we should always update section B and compare content with section A. BUG=chromium:875551 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: Iefdcb81099914c2183c627a33eb73678d1269bc1 Signed-off-by: Hung-Te Lin Reviewed-on: https://chromium-review.googlesource.com/1184952 Reviewed-by: Randall Spangler --- tests/futility/test_update.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'tests/futility') diff --git a/tests/futility/test_update.sh b/tests/futility/test_update.sh index bc2a2ec9..3093e25d 100755 --- a/tests/futility/test_update.sh +++ b/tests/futility/test_update.sh @@ -79,7 +79,7 @@ test_update() { cmp "${TMP}.emu" "${expected}" } -# --sys_props: mainfw_act, [wp_hw, wp_sw] +# --sys_props: mainfw_act, is_vboot2, [wp_hw, wp_sw] # Test Full update. test_update "Full update" \ @@ -94,12 +94,21 @@ test_update "RW update" \ # Test Try-RW update (vboot2). test_update "RW update (A->B)" \ "${FROM_IMAGE}" "${TMP}.expected.b" \ - -i "${TO_IMAGE}" -t --wp=1 --sys_props 0 + -i "${TO_IMAGE}" -t --wp=1 --sys_props 0,1 test_update "RW update (B->A)" \ "${FROM_IMAGE}" "${TMP}.expected.a" \ - -i "${TO_IMAGE}" -t --wp=1 --sys_props 1 + -i "${TO_IMAGE}" -t --wp=1 --sys_props 1,1 test_update "RW update -> fallback to RO+RW Full update" \ "${FROM_IMAGE}" "${TMP}.expected.full" \ - -i "${TO_IMAGE}" -t --wp=0 --sys_props 1 + -i "${TO_IMAGE}" -t --wp=0 --sys_props 1,1 + +# Test Try-RW update (vboot1). +test_update "RW update (vboot1, A->B)" \ + "${FROM_IMAGE}" "${TMP}.expected.b" \ + -i "${TO_IMAGE}" -t --wp=1 --sys_props 0,0 + +test_update "RW update (vboot1, B->B)" \ + "${FROM_IMAGE}" "${TMP}.expected.b" \ + -i "${TO_IMAGE}" -t --wp=1 --sys_props 1,0 -- cgit v1.2.1