avbtool: Use 'restart_on_corruption' when setting up dm-verity. am: a01e32f151 am: f3fa6f8bed
am: afbecb40e6
Change-Id: I18509b04bd6bab0b1700b18bea470746de626775
diff --git a/avbtool b/avbtool
index f467c70..3da0279 100755
--- a/avbtool
+++ b/avbtool
@@ -1815,7 +1815,8 @@
c += ' {}'.format(str(ht.root_digest).encode('hex')) # root_digest
c += ' {}'.format(str(ht.salt).encode('hex')) # salt
if ht.fec_num_roots > 0:
- c += ' 9' # number of optional args
+ c += ' 10' # number of optional args
+ c += ' restart_on_corruption'
c += ' ignore_zero_blocks'
c += ' use_fec_from_device PARTUUID=$(ANDROID_SYSTEM_PARTUUID)'
c += ' fec_roots {}'.format(ht.fec_num_roots)
@@ -1825,7 +1826,8 @@
c += ' fec_blocks {}'.format(ht.fec_offset/ht.data_block_size)
c += ' fec_start {}'.format(ht.fec_offset/ht.data_block_size)
else:
- c += ' 1' # number of optional args
+ c += ' 2' # number of optional args
+ c += ' restart_on_corruption'
c += ' ignore_zero_blocks'
c += '" root=0xfd00'
diff --git a/test/avb_slot_verify_unittest.cc b/test/avb_slot_verify_unittest.cc
index 3969add..51cfb23 100644
--- a/test/avb_slot_verify_unittest.cc
+++ b/test/avb_slot_verify_unittest.cc
@@ -1178,8 +1178,8 @@
" Kernel Cmdline: 'dm=\"1 vroot none ro 1,0 2056 verity "
"1 PARTUUID=$(ANDROID_SYSTEM_PARTUUID) "
"PARTUUID=$(ANDROID_SYSTEM_PARTUUID) 4096 4096 257 257 sha1 "
- "e811611467dcd6e8dc4324e45f706c2bdd51db67 d00df00d 1 "
- "ignore_zero_blocks\" root=0xfd00'\n"
+ "e811611467dcd6e8dc4324e45f706c2bdd51db67 d00df00d 2 "
+ "restart_on_corruption ignore_zero_blocks\" root=0xfd00'\n"
" Kernel Cmdline descriptor:\n"
" Flags: 2\n"
" Kernel Cmdline: "
@@ -1210,13 +1210,14 @@
"dm=\"1 vroot none ro 1,0 2056 verity 1 "
"PARTUUID=1234-fake-guid-for:system_a "
"PARTUUID=1234-fake-guid-for:system_a 4096 4096 257 257 sha1 "
- "e811611467dcd6e8dc4324e45f706c2bdd51db67 d00df00d 1 "
- "ignore_zero_blocks\" root=0xfd00 should_be_in_both=1 "
+ "e811611467dcd6e8dc4324e45f706c2bdd51db67 d00df00d 2 "
+ "restart_on_corruption ignore_zero_blocks\" root=0xfd00 "
+ "should_be_in_both=1 "
"androidboot.vbmeta.device=PARTUUID=1234-fake-guid-for:vbmeta_a "
"androidboot.slot_suffix=_a androidboot.vbmeta.device_state=locked "
"androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.size=1472 "
"androidboot.vbmeta.digest="
- "f16e1bbd141bd57b41057e2051393fffc85538d83722f8d11fc0bf96bd279bb9",
+ "32572f7a89fb44cc76e9e3adbc0cb5272d0604578b2179729aa52d2bba4061c3",
std::string(slot_data->cmdline));
} else {
EXPECT_EQ(
@@ -1225,7 +1226,7 @@
"androidboot.slot_suffix=_a androidboot.vbmeta.device_state=locked "
"androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.size=1472 "
"androidboot.vbmeta.digest="
- "ade42910c6cab6088044e8ad04f52eafa45928184256ff1df0cb0b5da867d6dc",
+ "bb630c27d09e10117092d4444ea57a99bf44101c46cf5424cfb86928a0873249",
std::string(slot_data->cmdline));
}
avb_slot_verify_data_free(slot_data);
diff --git a/test/avbtool_unittest.cc b/test/avbtool_unittest.cc
index 8df453b..273f9ca 100644
--- a/test/avbtool_unittest.cc
+++ b/test/avbtool_unittest.cc
@@ -701,7 +701,7 @@
"VBMeta image version: 1.0\n"
"Header Block: 256 bytes\n"
"Authentication Block: 320 bytes\n"
- "Auxiliary Block: 832 bytes\n"
+ "Auxiliary Block: 896 bytes\n"
"Algorithm: SHA256_RSA2048\n"
"Rollback Index: 0\n"
"Flags: 0\n"
@@ -711,7 +711,7 @@
" Kernel Cmdline: 'dm=\"1 vroot none ro 1,0 2056 verity 1 "
"PARTUUID=$(ANDROID_SYSTEM_PARTUUID) PARTUUID=$(ANDROID_SYSTEM_PARTUUID) "
"4096 4096 257 257 sha1 e811611467dcd6e8dc4324e45f706c2bdd51db67 "
- "d00df00d 1 ignore_zero_blocks\" root=0xfd00'\n"
+ "d00df00d 2 restart_on_corruption ignore_zero_blocks\" root=0xfd00'\n"
" Kernel Cmdline descriptor:\n"
" Flags: 2\n"
" Kernel Cmdline: "
@@ -911,7 +911,8 @@
" Kernel Cmdline: 'dm=\"1 vroot none ro 1,0 2056 verity 1 "
"PARTUUID=$(ANDROID_SYSTEM_PARTUUID) PARTUUID=$(ANDROID_SYSTEM_PARTUUID) "
"4096 4096 257 257 sha1 e811611467dcd6e8dc4324e45f706c2bdd51db67 "
- "d00df00d 9 ignore_zero_blocks use_fec_from_device "
+ "d00df00d 10 restart_on_corruption ignore_zero_blocks "
+ "use_fec_from_device "
"PARTUUID=$(ANDROID_SYSTEM_PARTUUID) fec_roots 2 fec_blocks 261 "
"fec_start 261\" root=0xfd00'\n"
" Kernel Cmdline descriptor:\n"