From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by mail.openembedded.org (Postfix) with ESMTP id F0B12600EA for ; Mon, 30 Apr 2018 13:23:19 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id o4-v6so8029981wrm.0 for ; Mon, 30 Apr 2018 06:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/LuHS0IJ9/fjbby0TOpjvDt/6QZqtUb8dabcVllhpXo=; b=LMDjccu+h30weXZwkvsQJiTOtLKjBcIeeQhetHPNF8YkMRcf7w8vF5wTiTtL7yGJjV JCcoe+p2uUDNOwZceKjlWvov2HKGhda2dUWSBag9Q4onOmP030QaJMw47/rvzZEtYoob HklGsXhTzm9h7J8tj/OtMGeDKLBsE1Q79kwrQIK+HAsv5gkgyyLypaExAW1KnOpYq76D TD7mjHqs6TcJg8q53HuDcxWjBDW07Cu1ZAZ0M7pSK3kfaqGi93ygJ8Cyqfkl2E8+zLi7 tviWTh14PMrlK8/DUUk6R15cG7396DDKWeB7SswPM8oB3EyGGrdVjj5zKZsqzo2PKtzT YxWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/LuHS0IJ9/fjbby0TOpjvDt/6QZqtUb8dabcVllhpXo=; b=V8TR7W68FF+wJNFFxNC8YMXuqyfvhHBen6YKptmF31jVSIkRWEt01qBIi220VEsgm8 FX+N3jujeSb7zCOKG66KjsgksDCQfQdMD9AJTO0+RREiGkD9Dir1ySvhXV/hz1/IclKC gJTowsCh6N7h8BtSX4KwLQxMRLQf9RhrtwyZL6yb+jPXehrWFo1zm0/zWMBFb5544gyu SSOEBEoV9qOC+GsgjMKqtKxHLg72H7EThnLzYbZFNEZioKs26apj8Ao5k3CX8VpsL6WL 32i7XMJoSdFgUNhcHsU44lDwWlRnnhb6DBg3thJ3CRO5ycjSaKwhhsmgHGHKbTHn3wlR hvDQ== X-Gm-Message-State: ALQs6tCpd6u6ztbCTOaoe+wns5AgZ/Pb6LUyoBX4kU8C5LlAgglZwu4j pM9fUNnLVtP3EYKP9XgYbTfZpxTpAFsBGedi5a8= X-Google-Smtp-Source: AB8JxZoiuKfLI3JqBuv3XeRW3A8mZNseZ80NzMxuK7DRiWP6+tI5rPRRVgs4OlNgaCOzCqY9tBitRwCXKBG2uDBozo4= X-Received: by 2002:adf:e4c8:: with SMTP id v8-v6mr7996307wrm.133.1525094600118; Mon, 30 Apr 2018 06:23:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.133.207 with HTTP; Mon, 30 Apr 2018 06:23:17 -0700 (PDT) In-Reply-To: <69bd71c5-a14a-2687-3f5d-52083043a131@prevas.dk> References: <20180427145139.30732-1-lukma@denx.de> <69bd71c5-a14a-2687-3f5d-52083043a131@prevas.dk> From: Martin Jansa Date: Mon, 30 Apr 2018 15:23:17 +0200 Message-ID: To: =?UTF-8?Q?Martin_Hundeb=C3=B8ll?= Cc: Marek Vasut , Tom Rini , Stefan Agner , OpenEmbedded Core Mailing List Subject: Re: [PATCH] u-boot: Add {gen|deploy}_default_envs tasks to generate environment images X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 13:23:20 -0000 Content-Type: multipart/alternative; boundary="000000000000e39792056b10c18f" --000000000000e39792056b10c18f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable u-boot-mkimage already builds mkenvimage, you just need to install it in do_install: install -m 0755 tools/mkenvimage ${D}${bindir}/uboot-mkenvimage ln -sf uboot-mkenvimage ${D}${bindir}/mkenvimage This is what we have in recipes-bsp/u-boot/u-boot-mkimage_%.bbappend and it works fine. On Mon, Apr 30, 2018 at 8:50 AM, Martin Hundeb=C3=B8ll wro= te: > Hi Lukasz, > > On 2018-04-27 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 phas= e, >> as proper environment (including redundant one) is already stored on >> persistent memory (the CRC is also correct). >> > > I think we should create a separate recipe to install the native > mkenvimage binary (e.g. u-boot-mkenvimage_%.bb) or update > u-boot-mkimage_%.bb install it. > > Then a new recipe to create the environment images can depend on > u-boot-mkenvimage-native. > > Also note the recently added upstream support for external environment > definitions: > http://git.denx.de/?p=3Du-boot.git;a=3Dcommit;h=3Df3d8f7dd73ac5dde > 258eb786d4a01869395b56d7 > > For our usecase we need the ability to generate environment images in > yocto from such external definitions. > > // Martin > > >> Signed-off-by: Lukasz Majewski >> >> --- >> 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 ?=3D "uboot-envs-default" >> +DEFAULT_ENVS ?=3D "u-boot-env-default.txt" >> +DEFAULT_ENVS_SIZE ?=3D "65536" >> + >> +# Generate default environment >> +do_gen_default_envs[doc] =3D "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} >> +} >> + >> +addtask gen_default_envs before do_deploy_default_envs after do_compile >> + >> +# Deploy default environment >> +do_deploy_default_envs[doc] =3D "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_DEF= A >> ULT} >> + 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 >> >> -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > --000000000000e39792056b10c18f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
u-boot-mkimage already builds=C2=A0mkenvimage, you just ne= ed to install it in do_install:

