[U-Boot] [PATCH] stm32mp1: configs: fix checking the presence of an environment

Patrick DELAUNAY patrick.delaunay at st.com
Tue Oct 29 08:38:45 UTC 2019


Hi Bartosz,

Please ad get maintainers or tools/patman to sent patch for stm32mp1 platform.

> From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Bartosz Bilas
> Sent: dimanche 27 octobre 2019 15:46
> To: u-boot at lists.denx.de
> Subject: [U-Boot] [PATCH] stm32mp1: configs: fix checking the presence of an
> environment
> 
> Execute env check command within extra env settings section instead of bootcmd
> whereby we are able to mount rootfs partition from sd card properly.
> 
> Signed-off-by: Bartosz Bilas <bartosz.bilas at hotmail.com>
> ---
>  include/configs/stm32mp1.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index
> 988992b336..cadc0358fd 100644
> --- a/include/configs/stm32mp1.h
> +++ b/include/configs/stm32mp1.h
> @@ -115,7 +115,6 @@
>  	"if test ${boot_device} = serial || test ${boot_device} = usb;" \
>  	"then stm32prog ${boot_device} ${boot_instance}; " \
>  	"else " \
> -		"run env_check;" \
>  		"if test ${boot_device} = mmc;" \
>  		"then env set boot_targets \"mmc${boot_instance}\"; fi;" \
>  		"if test ${boot_device} = nand;" \
> @@ -160,6 +159,7 @@
>  	"initrd_high=0xffffffff\0" \
>  	"altbootcmd=run bootcmd\0" \
>  	"env_default=1\0" \
> +	"run env_check;" \

It is not a correct place, this define CONFIG_EXTRA_ENV_SETTINGS only the default environment (only set env variable).
Only "bootcmd"  or "preboot" is really executed, this command will be never executed here.

>  	"env_check=if test $env_default -eq 1;"\
>  		" then env set env_default 0;env save;fi\0" \
>  	STM32MP_BOOTCMD \
> --

Can you explain you issue and the board used.

I think your patch only mask the issue, as environment is not saved, U-Boot never write in EXT4 file system.
You should have again the issue if you execute manually by the command "env save".

Today I have no issue on my side with environment in ext4 file system (generated by donwstrean yocto); 
the requests done by U-Boot are acceptable if the ext4 file system is generated with only the features supported by U-Boot.

But we solved issue with latest ext4 tools; since e2fsprogs 1.43 at least, we have ascendance incompatibility as new enable features are enable by default = metadata_csum and dir_index.

We remove them with the mkfs.ext4 option: -O ^metadata_csum,^dir_index

Example : mkfs.ext4 -L rootfs -O ^metadata_csum,^dir_index /dev/sdb4

For details of restriction, see commit 10a7a1b8 : update with hash tree directory of EXT4 not support by U-Boot (EXT4_INDEX_FL)

Best regards

Patrick




More information about the U-Boot mailing list