Commit graph

8 commits

Author SHA1 Message Date
Tianjie Xu
17e316cce0 Turn on -Werror for recovery
Also remove the 0xff comparison when validating the bootloader
message fields. As the fields won't be erased to 0xff after we
remove the MTD support.

Bug: 28202046
Test: The recovery folder compiles for aosp_x86-eng
Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab
(cherry picked from commit 7aa88748f6)
2016-09-30 11:18:01 -07:00
Tianjie Xu
c21edd4654 Switch recovery to libbase logging
Clean up the recovery image and switch to libbase logging.

Bug: 28191554
Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
(cherry picked from commit 747781433f)
2016-09-01 14:32:55 -07:00
Tianjie Xu
da654af606 Skip update verification if care_map is not found
Recently flashed devices may not have care_map.txt in /data/ota_package.
This leads to a failure of update-verifier and prevents boot
success flag from being set. So, we need to skip verification
in case the file is not found.

Error message:
... I update_verifier: Started with arg 1: nonencrypted
... I update_verifier: Booting slot 1: isSlotMarkedSuccessful=0
... E update_verifier: Care map /data/ota_package/care_map.txt not found.
... E update_verifier: Failed to verify all blocks in care map file

Bug: 30156449
Change-Id: Ia15f5f3e7ca2ea6981d49678e799b9f70d134faa
2016-07-15 16:30:12 -07:00
Tianjie Xu
4bbe0c93c8 Fix a typo when comparing the verity mode
The veritymode string used by the bootloader should be lowercase 'eio'
instead of 'EIO'. Fix the typo and change to strcasecmp.

Bug: 27175949
Change-Id: I376dacc70eef7364e2b9931a7c940adedcdb1929
2016-07-14 23:57:43 +00:00
Tianjie Xu
03ca853a1c Touch blocks in care_map in update_verifier
Read all blocks in system and vendor partition during boot time
so that dm-verity could verify this partition is properly flashed.

Bug: 27175949
Change-Id: I38ff7b18ee4f2733e639b89633d36f5ed551c989
2016-07-14 14:31:39 -07:00
Tao Bao
612161ef1c update_verifier: Track the API change for isSlotBootable().
[1] added a new API isSlotMarkedSuccessful() to actually query if a
given slot has been marked as successful.

[1]: commit 72c88c915d957bf2eba73950e7f0407b220d1ef4

Change-Id: I9155c9b9233882a295a9a6e607a844d9125e4c56
2015-12-09 14:41:40 -08:00
Tao Bao
740e01e2bd update_verifier: Log to logd instead of kernel log.
logd already gets started before we call update_verifier.

Bug: 26039641
Change-Id: If00669a77bf9a6e5534e33f4e50b42eabba2667a
(cherry picked from commit 45eac58ef1)
2015-12-08 11:24:35 -08:00
Tao Bao
7197ee0e39 Add update_verifier for A/B OTA update.
update_verifier checks the integrity of the updated system and vendor
partitions on the first boot post an A/B OTA update. It marks the
current slot as having booted successfully if it passes the verification.

This CL doesn't perform any actual verification work which will be
addressed in follow-up CLs.

Bug: 26039641
Change-Id: Ia5504ed25b799b48b5886c2fc68073a360127f42
(cherry picked from commit 1171d3a12b)
2015-12-08 11:24:11 -08:00