diff mbox series

[1/2] libubootenv: add rrecommends from libubootenv to u-boot-env

Message ID 20250623073553.844037-2-adrian.freihofer@siemens.com
State New
Headers show
Series libubootenv improvements | expand

Commit Message

AdrianF June 23, 2025, 7:35 a.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

Without /etc/fw_env.config, the fw_printenv and fw_setenv utilities fail
with an error, as they cannot locate the U-Boot environment.
This limitation also affects any application linking against
libubootenv. To address this, add an RRECOMMENDS from libubootenv to the
u-boot-env package, which provides the necessary configuration files.

While this could be an RDEPENDS, using RRECOMMENDS allows users with
custom implementations to more easily override the dependency if needed.

Some examples suggest bbappending fw_env.config directly to the
libubootenv recipe. However, /etc/fw_env.config is machine-specific,
whereas libubootenv is not. Additionally, the default U-Boot
environment, which can be used by libubootenv, is also provided by the
machine-specific u-boot-env package. Therefore, it is preferable to
provide fw_env.config via the machine-specific u-boot recipe.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Antonin Godard June 23, 2025, 8:17 a.m. UTC | #1
On Mon Jun 23, 2025 at 9:35 AM CEST, Adrian Freihofer via lists.openembedded.org wrote:
> From: Adrian Freihofer <adrian.freihofer@siemens.com>
>
> Without /etc/fw_env.config, the fw_printenv and fw_setenv utilities fail
> with an error, as they cannot locate the U-Boot environment.
> This limitation also affects any application linking against
> libubootenv. To address this, add an RRECOMMENDS from libubootenv to the
> u-boot-env package, which provides the necessary configuration files.
>
> While this could be an RDEPENDS, using RRECOMMENDS allows users with
> custom implementations to more easily override the dependency if needed.
>
> Some examples suggest bbappending fw_env.config directly to the
> libubootenv recipe. However, /etc/fw_env.config is machine-specific,
> whereas libubootenv is not. Additionally, the default U-Boot
> environment, which can be used by libubootenv, is also provided by the
> machine-specific u-boot-env package. Therefore, it is preferable to
> provide fw_env.config via the machine-specific u-boot recipe.
>
> Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
> ---
>  meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb b/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb
> index 35678e2361f..a193872b83b 100644
> --- a/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb
> +++ b/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb
> @@ -21,4 +21,8 @@ DEPENDS = "zlib libyaml"
>  PROVIDES += "u-boot-fw-utils"
>  RPROVIDES:${PN}-bin += "u-boot-fw-utils"
>  
> +# libubootenv needs /etc/fw_env.config and /etc/u-boot-initial-env configuration
> +# files which are usually provided by the MACHINE specific u-boot-env package
> +RRECOMMENDS:${PN} += "u-boot-env"
> +
>  BBCLASSEXTEND = "native"

Hi,

I think this patch produces the following warnings:

stdio: WARNING: Nothing RPROVIDES 'u-boot-env-native' (but virtual:native:/srv/pokybuild/yocto-worker/a-full/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)
stdio: WARNING: Nothing RPROVIDES 'libubootenv-native' (but virtual:native:/srv/pokybuild/yocto-worker/a-full/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)
stdio: WARNING: Nothing RPROVIDES 'libubootenv-dev-native' (but virtual:native:/srv/pokybuild/yocto-worker/a-full/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)

Happens on `bitbake universe -c fetch -k`.

Can you have a look?

Full log:
https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/2765656/raw_inline

