[oe-commits] [openembedded-core] 06/08: u-boot: Provide tasks to generate default U-Boot environment(s) images

git at git.openembedded.org git at git.openembedded.org
Wed Jul 10 08:58:01 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 7c550a035ebe8b10ec80fcaceb0f69206dff62b4
Author: Lukasz Majewski <lukma at denx.de>
AuthorDate: Tue Jul 9 16:20:28 2019 +0200

    u-boot: Provide tasks to generate default U-Boot environment(s) images
    
    This change provides tasks to generate default U-Boot environment images
    from built U-Boot (via. get_default_envs.sh script).
    
    Those images then can be used to generate wic images (with e.g. eMMC layout).
    With such approach the end user doesn't see the "CRC environment" error
    after the first boot.
    
    Moreover, those are built per MACHINE (as u-boot itself is) so then could
    be used in SWUpdate scenarios with single tar'ed archive with multiple
    MACHINE specific *.swu images.
    
    It is also possible to adjust the *_ENVS_* variables in machine specific
    conf file.
    
    Test:
    Newest master-next for poky repo - SHA1: eb5b0a0b5e53a6e55a09e66489d3f24d0c6232ee
    MACHINE = "beaglebone-yocto" in local.conf
    bitbake virtual/bootloader
    
    As a result following links are available in deploy directory:
    u-boot-env.img{_r}.
    
    Signed-off-by: Lukasz Majewski <lukma at denx.de>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-bsp/u-boot/u-boot.inc | 41 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 9a754fd..e0ccf1c 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -331,3 +331,44 @@ do_deploy () {
 }
 
 addtask deploy before do_build after do_compile
+
+# Extract default envs from build U-Boot
+DEFAULT_UBOOT_ENVS_FILE ?= "u-boot-env"
+DEFAULT_ENVS ?= "${DEFAULT_UBOOT_ENVS_FILE}.txt"
+UBOOT_ENVS_DEFAULT ?= "${DEFAULT_UBOOT_ENVS_FILE}-${MACHINE}-${PV}-${PR}.img"
+UBOOT_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 ${UBOOT_ENVS_SIZE} -o ${B}/${UBOOT_ENVS_DEFAULT} ${B}/${DEFAULT_ENVS}
+
+    # Generate redundant env image
+    ${B}/tools/mkenvimage -r -s ${UBOOT_ENVS_SIZE} -o ${B}/${UBOOT_ENVS_DEFAULT}_r ${B}/${DEFAULT_ENVS}
+
+    rm ${B}/${DEFAULT_ENVS}
+}
+
+addtask gen_default_envs before do_deploy 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
+
+     cd ${DEPLOYDIR}
+     ln -sf ${UBOOT_ENVS_DEFAULT} ${DEFAULT_UBOOT_ENVS_FILE}.img
+     ln -sf ${UBOOT_ENVS_DEFAULT}_r ${DEFAULT_UBOOT_ENVS_FILE}.img_r
+
+     rm ${B}/${UBOOT_ENVS_DEFAULT}
+     rm ${B}/${UBOOT_ENVS_DEFAULT}_r
+}
+
+addtask deploy_default_envs before do_deploy after do_gen_default_envs

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list