Crossystem should return at-boot switch positions from VbSharedData

This is more reliable than reading them through FDT/ACPI, since it reflects
the positions as shown to verified boot code.

Notes:
1. This affects ALL platforms with virtual dev switches (x86 AND arm)
2. The fix should have no effect on older platforms, but I haven't tested those.

BUG=chrome-os-partner:11805
TEST=manual

1. boot in normal mode.

devsw_boot             = 0                              # Developer switch position at boot
recovery_reason        = 0                              # Recovery mode reason for current boot
recoverysw_boot        = 0                              # Recovery switch position at boot
wpsw_boot              = 1                              # Firmware write protect hardware switch position at boot

2. boot in developer mode.

localhost ~ # crossystem
devsw_boot             = 1                              # Developer switch position at boot
recovery_reason        = 0                              # Recovery mode reason for current boot
recoverysw_boot        = 0                              # Recovery switch position at boot
wpsw_boot              = 1                              # Firmware write protect hardware switch position at boot

3. boot in developer-recovery mode using keyboard combo.

devsw_boot             = 1                              # Developer switch position at boot
recovery_reason        = 2                              # Recovery mode reason for current boot
recoverysw_boot        = 1                              # Recovery switch position at boot
wpsw_boot              = 1                              # Firmware write protect hardware switch position at boot

4. disable WP and reboot.  wpsw_boot should be 0.

Original-Change-Id: If4156b5e14c6923c5b331c7e5feaabbffe1dad37
(cherry picked from commit da8d32dc8d0fb5ebcfffa305f4a3ecb2dd7c79ac)

Change-Id: I6b80c4f507ebbb9accb75ad6b21b0b5bd963921a
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29320
5 files changed