All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] u-boot: Restore valid default environment for running system
@ 2020-03-31 15:16 Otavio Salvador
  2020-03-31 15:32 ` Stefano Babic
  2020-04-01  9:24 ` Richard Purdie
  0 siblings, 2 replies; 8+ messages in thread
From: Otavio Salvador @ 2020-03-31 15:16 UTC (permalink / raw)
  To: OpenEmbedded Core Mailing List; +Cc: Stefano Babic, Tom Rini, Otavio Salvador

One significant change from previous OE-Core releases was the move from
u-boot-fw-utils to libubootenv which offers a generic and not machine
specific alternative. However, it is not fully functional as currently
we don't provide the default environment nor the required configuration
file to be used by it.

This change address this and include on the default u-boot.inc the
needed code to generate, install and deploy the default environment.

The side effect of this change are:

- new ${PN}-env
- u-boot-initial-env on deploy
- fw_env.config on deploy

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
This change is late in the cycle but it is critical in my opinion.

The lack of default environment as well as the configuration for the
tool is a regression from the previous release and this mitigates it.

Changes in v2:
- Fix wrong path on do_install
- Change virtual/bootloader-env to u-boot-default-env (RP)
- Add Tom Rini and Stefano Babic to Cc

 meta/recipes-bsp/u-boot/libubootenv_0.2.bb |  1 +
 meta/recipes-bsp/u-boot/u-boot.inc         | 54 ++++++++++++++++++----
 2 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/meta/recipes-bsp/u-boot/libubootenv_0.2.bb b/meta/recipes-bsp/u-boot/libubootenv_0.2.bb
index 7a7ec4c8856..144c5c941df 100644
--- a/meta/recipes-bsp/u-boot/libubootenv_0.2.bb
+++ b/meta/recipes-bsp/u-boot/libubootenv_0.2.bb
@@ -23,5 +23,6 @@ EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
 
 PROVIDES += "u-boot-fw-utils"
 RPROVIDES_${PN}-bin += "u-boot-fw-utils"
+RRECOMMENDS_${PN}-bin += "u-boot-default-env"
 
 BBCLASSEXTEND = "native"
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 648298da0bf..b13db224732 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -122,6 +122,11 @@ do_compile () {
                             cp ${B}/${config}/${binary} ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
                         fi
                     done
+
+                    # Generate the uboot-initial-env
+                    oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env
+                    cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type}
+
                     unset k
                 fi
             done
@@ -130,6 +135,9 @@ do_compile () {
         unset  i
     else
         oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
+
+        # Generate the uboot-initial-env
+        oe_runmake -C ${S} O=${B} u-boot-initial-env
     fi
 
 }
