From 0d62e6a7338d8f25727f56ca14236954fc8f2cef Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 10 Jul 2007 17:53:54 +0200 Subject: UBI-utils: add compare feature This is a new feature for pfiflash, called "--compare". It allows the user to simulate a pfiflash session without actually changing the flash content. If the flash content is equal to the data in the pfif file, pfiflash returns zero. A positive value is returned when the flash content differs from the pfi file, which indicates that an update is necessary. This feature is useful when a controller mounts an NFS share during boot and has to determine if a pfi file stored on this share contains a code update. Modified PDD values are also registered by the compare feature. Signed-off-by: Alexander Schmidt --- ubi-utils/src/bootenv.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ubi-utils/src/bootenv.h') diff --git a/ubi-utils/src/bootenv.h b/ubi-utils/src/bootenv.h index 9003d70..8fecdbf 100644 --- a/ubi-utils/src/bootenv.h +++ b/ubi-utils/src/bootenv.h @@ -267,6 +267,16 @@ int bootenv_write_crc(FILE* fp, bootenv_t env, uint32_t* ret_crc); */ int bootenv_write_txt(FILE* fp, bootenv_t env); +/** + * @brief Compare bootenvs using memcmp(). + * @param first First bootenv. + * @param second Second bootenv. + * @return 0 if bootenvs are equal + * @return < 0 if error + * @return > 0 if unequal + */ +int bootenv_compare(bootenv_t first, bootenv_t second); + /** * @brief Prototype for a PDD handling funtion */ -- cgit v1.2.3