mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-16 15:02:16 +01:00
- Turris: Fix bootcmd_rescue (Pali)
This commit is contained in:
commit
9301a5cc99
@ -440,10 +440,18 @@ static bool read_reset_button(void)
|
|||||||
|
|
||||||
static void handle_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()) {
|
if (read_reset_button()) {
|
||||||
const char * const vars[3] = {
|
const char * const vars[2] = {
|
||||||
"bootcmd",
|
"bootcmd",
|
||||||
"bootcmd_rescue",
|
|
||||||
"distro_bootcmd",
|
"distro_bootcmd",
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -451,7 +459,7 @@ static void handle_reset_button(void)
|
|||||||
* Set the above envs to their default values, in case the user
|
* Set the above envs to their default values, in case the user
|
||||||
* managed to break them.
|
* 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 */
|
/* Ensure bootcmd_rescue is used by distroboot */
|
||||||
env_set("boot_targets", "rescue");
|
env_set("boot_targets", "rescue");
|
||||||
|
|||||||
@ -339,9 +339,17 @@ static int set_regdomain(void)
|
|||||||
|
|
||||||
static void handle_reset_button(void)
|
static void handle_reset_button(void)
|
||||||
{
|
{
|
||||||
|
const char * const vars[1] = { "bootcmd_rescue", };
|
||||||
int ret;
|
int ret;
|
||||||
u8 reset_status;
|
u8 reset_status;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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);
|
||||||
|
|
||||||
ret = omnia_mcu_read(CMD_GET_RESET, &reset_status, 1);
|
ret = omnia_mcu_read(CMD_GET_RESET, &reset_status, 1);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printf("omnia_mcu_read failed: %i, reset status unknown!\n",
|
printf("omnia_mcu_read failed: %i, reset status unknown!\n",
|
||||||
@ -352,9 +360,8 @@ static void handle_reset_button(void)
|
|||||||
env_set_ulong("omnia_reset", reset_status);
|
env_set_ulong("omnia_reset", reset_status);
|
||||||
|
|
||||||
if (reset_status) {
|
if (reset_status) {
|
||||||
const char * const vars[3] = {
|
const char * const vars[2] = {
|
||||||
"bootcmd",
|
"bootcmd",
|
||||||
"bootcmd_rescue",
|
|
||||||
"distro_bootcmd",
|
"distro_bootcmd",
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -362,7 +369,7 @@ static void handle_reset_button(void)
|
|||||||
* Set the above envs to their default values, in case the user
|
* Set the above envs to their default values, in case the user
|
||||||
* managed to break them.
|
* 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 */
|
/* Ensure bootcmd_rescue is used by distroboot */
|
||||||
env_set("boot_targets", "rescue");
|
env_set("boot_targets", "rescue");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user