From f71a545ce9bd0835ddd2382f4553fcdc2407d72b Mon Sep 17 00:00:00 2001 From: Daniel Palmer Date: Tue, 20 May 2014 16:33:41 +0900 Subject: - Fix the mhash cmake file for Debian/armhf - Proposed single line solution to handle flash struct changes --- cmake/FindMhash.cmake | 1 + flash.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/cmake/FindMhash.cmake b/cmake/FindMhash.cmake index eeeab3f..ab088cf 100644 --- a/cmake/FindMhash.cmake +++ b/cmake/FindMhash.cmake @@ -19,6 +19,7 @@ FIND_LIBRARY(MHASH_LIBRARY_PATH /usr/local/lib /sw/lib /opt/local/lib + /usr/lib/arm-linux-gnueabihf/ NO_DEFAULT_PATH) IF(MHASH_INCLUDE_PATH) diff --git a/flash.c b/flash.c index 0e05caa..70286d6 100644 --- a/flash.c +++ b/flash.c @@ -306,6 +306,13 @@ hdrlengthok: static int readUserBlock(FlashStruct *mem) { + // put the default values into the the struct; + // what should happen here is that if we load + // a smaller struct from disk it will replace + // the top part and leave the defaults for newly + // added values at the end + initFlashValues(mem); + // try to unfreeze the main file if (persistence_unfreeze(MAINFILE, mem, sizeof(*mem), 0)) { return sizeof(*mem); -- cgit