diff options
author | Leah Rowe <leah@libreboot.org> | 2022-11-26 23:48:01 +0000 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2022-11-26 23:48:01 +0000 |
commit | 0108615f3729408b72c42db02df0e467a132a05b (patch) | |
tree | 716aebacd3045d7d72b656a87105d1515d4eff74 | |
parent | 82300f4f1e3062f005ffb4aad4ca7452f83a4648 (diff) |
nvmutil copy/swap: actually set nvmPartModified
-rw-r--r-- | util/nvmutil/nvmutil.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 35a2bad2..517604f1 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -337,21 +337,29 @@ cmd_swap(void) part0 = validChecksum(0); part1 = validChecksum(1); - if ((gbeFileModified = (part0 | part1))) { + if ((part0 | part1)) { for(part0 = 0; part0 < SIZE_4KB; part0++) { gbe[part0] ^= gbe[part1 = (part0 | SIZE_4KB)]; gbe[part1] ^= gbe[part0]; gbe[part0] ^= gbe[part1]; } + + gbeFileModified = 1; + nvmPartModified[0] = 1; + nvmPartModified[1] = 1; } } void cmd_copy(void) { - if (validChecksum(part)) - memcpy(gbe + ((part ^ (gbeFileModified = 1)) << 12), + if (validChecksum(part)) { + memcpy(gbe + ((part ^ 1) << 12), gbe + (part << 12), SIZE_4KB); + + gbeFileModified = 1; + nvmPartModified[part] = 1; + } } int |