]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mvebu: turris_{omnia, mox}: Reset bootdelay env for rescue
authorPali Rohár <pali@kernel.org>
Sat, 27 Aug 2022 18:49:20 +0000 (20:49 +0200)
committerStefan Roese <sr@denx.de>
Tue, 13 Sep 2022 04:38:08 +0000 (06:38 +0200)
When rescue mode was activated reset also bootdelay env variable to its
default value. This will ensure that reset button works and starts rescue
mode also in the case when user changed bootdelay env variable to -1 (which
has meaning to not start autoboot).

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
board/CZ.NIC/turris_mox/turris_mox.c
board/CZ.NIC/turris_omnia/turris_omnia.c

index 3dbd68e52366642c0e1716f8c45a64ce0aac7ada..5e1cf328ecc1bd6226e67434fe854db41047bb0b 100644 (file)
@@ -440,8 +440,9 @@ static void handle_reset_button(void)
        env_set_default_vars(1, (char * const *)vars, 0);
 
        if (read_reset_button()) {
-               const char * const vars[2] = {
+               const char * const vars[3] = {
                        "bootcmd",
+                       "bootdelay",
                        "distro_bootcmd",
                };
 
@@ -449,7 +450,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(2, (char * const *)vars, 0);
+               env_set_default_vars(3, (char * const *)vars, 0);
 
                /* Ensure bootcmd_rescue is used by distroboot */
                env_set("boot_targets", "rescue");
index cf8a6026702bafe533b1dab27ee95435882a17e1..a7f96e5b773975b824e9d9ad46141b45263510d9 100644 (file)
@@ -549,8 +549,9 @@ static void handle_reset_button(void)
        env_set_ulong("omnia_reset", reset_status);
 
        if (reset_status) {
-               const char * const vars[2] = {
+               const char * const vars[3] = {
                        "bootcmd",
+                       "bootdelay",
                        "distro_bootcmd",
                };
 
@@ -558,7 +559,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(2, (char * const *)vars, 0);
+               env_set_default_vars(3, (char * const *)vars, 0);
 
                /* Ensure bootcmd_rescue is used by distroboot */
                env_set("boot_targets", "rescue");