Set retry count partition flag to 0 for slot B's kernel partition

When we create an image, we set the retry count for kernel partitions
of both slots A and B to 15 as a result, both are treated as
"bootable". Even though slot B doesn't have a valid data in the image,
after running chromeos-install, the content of slot A is copied to
both A & B, so we should maintain the slot B as bootable.

Having slot B bootable when booting from USB however (where slot B
doesn't have valid partition content) outright fools rollback
mechanism, since the partition is presented as bootable, but
the boot attempt will later fail.

The solution is to make sure we mark the secondary partion as not
bootable when creating the 'non-base' disk image.

BUG=chromium:365628, chromium:368844
TEST=Created a test image, inspected the partition table flags.
     Booted from USB and chromeos-install-ed it and verified the
     boot operation and partition flags.

Change-Id: I06ae062d39618d7dc72c0ff2b133d28b84eb0266
Reviewed-on: https://chromium-review.googlesource.com/198011
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
1 file changed