Antonin
Antonin Godard June 23, 2025, 11:53 a.m. UTC | #2
On Mon Jun 23, 2025 at 10:17 AM CEST, Antonin Godard wrote:
> On Mon Jun 23, 2025 at 9:35 AM CEST, Adrian Freihofer via lists.openembedded.org wrote:
>> From: Adrian Freihofer <adrian.freihofer@siemens.com>
>>
>> Without /etc/fw_env.config, the fw_printenv and fw_setenv utilities fail
>> with an error, as they cannot locate the U-Boot environment.
>> This limitation also affects any application linking against
>> libubootenv. To address this, add an RRECOMMENDS from libubootenv to the
>> u-boot-env package, which provides the necessary configuration files.
>>
>> While this could be an RDEPENDS, using RRECOMMENDS allows users with
>> custom implementations to more easily override the dependency if needed.
>>
>> Some examples suggest bbappending fw_env.config directly to the
>> libubootenv recipe. However, /etc/fw_env.config is machine-specific,
>> whereas libubootenv is not. Additionally, the default U-Boot
>> environment, which can be used by libubootenv, is also provided by the
>> machine-specific u-boot-env package. Therefore, it is preferable to
>> provide fw_env.config via the machine-specific u-boot recipe.
>>
>> Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
>> ---
>>  meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb b/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb
>> index 35678e2361f..a193872b83b 100644
>> --- a/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb
>> +++ b/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb
>> @@ -21,4 +21,8 @@ DEPENDS = "zlib libyaml"
>>  PROVIDES += "u-boot-fw-utils"
>>  RPROVIDES:${PN}-bin += "u-boot-fw-utils"
>>  
>> +# libubootenv needs /etc/fw_env.config and /etc/u-boot-initial-env configuration
>> +# files which are usually provided by the MACHINE specific u-boot-env package
>> +RRECOMMENDS:${PN} += "u-boot-env"
>> +
>>  BBCLASSEXTEND = "native"
>
> Hi,
>
> I think this patch produces the following warnings:
>
> stdio: WARNING: Nothing RPROVIDES 'u-boot-env-native' (but virtual:native:/srv/pokybuild/yocto-worker/a-full/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)
> stdio: WARNING: Nothing RPROVIDES 'libubootenv-native' (but virtual:native:/srv/pokybuild/yocto-worker/a-full/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)
> stdio: WARNING: Nothing RPROVIDES 'libubootenv-dev-native' (but virtual:native:/srv/pokybuild/yocto-worker/a-full/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)
>
> Happens on `bitbake universe -c fetch -k`.
>
> Can you have a look?
>
> Full log:
> https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/2765656/raw_inline

Also triggers the following errors I believe:

ERROR: Nothing RPROVIDES 'lib32-u-boot-env' (but virtual:multilib:lib32:/srv/pokybuild/yocto-worker/qemux86-world-alt/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)
u-boot RPROVIDES lib32-u-boot-env but was skipped: PREFERRED_PROVIDER_virtual/lib32-bootloader set to lib32-u-boot, not u-boot
NOTE: Runtime target 'lib32-u-boot-env' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['lib32-u-boot-env']
ERROR: Nothing RPROVIDES 'lib32-libubootenv-dev' (but virtual:multilib:lib32:/srv/pokybuild/yocto-worker/qemux86-world-alt/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)
No eligible RPROVIDERs exist for 'lib32-libubootenv-dev'
NOTE: Runtime target 'lib32-libubootenv-dev' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['lib32-libubootenv-dev']
ERROR: Nothing RPROVIDES 'lib32-libubootenv' (but virtual:multilib:lib32:/srv/pokybuild/yocto-worker/qemux86-world-alt/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)
No eligible RPROVIDERs exist for 'lib32-libubootenv'
NOTE: Runtime target 'lib32-libubootenv' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['lib32-libubootenv']
ERROR: Nothing RPROVIDES 'u-boot-env' (but /srv/pokybuild/yocto-worker/qemux86-world-alt/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)
u-boot RPROVIDES u-boot-env but was skipped: We shouldn't have multilib variants for u-boot
u-boot RPROVIDES u-boot-env but was skipped: PREFERRED_PROVIDER_virtual/lib32-bootloader set to lib32-u-boot, not u-boot
NOTE: Runtime target 'u-boot-env' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['u-boot-env']
ERROR: Nothing RPROVIDES 'libubootenv' (but /srv/pokybuild/yocto-worker/qemux86-world-alt/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)
No eligible RPROVIDERs exist for 'libubootenv'
NOTE: Runtime target 'libubootenv' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['libubootenv']
ERROR: Nothing RPROVIDES 'libubootenv-dev' (but /srv/pokybuild/yocto-worker/qemux86-world-alt/build/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb RDEPENDS on or otherwise requires it)
No eligible RPROVIDERs exist for 'libubootenv-dev'
NOTE: Runtime target 'libubootenv-dev' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['libubootenv-dev']

https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/1742

Antonin
diff mbox series

Patch

diff --git a/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb b/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb
index 35678e2361f..a193872b83b 100644
--- a/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb
+++ b/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb
@@ -21,4 +21,8 @@  DEPENDS = "zlib libyaml"
 PROVIDES += "u-boot-fw-utils"
 RPROVIDES:${PN}-bin += "u-boot-fw-utils"
 
+# libubootenv needs /etc/fw_env.config and /etc/u-boot-initial-env configuration
+# files which are usually provided by the MACHINE specific u-boot-env package
+RRECOMMENDS:${PN} += "u-boot-env"
+
 BBCLASSEXTEND = "native"