diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-03-27 10:14:38 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-03-31 13:57:57 +0200 |
commit | d6ba51fa929d9166ba8038dea02f1ccea20d15cd (patch) | |
tree | 6cdf637bc542201b7f3ddf09080928f917b99e15 /src/barebox-state/backend_storage.c | |
parent | b8b5e7b00247eeeb8e09e98c8360c8440067a095 (diff) | |
download | dt-utils-d6ba51fa929d9166ba8038dea02f1ccea20d15cd.tar.gz dt-utils-d6ba51fa929d9166ba8038dea02f1ccea20d15cd.tar.xz |
state: Allow to load without authentification
Sometimes it's useful to be able to load a state even when it
can't be authentificated. Add an option for this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'src/barebox-state/backend_storage.c')
-rw-r--r-- | src/barebox-state/backend_storage.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/barebox-state/backend_storage.c b/src/barebox-state/backend_storage.c index 2edc755..53fe829 100644 --- a/src/barebox-state/backend_storage.c +++ b/src/barebox-state/backend_storage.c @@ -128,6 +128,7 @@ refresh: * @param magic state magic value * @param buf The newly allocated data area will be stored in this pointer * @param len The resulting length of the buffer + * @param flags flags controlling how to load state * @return 0 on success, -errno otherwise. buf and len will be set to valid * values on success. * @@ -138,7 +139,8 @@ refresh: */ int state_storage_read(struct state_backend_storage *storage, struct state_backend_format *format, - uint32_t magic, void **buf, ssize_t *len) + uint32_t magic, void **buf, ssize_t *len, + enum state_flags flags) { struct state_backend_storage_bucket *bucket, *bucket_used = NULL; int ret; @@ -158,7 +160,7 @@ int state_storage_read(struct state_backend_storage *storage, * Verify the buffer crcs. The buffer length is passed in the len argument, * .verify overwrites it with the length actually used. */ - ret = format->verify(format, magic, bucket->buf, &bucket->len); + ret = format->verify(format, magic, bucket->buf, &bucket->len, flags); if (!ret && !bucket_used) bucket_used = bucket; } |