The function loads both the built-in env and the barebox.env file on the SD-Card's boot partition. Failure to mount the SD-Card should still result in the built-in env being loaded, therefore move it to the start of the function. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- arch/arm/boards/raspberry-pi/rpi-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c index ee0b0f63dbef..7a3911e36fa1 100644 --- a/arch/arm/boards/raspberry-pi/rpi-common.c +++ b/arch/arm/boards/raspberry-pi/rpi-common.c @@ -196,6 +196,8 @@ static int rpi_env_init(void) const char *diskdev; int ret; + defaultenv_append_directory(defaultenv_rpi); + device_detect_by_name("mci0"); device_detect_by_name("mci1"); @@ -218,8 +220,6 @@ static int rpi_env_init(void) return 0; } - defaultenv_append_directory(defaultenv_rpi); - default_environment_path_set("/boot/barebox.env"); return 0; -- 2.39.2