factory_install: ensure main(BIOS) and EC write protection status are consistent

In factory setup / RMA stage with "WP enabled", we must ensure Main(BIOS)/EC WP
status are consist otherwise chromeos-firmwareupdate would fail.

BUG=chrome-os-partner:5851
TEST=(1) disable hardware write protection switch
     (2) sudo flashrom --wp-enable -p internal:bus=lpc
         sudo flashrom --wp-disable -p internal:bus=spi
     (3) enable hardware write protection switch
     (4) start factory installer
     Factory installer stopped with error message:
     ERROR: Inconsist firmware write protection status: main=enabled, ec=disabled.
            Please disable Hardware Write Protection and restart again.

Change-Id: Ia08721f657c558c72b80dca4915beb5150e20d6d
Reviewed-on: http://gerrit.chromium.org/gerrit/7253
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
1 file changed