@@ -143,19 +151,26 @@ do_install () {
                 j=$(expr $j + 1);
                 if [ $j -eq $i ]
                 then
-                    install -d ${D}/boot
-                    install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
+                    install -D -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
                     ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
                     ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
+
+                    # Install the uboot-initial-env
+                    install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/u-boot-initial-env-${type}-${PV}-${PR}
+                    ln -sf u-boot-initial-env-${type}-${PV}-${PR} ${D}/${sysconfdir}/u-boot-initial-env-${type}
+                    ln -sf u-boot-initial-env-${type}-${PV}-${PR} ${D}/${sysconfdir}/u-boot-initial-env
                 fi
             done
             unset  j
         done
         unset  i
     else
-        install -d ${D}/boot
-        install -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
+        install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
         ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
+
+        # Install the uboot-initial-env
+        install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/u-boot-initial-env-${PV}-${PR}
+        ln -sf u-boot-initial-env-${PV}-${PR} ${D}/${sysconfdir}/u-boot-initial-env
     fi
 
     if [ -n "${UBOOT_ELF}" ]
@@ -224,7 +239,16 @@ do_install () {
 
 }
 
-FILES_${PN} = "/boot ${sysconfdir} ${datadir}"
+PACKAGE_BEFORE_PN += "${PN}-env"
+
+RPROVIDES_${PN}-env += "u-boot-default-env"
+FILES_${PN}-env = " \
+    ${sysconfdir}/u-boot-initial-env* \
+    ${sysconfdir}/fw_env.config \
+"
+
+FILES_${PN} = "/boot ${datadir}"
+RDEPENDS_${PN} += "${PN}-env"
 
 do_deploy () {
     if [ -n "${UBOOT_CONFIG}" ]
@@ -235,25 +259,37 @@ do_deploy () {
                 j=$(expr $j + 1);
                 if [ $j -eq $i ]
                 then
-                    install -d ${DEPLOYDIR}
-                    install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
+                    install -D -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
+                    install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/u-boot-initial-env-${type}-${PV}-${PR}
+
                     cd ${DEPLOYDIR}
                     ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
                     ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
                     ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
                     ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
+
+                    ln -sf u-boot-initial-env-${type}-${PV}-${PR} u-boot-initial-env-${type}
+                    ln -sf u-boot-initial-env-${type}-${PV}-${PR} u-boot-initial-env
                 fi
             done
             unset  j
         done
         unset  i
     else
-        install -d ${DEPLOYDIR}
-        install -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
+        install -D -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
+        install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/u-boot-initial-env-${PV}-${PR}
         cd ${DEPLOYDIR}
         rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
         ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
         ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
+
+        ln -sf u-boot-initial-env-${PV}-${PR} u-boot-initial-env
+    fi
+
+    if [ -e ${WORKDIR}/fw_env.config ] ; then
+        install -D -m 644 ${WORKDIR}/fw_env.config ${DEPLOYDIR}/fw_env.config-${PV}-${PR}
+        cd ${DEPLOYDIR}
+        ln -sf fw_env.config-${PV}-${PR} fw_env.config
     fi
 
     if [ -n "${UBOOT_ELF}" ]
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] u-boot: Restore valid default environment for running system
  2020-03-31 15:16 [PATCH v2] u-boot: Restore valid default environment for running system Otavio Salvador
@ 2020-03-31 15:32 ` Stefano Babic
  2020-03-31 16:44   ` [OE-core] " Otavio Salvador
  2020-04-01  9:38   ` Ayoub Zaki
  2020-04-01  9:24 ` Richard Purdie
  1 sibling, 2 replies; 8+ messages in thread
From: Stefano Babic @ 2020-03-31 15:32 UTC (permalink / raw)
  To: Otavio Salvador, OpenEmbedded Core Mailing List; +Cc: Stefano Babic, Tom Rini

Hi Otavio,

On 31.03.20 17:16, Otavio Salvador wrote:
> One significant change from previous OE-Core releases was the move from
> u-boot-fw-utils to libubootenv which offers a generic and not machine
> specific alternative. However, it is not fully functional as currently
> we don't provide the default environment nor the required configuration
> file to be used by it.

Fully agree - it was on my TODO list, then forgotten. Thanks for fixing
this !

> 
> This change address this and include on the default u-boot.inc the
> needed code to generate, install and deploy the default environment.
> 
> The side effect of this change are:
> 
> - new ${PN}-env

Agree.

> - u-boot-initial-env on deploy
> - fw_env.config on deploy

Why do we need both of them in deploy ? For making system functional, we
just need that both files are in /etc, that is ${PN}-env must be
installed (and then you set RRECOMMENDS). But why in deploy ? Am I
missing something ?

> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> This change is late in the cycle but it is critical in my opinion.
> 
> The lack of default environment as well as the configuration for the
> tool is a regression from the previous release and this mitigates it.
> 
> Changes in v2:
> - Fix wrong path on do_install
> - Change virtual/bootloader-env to u-boot-default-env (RP)
> - Add Tom Rini and Stefano Babic to Cc
> 
>  meta/recipes-bsp/u-boot/libubootenv_0.2.bb |  1 +
>  meta/recipes-bsp/u-boot/u-boot.inc         | 54 ++++++++++++++++++----
>  2 files changed, 46 insertions(+), 9 deletions(-)
> 
> diff --git a/meta/recipes-bsp/u-boot/libubootenv_0.2.bb b/meta/recipes-bsp/u-boot/libubootenv_0.2.bb
> index 7a7ec4c8856..144c5c941df 100644
> --- a/meta/recipes-bsp/u-boot/libubootenv_0.2.bb
> +++ b/meta/recipes-bsp/u-boot/libubootenv_0.2.bb
> @@ -23,5 +23,6 @@ EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
>  
>  PROVIDES += "u-boot-fw-utils"
>  RPROVIDES_${PN}-bin += "u-boot-fw-utils"
> +RRECOMMENDS_${PN}-bin += "u-boot-default-env"
>  
>  BBCLASSEXTEND = "native"
> diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
> index 648298da0bf..b13db224732 100644
> --- a/meta/recipes-bsp/u-boot/u-boot.inc
> +++ b/meta/recipes-bsp/u-boot/u-boot.inc
> @@ -122,6 +122,11 @@ do_compile () {
>                              cp ${B}/${config}/${binary} ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
>                          fi
>                      done
> +
> +                    # Generate the uboot-initial-env
> +                    oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env
> +                    cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type}
> +
>                      unset k
>                  fi
>              done
> @@ -130,6 +135,9 @@ do_compile () {
>          unset  i
>      else
>          oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
> +
> +        # Generate the uboot-initial-env
> +        oe_runmake -C ${S} O=${B} u-boot-initial-env
>      fi
>  
>  }
> @@ -143,19 +151,26 @@ do_install () {
>                  j=$(expr $j + 1);
>                  if [ $j -eq $i ]
>                  then
> -                    install -d ${D}/boot
> -                    install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> +                    install -D -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
>                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
>                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
> +
> +                    # Install the uboot-initial-env
> +                    install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/u-boot-initial-env-${type}-${PV}-${PR}
> +                    ln -sf u-boot-initial-env-${type}-${PV}-${PR} ${D}/${sysconfdir}/u-boot-initial-env-${type}
> +                    ln -sf u-boot-initial-env-${type}-${PV}-${PR} ${D}/${sysconfdir}/u-boot-initial-env
>                  fi
>              done
>              unset  j
>          done
>          unset  i
>      else
> -        install -d ${D}/boot
> -        install -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
> +        install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
>          ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
> +
> +        # Install the uboot-initial-env
> +        install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/u-boot-initial-env-${PV}-${PR}
> +        ln -sf u-boot-initial-env-${PV}-${PR} ${D}/${sysconfdir}/u-boot-initial-env
>      fi
>  
>      if [ -n "${UBOOT_ELF}" ]
> @@ -224,7 +239,16 @@ do_install () {
>  
>  }
>  
> -FILES_${PN} = "/boot ${sysconfdir} ${datadir}"
> +PACKAGE_BEFORE_PN += "${PN}-env"
> +
> +RPROVIDES_${PN}-env += "u-boot-default-env"
> +FILES_${PN}-env = " \
> +    ${sysconfdir}/u-boot-initial-env* \
> +    ${sysconfdir}/fw_env.config \
> +"
> +
> +FILES_${PN} = "/boot ${datadir}"
> +RDEPENDS_${PN} += "${PN}-env"
>  
>  do_deploy () {
>      if [ -n "${UBOOT_CONFIG}" ]
> @@ -235,25 +259,37 @@ do_deploy () {
>                  j=$(expr $j + 1);
>                  if [ $j -eq $i ]
>                  then
> -                    install -d ${DEPLOYDIR}
> -                    install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> +                    install -D -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> +                    install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/u-boot-initial-env-${type}-${PV}-${PR}
> +
>                      cd ${DEPLOYDIR}
>                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
>                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
>                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
>                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
> +
> +                    ln -sf u-boot-initial-env-${type}-${PV}-${PR} u-boot-initial-env-${type}
> +                    ln -sf u-boot-initial-env-${type}-${PV}-${PR} u-boot-initial-env
>                  fi
>              done
>              unset  j
>          done
>          unset  i
>      else
> -        install -d ${DEPLOYDIR}
> -        install -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
> +        install -D -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
> +        install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/u-boot-initial-env-${PV}-${PR}
>          cd ${DEPLOYDIR}
>          rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
>          ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
>          ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
> +
> +        ln -sf u-boot-initial-env-${PV}-${PR} u-boot-initial-env
> +    fi
> +
> +    if [ -e ${WORKDIR}/fw_env.config ] ; then
> +        install -D -m 644 ${WORKDIR}/fw_env.config ${DEPLOYDIR}/fw_env.config-${PV}-${PR}
> +        cd ${DEPLOYDIR}
> +        ln -sf fw_env.config-${PV}-${PR} fw_env.config
>      fi
>  
>      if [ -n "${UBOOT_ELF}" ]
> 

Regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OE-core] [PATCH v2] u-boot: Restore valid default environment for running system
  2020-03-31 15:32 ` Stefano Babic
@ 2020-03-31 16:44   ` Otavio Salvador
  2020-03-31 17:03     ` Stefano Babic
  2020-04-01  9:38   ` Ayoub Zaki
  1 sibling, 1 reply; 8+ messages in thread
From: Otavio Salvador @ 2020-03-31 16:44 UTC (permalink / raw)
  To: Stefano Babic; +Cc: Otavio Salvador, OpenEmbedded Core Mailing List, Tom Rini

Hello Stefano,

On Tue, Mar 31, 2020 at 12:32 PM Stefano Babic <sbabic@denx.de> wrote:
> On 31.03.20 17:16, Otavio Salvador wrote:
...
> > - u-boot-initial-env on deploy
> > - fw_env.config on deploy
>
> Why do we need both of them in deploy ? For making system functional, we
> just need that both files are in /etc, that is ${PN}-env must be
> installed (and then you set RRECOMMENDS). But why in deploy ? Am I
> missing something ?

This is used externally, as well as the u-boot binary. In our case, we
use this to add them to the UpdateHub package so we can upgrade the
U-Boot environment during the update process. Something similar can be
done using swupdate.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OE-core] [PATCH v2] u-boot: Restore valid default environment for running system
  2020-03-31 16:44   ` [OE-core] " Otavio Salvador
@ 2020-03-31 17:03     ` Stefano Babic
  2020-03-31 17:52       ` Otavio Salvador
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2020-03-31 17:03 UTC (permalink / raw)
  To: Otavio Salvador, Stefano Babic
  Cc: Otavio Salvador, OpenEmbedded Core Mailing List, Tom Rini

Hi Otavio,

On 31.03.20 18:44, Otavio Salvador wrote:
> Hello Stefano,
> 
> On Tue, Mar 31, 2020 at 12:32 PM Stefano Babic <sbabic@denx.de> wrote:
>> On 31.03.20 17:16, Otavio Salvador wrote:
> ...
>>> - u-boot-initial-env on deploy
>>> - fw_env.config on deploy
>>
>> Why do we need both of them in deploy ? For making system functional, we
>> just need that both files are in /etc, that is ${PN}-env must be
>> installed (and then you set RRECOMMENDS). But why in deploy ? Am I
>> missing something ?
> 
> This is used externally, as well as the u-boot binary. In our case, we
> use this to add them to the UpdateHub package so we can upgrade the
> U-Boot environment during the update process. Something similar can be
> done using swupdate.
> 

Ah, ok - got it.

In your commit message, you stated that as side-effect after switching
to libubootenv is to put the initial environment in deploy. Fine with me
if this helps to add further fetaures or you need it in UpdateHub.


Best regards,
Stefano

> 
> 
> 


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OE-core] [PATCH v2] u-boot: Restore valid default environment for running system
  2020-03-31 17:03     ` Stefano Babic
@ 2020-03-31 17:52       ` Otavio Salvador
  0 siblings, 0 replies; 8+ messages in thread
From: Otavio Salvador @ 2020-03-31 17:52 UTC (permalink / raw)
  To: Stefano Babic; +Cc: Otavio Salvador, OpenEmbedded Core Mailing List, Tom Rini

On Tue, Mar 31, 2020 at 2:03 PM Stefano Babic <sbabic@denx.de> wrote:
> On 31.03.20 18:44, Otavio Salvador wrote:
> > Hello Stefano,
> >
> > On Tue, Mar 31, 2020 at 12:32 PM Stefano Babic <sbabic@denx.de> wrote:
> >> On 31.03.20 17:16, Otavio Salvador wrote:
> > ...
> >>> - u-boot-initial-env on deploy
> >>> - fw_env.config on deploy
> >>
> >> Why do we need both of them in deploy ? For making system functional, we
> >> just need that both files are in /etc, that is ${PN}-env must be
> >> installed (and then you set RRECOMMENDS). But why in deploy ? Am I
> >> missing something ?
> >
> > This is used externally, as well as the u-boot binary. In our case, we
> > use this to add them to the UpdateHub package so we can upgrade the
> > U-Boot environment during the update process. Something similar can be
> > done using swupdate.
> >
>
> Ah, ok - got it.
>
> In your commit message, you stated that as side-effect after switching
> to libubootenv is to put the initial environment in deploy. Fine with me

What I meant was a side effect of the change itself.


-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OE-core] [PATCH v2] u-boot: Restore valid default environment for running system
  2020-03-31 15:16 [PATCH v2] u-boot: Restore valid default environment for running system Otavio Salvador
  2020-03-31 15:32 ` Stefano Babic
@ 2020-04-01  9:24 ` Richard Purdie
  2020-04-01 13:17   ` Otavio Salvador
  1 sibling, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2020-04-01  9:24 UTC (permalink / raw)
  To: Otavio Salvador, OpenEmbedded Core Mailing List
  Cc: Stefano Babic, Tom Rini, Otavio Salvador

On Tue, 2020-03-31 at 12:16 -0300, Otavio Salvador wrote:
> One significant change from previous OE-Core releases was the move
> from
> u-boot-fw-utils to libubootenv which offers a generic and not machine
> specific alternative. However, it is not fully functional as
> currently
> we don't provide the default environment nor the required
> configuration
> file to be used by it.
> 
> This change address this and include on the default u-boot.inc the
> needed code to generate, install and deploy the default environment.
> 
> The side effect of this change are:
> 
> - new ${PN}-env
> - u-boot-initial-env on deploy
> - fw_env.config on deploy
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> This change is late in the cycle but it is critical in my opinion.
> 
> The lack of default environment as well as the configuration for the
> tool is a regression from the previous release and this mitigates it.
> 
> Changes in v2:
> - Fix wrong path on do_install
> - Change virtual/bootloader-env to u-boot-default-env (RP)
> - Add Tom Rini and Stefano Babic to Cc

Sadly it breaks oe-selftest's sstatetests:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/825

(reproduce with oe-selftest -r sstatetests.SStateTests)

As well as world build file conflicts in deploy:

https://autobuilder.yoctoproject.org/typhoon/#/builders/108/builds/405
https://autobuilder.yoctoproject.org/typhoon/#/builders/52/builds/1731

which is a large number of issues to introduce just before final
release :(

Cheers,

Richard


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OE-core] [PATCH v2] u-boot: Restore valid default environment for running system
  2020-03-31 15:32 ` Stefano Babic
  2020-03-31 16:44   ` [OE-core] " Otavio Salvador
@ 2020-04-01  9:38   ` Ayoub Zaki
  1 sibling, 0 replies; 8+ messages in thread
From: Ayoub Zaki @ 2020-04-01  9:38 UTC (permalink / raw)
  To: Stefano Babic; +Cc: Otavio Salvador, OpenEmbedded Core Mailing List, Tom Rini

[-- Attachment #1: Type: text/plain, Size: 8539 bytes --]

Hi,

it's very handy to have the environment file in the DEPLOY folder to for
example be able to integrate it to a WIC image.


BR

On Tue, Mar 31, 2020 at 5:32 PM Stefano Babic <sbabic@denx.de> wrote:

> Hi Otavio,
>
> On 31.03.20 17:16, Otavio Salvador wrote:
> > One significant change from previous OE-Core releases was the move from
> > u-boot-fw-utils to libubootenv which offers a generic and not machine
> > specific alternative. However, it is not fully functional as currently
> > we don't provide the default environment nor the required configuration
> > file to be used by it.
>
> Fully agree - it was on my TODO list, then forgotten. Thanks for fixing
> this !
>
> >
> > This change address this and include on the default u-boot.inc the
> > needed code to generate, install and deploy the default environment.
> >
> > The side effect of this change are:
> >
> > - new ${PN}-env
>
> Agree.
>
> > - u-boot-initial-env on deploy
> > - fw_env.config on deploy
>
> Why do we need both of them in deploy ? For making system functional, we
> just need that both files are in /etc, that is ${PN}-env must be
> installed (and then you set RRECOMMENDS). But why in deploy ? Am I
> missing something ?
>
> >
> > Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> > ---
> > This change is late in the cycle but it is critical in my opinion.
> >
> > The lack of default environment as well as the configuration for the
> > tool is a regression from the previous release and this mitigates it.
> >
> > Changes in v2:
> > - Fix wrong path on do_install
> > - Change virtual/bootloader-env to u-boot-default-env (RP)
> > - Add Tom Rini and Stefano Babic to Cc
> >
> >  meta/recipes-bsp/u-boot/libubootenv_0.2.bb |  1 +
> >  meta/recipes-bsp/u-boot/u-boot.inc         | 54 ++++++++++++++++++----
> >  2 files changed, 46 insertions(+), 9 deletions(-)
> >
> > diff --git a/meta/recipes-bsp/u-boot/libubootenv_0.2.bb
> b/meta/recipes-bsp/u-boot/libubootenv_0.2.bb
> > index 7a7ec4c8856..144c5c941df 100644
> > --- a/meta/recipes-bsp/u-boot/libubootenv_0.2.bb
> > +++ b/meta/recipes-bsp/u-boot/libubootenv_0.2.bb
> > @@ -23,5 +23,6 @@ EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
> >
> >  PROVIDES += "u-boot-fw-utils"
> >  RPROVIDES_${PN}-bin += "u-boot-fw-utils"
> > +RRECOMMENDS_${PN}-bin += "u-boot-default-env"
> >
> >  BBCLASSEXTEND = "native"
> > diff --git a/meta/recipes-bsp/u-boot/u-boot.inc
> b/meta/recipes-bsp/u-boot/u-boot.inc
> > index 648298da0bf..b13db224732 100644
> > --- a/meta/recipes-bsp/u-boot/u-boot.inc
> > +++ b/meta/recipes-bsp/u-boot/u-boot.inc
> > @@ -122,6 +122,11 @@ do_compile () {
> >                              cp ${B}/${config}/${binary}
> ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
> >                          fi
> >                      done
> > +
> > +                    # Generate the uboot-initial-env
> > +                    oe_runmake -C ${S} O=${B}/${config}
> u-boot-initial-env
> > +                    cp ${B}/${config}/u-boot-initial-env
> ${B}/${config}/u-boot-initial-env-${type}
> > +
> >                      unset k
> >                  fi
> >              done
> > @@ -130,6 +135,9 @@ do_compile () {
> >          unset  i
> >      else
> >          oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
> > +
> > +        # Generate the uboot-initial-env
> > +        oe_runmake -C ${S} O=${B} u-boot-initial-env
> >      fi
> >
> >  }
> > @@ -143,19 +151,26 @@ do_install () {
> >                  j=$(expr $j + 1);
> >                  if [ $j -eq $i ]
> >                  then
> > -                    install -d ${D}/boot
> > -                    install -m 644
> ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
> ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> > +                    install -D -m 644
> ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
> ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> >                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> ${D}/boot/${UBOOT_BINARY}-${type}
> >                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> ${D}/boot/${UBOOT_BINARY}
> > +
> > +                    # Install the uboot-initial-env
> > +                    install -D -m 644
> ${B}/${config}/u-boot-initial-env-${type}
> ${D}/${sysconfdir}/u-boot-initial-env-${type}-${PV}-${PR}
> > +                    ln -sf u-boot-initial-env-${type}-${PV}-${PR}
> ${D}/${sysconfdir}/u-boot-initial-env-${type}
> > +                    ln -sf u-boot-initial-env-${type}-${PV}-${PR}
> ${D}/${sysconfdir}/u-boot-initial-env
> >                  fi
> >              done
> >              unset  j
> >          done
> >          unset  i
> >      else
> > -        install -d ${D}/boot
> > -        install -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
> > +        install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
> >          ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
> > +
> > +        # Install the uboot-initial-env
> > +        install -D -m 644 ${B}/u-boot-initial-env
> ${D}/${sysconfdir}/u-boot-initial-env-${PV}-${PR}
> > +        ln -sf u-boot-initial-env-${PV}-${PR}
> ${D}/${sysconfdir}/u-boot-initial-env
> >      fi
> >
> >      if [ -n "${UBOOT_ELF}" ]
> > @@ -224,7 +239,16 @@ do_install () {
> >
> >  }
> >
> > -FILES_${PN} = "/boot ${sysconfdir} ${datadir}"
> > +PACKAGE_BEFORE_PN += "${PN}-env"
> > +
> > +RPROVIDES_${PN}-env += "u-boot-default-env"
> > +FILES_${PN}-env = " \
> > +    ${sysconfdir}/u-boot-initial-env* \
> > +    ${sysconfdir}/fw_env.config \
> > +"
> > +
> > +FILES_${PN} = "/boot ${datadir}"
> > +RDEPENDS_${PN} += "${PN}-env"
> >
> >  do_deploy () {
> >      if [ -n "${UBOOT_CONFIG}" ]
> > @@ -235,25 +259,37 @@ do_deploy () {
> >                  j=$(expr $j + 1);
> >                  if [ $j -eq $i ]
> >                  then
> > -                    install -d ${DEPLOYDIR}
> > -                    install -m 644
> ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
> ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> > +                    install -D -m 644
> ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
> ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> > +                    install -D -m 644
> ${B}/${config}/u-boot-initial-env-${type}
> ${DEPLOYDIR}/u-boot-initial-env-${type}-${PV}-${PR}
> > +
> >                      cd ${DEPLOYDIR}
> >                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> ${UBOOT_SYMLINK}-${type}
> >                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> ${UBOOT_SYMLINK}
> >                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> ${UBOOT_BINARY}-${type}
> >                      ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
> ${UBOOT_BINARY}
> > +
> > +                    ln -sf u-boot-initial-env-${type}-${PV}-${PR}
> u-boot-initial-env-${type}
> > +                    ln -sf u-boot-initial-env-${type}-${PV}-${PR}
> u-boot-initial-env
> >                  fi
> >              done
> >              unset  j
> >          done
> >          unset  i
> >      else
> > -        install -d ${DEPLOYDIR}
> > -        install -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
> > +        install -D -m 644 ${B}/${UBOOT_BINARY}
> ${DEPLOYDIR}/${UBOOT_IMAGE}
> > +        install -D -m 644 ${B}/u-boot-initial-env
> ${DEPLOYDIR}/u-boot-initial-env-${PV}-${PR}
> >          cd ${DEPLOYDIR}
> >          rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
> >          ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
> >          ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
> > +
> > +        ln -sf u-boot-initial-env-${PV}-${PR} u-boot-initial-env
> > +    fi
> > +
> > +    if [ -e ${WORKDIR}/fw_env.config ] ; then
> > +        install -D -m 644 ${WORKDIR}/fw_env.config
> ${DEPLOYDIR}/fw_env.config-${PV}-${PR}
> > +        cd ${DEPLOYDIR}
> > +        ln -sf fw_env.config-${PV}-${PR} fw_env.config
> >      fi
> >
> >      if [ -n "${UBOOT_ELF}" ]
> >
>
> Regards,
> Stefano
>
> --
> =====================================================================
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
> =====================================================================
> 
>

[-- Attachment #2: Type: text/html, Size: 10877 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OE-core] [PATCH v2] u-boot: Restore valid default environment for running system
  2020-04-01  9:24 ` Richard Purdie
@ 2020-04-01 13:17   ` Otavio Salvador
  0 siblings, 0 replies; 8+ messages in thread
From: Otavio Salvador @ 2020-04-01 13:17 UTC (permalink / raw)
  To: Richard Purdie
  Cc: OpenEmbedded Core Mailing List, Stefano Babic, Tom Rini, Otavio Salvador

On Wed, Apr 1, 2020 at 6:24 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
...
> Sadly it breaks oe-selftest's sstatetests:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/825
>
> (reproduce with oe-selftest -r sstatetests.SStateTests)
>
> As well as world build file conflicts in deploy:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/108/builds/405
> https://autobuilder.yoctoproject.org/typhoon/#/builders/52/builds/1731
>
> which is a large number of issues to introduce just before final
> release :(

Sure; these errors are not acceptable. I am checking it right away.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-04-01 13:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 15:16 [PATCH v2] u-boot: Restore valid default environment for running system Otavio Salvador
2020-03-31 15:32 ` Stefano Babic
2020-03-31 16:44   ` [OE-core] " Otavio Salvador
2020-03-31 17:03     ` Stefano Babic
2020-03-31 17:52       ` Otavio Salvador
2020-04-01  9:38   ` Ayoub Zaki
2020-04-01  9:24 ` Richard Purdie
2020-04-01 13:17   ` Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.