=C2=A0 =C2=A0 insta= ll -m 0755 tools/mkenvimage ${D}${bindir}/uboot-mkenvimage
=C2=A0= =C2=A0 ln -sf uboot-mkenvimage ${D}${bindir}/mkenvimage

This is what we have in=C2=A0recipes-bsp/u-boot/u-boot-mkimage= _%.bbappend and it works fine.

On Mon, Apr 30, 2018 at 8:50 AM, Martin Hundeb=C3= =B8ll <mnhu@prevas.dk> wrote:
Hi Lukasz,

On 2018-04-27 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 producti= on phase,
as proper environment (including redundant one) is already stored on
persistent memory (the CRC is also correct).

I think we should create a separate recipe to install the native mkenvimage= binary (e.g. u-boot-mkenvimage_%.bb) or update u-boot-mkimage_%.bb install= it.

Then a new recipe to create the environment images can depend on u-boot-mke= nvimage-native.

Also note the recently added upstream support for external environment defi= nitions:
http://git= .denx.de/?p=3Du-boot.git;a=3Dcommit;h=3Df3d8f7dd73ac5dde258eb786d= 4a01869395b56d7

For our usecase we need the ability to generate environment images in yocto= from such external definitions.

// Martin


Signed-off-by: Lukasz Majewski <lukma@denx.de>

---
This patch depends on "u-boot: Upgrade to 2018.03 release"
https://patchwork.openembedded.org/patch/149998= /
---
=C2=A0 meta/recipes-bsp/u-boot/u-boot.inc | 35 +++++++++++++++++++++++= ++++++++++++
=C2=A0 1 file changed, 35 insertions(+)

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-b= oot/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 () {
=C2=A0 }
=C2=A0 =C2=A0 addtask deploy before do_build after do_compile
+
+# Create new rules to extract default envs
+UBOOT_ENVS_DEFAULT ?=3D "uboot-envs-default"
+DEFAULT_ENVS ?=3D "u-boot-env-default.txt"
+DEFAULT_ENVS_SIZE ?=3D "65536"
+
+# Generate default environment
+do_gen_default_envs[doc] =3D "Generate image with default U-Boot envi= ronment(s)"
+do_gen_default_envs () {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0${B}/source/scripts/get_default_envs.sh ${= B} > ${B}/${DEFAULT_ENVS}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0# Generate env image
+=C2=A0 =C2=A0 =C2=A0 =C2=A0${B}/tools/mkenvimage -s ${DEFAULT_ENVS_SIZE} -= o ${B}/${UBOOT_ENVS_DEFAULT} ${B}/${DEFAULT_ENVS}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0# Generate redundant env image
+=C2=A0 =C2=A0 =C2=A0 =C2=A0${B}/tools/mkenvimage -r -s ${DEFAULT_ENVS_SIZE= } -o ${B}/${UBOOT_ENVS_DEFAULT}_r ${B}/${DEFAULT_ENVS}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rm ${B}/${DEFAULT_ENVS}
+}
+
+addtask gen_default_envs before do_deploy_default_envs after do_compile +
+# Deploy default environment
+do_deploy_default_envs[doc] =3D "Copy images with default U-Boot envi= ronment to deployment directory"
+do_deploy_default_envs () {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0install -d ${DEPLOYDIR}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0install ${B}/${UBOOT_ENVS_DEFAULT} ${DEPLOYDIR}= /${UBOOT_ENVS_DEFAULT}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0install ${B}/${UBOOT_ENVS_DEFAULT}_r ${DEPLOYDI= R}/${UBOOT_ENVS_DEFAULT}_r
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rm ${B}/${UBOOT_ENVS_DEFAULT}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rm ${B}/${UBOOT_ENVS_DEFAULT}_r
+}
+
+addtask deploy_default_envs before do_deploy after do_gen_default_envs

--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/m= ailman/listinfo/openembedded-core

--000000000000e39792056b10c18f--