diff --git a/src/barebox-state.c b/src/barebox-state.c index 5399209..4bd77cf 100644 --- a/src/barebox-state.c +++ b/src/barebox-state.c @@ -308,7 +308,7 @@ } -struct state *state_get(const char *name, bool readonly) +struct state *state_get(const char *name, bool readonly, bool auth) { struct device_node *root, *node, *partition_node; char *path; @@ -368,7 +368,11 @@ return ERR_CAST(state); } - ret = state_load(state); + if (auth) + ret = state_load(state); + else + ret = state_load_no_auth(state); + if (ret) pr_err("Failed to load persistent state, continuing with defaults, %d\n", ret); @@ -433,12 +437,13 @@ int nr_states = 0; bool readonly = true; int pr_level = 5; + int auth = 1; INIT_LIST_HEAD(&sg_list); INIT_LIST_HEAD(&state_list.list); while (1) { - c = getopt_long(argc, argv, "hg:s:dvn:q", long_options, &option_index); + c = getopt_long(argc, argv, "hg:s:dvn:qf", long_options, &option_index); if (c < 0) break; switch (c) { @@ -458,6 +463,9 @@ list_add_tail(&sg->list, &sg_list); readonly = false; break; + case 'f': + auth = 0; + break; case 'd': do_dump = 1; break; diff --git a/src/barebox-state.h b/src/barebox-state.h index 00c758f..bd89cf4 100644 --- a/src/barebox-state.h +++ b/src/barebox-state.h @@ -1,7 +1,7 @@ #ifndef __BAREBOX_STATE__ #define __BAREBOX_STATE__ -struct state *state_get(const char *name, bool readonly); +struct state *state_get(const char *name, bool readonly, bool auth); char *state_get_var(struct state *state, const char *var); #endif /* __BAREBOX_STATE__ */ diff --git a/src/keystore-blob.c b/src/keystore-blob.c index e3bffb3..028dd8b 100644 --- a/src/keystore-blob.c +++ b/src/keystore-blob.c @@ -30,7 +30,7 @@ if (!state) { struct state *tmp; - tmp = state_get(keystore_state_name, true); + tmp = state_get(keystore_state_name, true, false); if (IS_ERR(tmp)) return PTR_ERR(tmp); state = tmp;