futility: updater: always set new boot/try cookies

If the update target is same as the active image, the firmware updater
will do nothing on vboot2. However, if the system already have
fw_try_next set to other slot (for example after multiple updates
applied without rebooting) then the next boot will not pick the right
firmware. So we have to ensure fw_try_next is set to right value.
In the meantime, if fw_try_count and fw_result are not configured at the
same time, the system may start "trying" again and increase the chance
to fail.

To fix that, we should clear trial cookies when there is no update, just
like chromeos-setgoodfirmware.

BUG=b:162866548
TEST=make runtests
BRANCH=None

Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Change-Id: I41ecac445000a850d050d77f0f694ee431926424
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2340172
Reviewed-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
1 file changed