[OE-core] [PATCH] u-boot: Add {gen|deploy}_default_envs tasks to generate environment images

Lukasz Majewski lukma at denx.de
Thu May 3 18:17:19 UTC 2018


On Thu, 3 May 2018 18:24:32 +0200
Stefano Babic <sbabic at denx.de> wrote:

> Hi Lukasz,
> 
> On 27/04/2018 16:51, Lukasz Majewski wrote:
> > This commit provides the ability to generate u-boot environment(s)
> > as images, which afterwards can be used to produce image (with wic)
> > for flashing (eMMC or SPI-NOR).
> > 
> > This change removes the need to run "env default" during production
> > phase, as proper environment (including redundant one) is already
> > stored on persistent memory (the CRC is also correct).
> > 
> > Signed-off-by: Lukasz Majewski <lukma at denx.de>
> > 
> > ---
> > This patch depends on "u-boot: Upgrade to 2018.03 release"
> > https://patchwork.openembedded.org/patch/149998/
> > ---
> >  meta/recipes-bsp/u-boot/u-boot.inc | 35
> > +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
> > 
> > diff --git a/meta/recipes-bsp/u-boot/u-boot.inc
> > b/meta/recipes-bsp/u-boot/u-boot.inc index c2bcf99840..2796e503cf
> > 100644 --- a/meta/recipes-bsp/u-boot/u-boot.inc
> > +++ b/meta/recipes-bsp/u-boot/u-boot.inc
> > @@ -305,3 +305,38 @@ do_deploy () {
> >  }
> >  
> >  addtask deploy before do_build after do_compile
> > +
> > +# Create new rules to extract default envs
> > +UBOOT_ENVS_DEFAULT ?= "uboot-envs-default"
> > +DEFAULT_ENVS ?= "u-boot-env-default.txt"
> > +DEFAULT_ENVS_SIZE ?= "65536"
> > +
> > +# Generate default environment
> > +do_gen_default_envs[doc] = "Generate image with default U-Boot
> > environment(s)" +do_gen_default_envs () {
> > +	${B}/source/scripts/get_default_envs.sh ${B} >
> > ${B}/${DEFAULT_ENVS} +
> > +	# Generate env image
> > +	${B}/tools/mkenvimage -s ${DEFAULT_ENVS_SIZE} -o
> > ${B}/${UBOOT_ENVS_DEFAULT} ${B}/${DEFAULT_ENVS} +
> > +	# Generate redundant env image
> > +	${B}/tools/mkenvimage -r -s ${DEFAULT_ENVS_SIZE} -o
> > ${B}/${UBOOT_ENVS_DEFAULT}_r ${B}/${DEFAULT_ENVS} +
> > +	rm ${B}/${DEFAULT_ENVS}
> > +}
> > +  
> 
> Why do we need a separate task ? Is it not part of do_compile ?

The get_default_envs.sh script requires the build-in.o to be already
build. For that reason I've added a separate task, which goes just after
the do_compile for u-boot.

> 
> > +addtask gen_default_envs before do_deploy_default_envs after
> > do_compile +
> > +# Deploy default environment
> > +do_deploy_default_envs[doc] = "Copy images with default U-Boot
> > environment to deployment directory" +do_deploy_default_envs () {
> > +	install -d ${DEPLOYDIR}
> > +
> > +	install ${B}/${UBOOT_ENVS_DEFAULT}
> > ${DEPLOYDIR}/${UBOOT_ENVS_DEFAULT}
> > +	install ${B}/${UBOOT_ENVS_DEFAULT}_r
> > ${DEPLOYDIR}/${UBOOT_ENVS_DEFAULT}_r +
> > +	rm ${B}/${UBOOT_ENVS_DEFAULT}
> > +	rm ${B}/${UBOOT_ENVS_DEFAULT}_r
> > +}
> > +
> > +addtask deploy_default_envs before do_deploy after
> > do_gen_default_envs 
> 
> I would like to see that the default environment is installed and
> delivered as (additional) package. I could then add it to my rootfs
> and use it to set up the environment in user space in case a CRC
> error is reported by the env tools.
> 
> Regards,
> Stefano
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20180503/7dccaf19/attachment-0002.sig>


More information about the Openembedded-core mailing list