[PATCH 6/6] rockchip: ringneck-px30: fix modified boot_targets detection

Tom Rini trini at konsulko.com
Thu Nov 9 22:28:09 CET 2023


On Wed, Nov 08, 2023 at 03:20:35PM +0100, Quentin Schulz wrote:

> From: Quentin Schulz <quentin.schulz at theobroma-systems.com>
> 
> U-Boot proper automatically modifies boot_targets to swap the order in
> which MMC storage media are used for standard boot based on which MMC
> storage medium was used to load U-Boot proper. This is however only done
> if the user has not changed it manually, therefore a check between the
> default and current value is done.
> 
> This used to work fine until the migration to standard boot where
> boot_targets value size in the default environment went above the 32
> characters that env_get_default function can return, thus resulting in a
> truncated variable.
> 
> Therefore the check between default and current value would always fail.
> 
> By using the newly added env_get_default_into function, a buffer of
> the appropriate size can be allocated on the stack to get the whole
> value of boot_targets in the default environment and thus fixing the
> check.
> 
> Cc: Quentin Schulz <foss+uboot at 0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz at theobroma-systems.com>
> ---
>  board/theobroma-systems/ringneck_px30/ringneck-px30.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)

This looks like what the puma-rk3399 is doing in 5/6. Can we have this
in a more common location? Or would there be a downside to that?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20231109/fc915678/attachment.sig>


More information about the U-Boot mailing list