clobber-state: Ensure active kernel still boots after wiping.
When an auto update is in progress, there is a period that system will start
with a kernel without GPT "successful" bit set. If we do wiping (ex, power-wash)
at that time, system may run out of trial counter and fall to recovery mode.
To prevent that, we should always set "successful" bit and set priority to
positive number before wiping inactive partitions.
TEST=manual: cgpt set /dev/sda2 -S 0 -T 3 -P 3; # simulate an AU
cgpt set /dev/sda4 -S 1 -T 0 -P 2; # simulate an AU
cgpt show /dev/sda # see sda2.S=1, still boots.
Tested-by: Hung-Te Lin <email@example.com>
Reviewed-by: Rong Chang <firstname.lastname@example.org>
Commit-Queue: Hung-Te Lin <email@example.com>
1 file changed