mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-24 02:42:18 +01:00
We want to change the bootdevice dynamically, so that when booting U-Boot from sdcard, kernel is also preferably booted from sdcard by default. If the user decides to set their own bootorder, this should not be overwritten. This was already implemented for imx8mp-libra-fpsc board, but as we set the default value for boot_targets in devicetree now, the env_get_default will return NULL. Also env_get might return NULL when boot_targets is not set. A string compare with NULL is unsafe and should be avoided. To fix this we only change the env value if the variable was not set before (NULL), as this is the new default value. In any other case the user has changed the value so it will not be overwritten. Also let standardboot set bootcmd automatically. For this CONFIG_USE_BOOTCOMMAND needs to be activated. Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>