summaryrefslogtreecommitdiff
path: root/board/CZ.NIC/turris_mox/turris_mox.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/CZ.NIC/turris_mox/turris_mox.c')
-rw-r--r--board/CZ.NIC/turris_mox/turris_mox.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c
index 44c272c7cb..428cd23a19 100644
--- a/board/CZ.NIC/turris_mox/turris_mox.c
+++ b/board/CZ.NIC/turris_mox/turris_mox.c
@@ -440,10 +440,18 @@ static bool read_reset_button(void)
static void handle_reset_button(void)
{
+ const char * const vars[1] = { "bootcmd_rescue", };
+
+ /*
+ * Ensure that bootcmd_rescue has always stock value, so that running
+ * run bootcmd_rescue
+ * always works correctly.
+ */
+ env_set_default_vars(1, (char * const *)vars, 0);
+
if (read_reset_button()) {
- const char * const vars[3] = {
+ const char * const vars[2] = {
"bootcmd",
- "bootcmd_rescue",
"distro_bootcmd",
};
@@ -451,7 +459,7 @@ static void handle_reset_button(void)
* Set the above envs to their default values, in case the user
* managed to break them.
*/
- env_set_default_vars(3, (char * const *)vars, 0);
+ env_set_default_vars(2, (char * const *)vars, 0);
/* Ensure bootcmd_rescue is used by distroboot */
env_set("boot_targets", "rescue");