summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--host/arch/x86/lib/crossystem_arch.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/host/arch/x86/lib/crossystem_arch.c b/host/arch/x86/lib/crossystem_arch.c
index c885986b..f9ce01f6 100644
--- a/host/arch/x86/lib/crossystem_arch.c
+++ b/host/arch/x86/lib/crossystem_arch.c
@@ -18,6 +18,7 @@
#include "crossystem.h"
#include "crossystem_arch.h"
+#include "crossystem_vbnv.h"
#include "host_common.h"
#include "utility.h"
#include "vboot_common.h"
@@ -171,6 +172,7 @@ int VbReadNvStorage(VbNvContext* vnc) {
int VbWriteNvStorage(VbNvContext* vnc) {
unsigned offs, blksz;
+ VbSharedDataHeader *sh = VbSharedDataRead();
if (!vnc->raw_changed)
return 0; /* Nothing changed, so no need to write */
@@ -186,6 +188,10 @@ int VbWriteNvStorage(VbNvContext* vnc) {
if (0 != VbCmosWrite(offs, VBNV_BLOCK_SIZE, vnc->raw))
return -1;
+ /* Also attempt to write using mosys if using vboot2 */
+ if (sh && (sh->flags & VBSD_BOOT_FIRMWARE_VBOOT2))
+ VbWriteNvStorage_mosys(vnc);
+
return 0;
}