CHROMIUM: dm-verity: add a chromeos-specific error target
Adds a "cros" error target that will write DMVERROR to the first 8
bytes of the partition preceding the configured target (e.g., /dev/sda3-/dev/sda2)
if it contains CHROMEOS already. If the error is non-terminal (ENOMEM, transient I/O
failure, etc) it will just panic.
If failure to read/write to the kernel partition occurs, it will trigger a
reboot-to-recovery.
TEST=built a recovery kernel and make a dev_shim to boot to a shell. From there I setup a dm-verity device fro the sda3 on the installed system. I gave it an invalid root hash. I then mounted the dm-0 device which triggered a failure during validation. It properly invalidated the kernel partition.
BUG=chromium-os:8442
Change-Id: I6aa095b976a20ab444fb7b1188fe9e2d55403b39
Signed-off-by: Will Drewry <wad@chromium.org>
Review URL: http://codereview.chromium.org/
4430004
(copied from kernel.git)
Review URL: http://codereview.chromium.org/
6147002