From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout4.zoneedit.com (mailout4.zoneedit.com [64.68.198.64]) by mx.groups.io with SMTP id smtpd.web10.2184.1590600736394355221 for ; Wed, 27 May 2020 10:32:17 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: denix.org, ip: 64.68.198.64, mailfrom: denis@denix.org) Received: from localhost (localhost [127.0.0.1]) by mailout4.zoneedit.com (Postfix) with ESMTP id B76D440C06; Wed, 27 May 2020 17:32:15 +0000 (UTC) Received: from mailout4.zoneedit.com ([127.0.0.1]) by localhost (zmo14-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VmF23_tsI1hi; Wed, 27 May 2020 17:32:15 +0000 (UTC) Received: from mail.denix.org (pool-100-15-86-127.washdc.fios.verizon.net [100.15.86.127]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout4.zoneedit.com (Postfix) with ESMTPSA id AF10340A18; Wed, 27 May 2020 17:32:09 +0000 (UTC) Received: by mail.denix.org (Postfix, from userid 1000) id 25E1E1731FF; Wed, 27 May 2020 13:32:09 -0400 (EDT) Date: Wed, 27 May 2020 13:32:09 -0400 From: "Denys Dmytriyenko" To: Ming Liu Cc: openembedded-core@lists.openembedded.org, stefan.agner@toradex.com, max.krummenacher@toradex.com, Ming Liu Subject: Re: [OE-core] [PATCH V2 2/2] u-boot: introduce UBOOT_INITIAL_ENV Message-ID: <20200527173209.GM17660@denix.org> References: <20200527172741.4319-1-liu.ming50@gmail.com> <20200527172741.4319-3-liu.ming50@gmail.com> MIME-Version: 1.0 In-Reply-To: <20200527172741.4319-3-liu.ming50@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, May 27, 2020 at 07:27:41PM +0200, Ming Liu wrote: > From: Ming Liu > > It defaults to ${PN}-initial-env, no functional changes with current > implementation, but this allows it to be changed in individual u-boot > recipes. This is fine, but as I commented on the previous revision - can you also add a condition if UBOOT_INITIAL_ENV is empty/undefined to skip u-boot-initial-env completely - don't build it and don't install/deploy? Thanks. -- Denys > The major purpose for introducing this, is that the users might have > some scripts on targets like: > ``` > /sbin/fw_setenv -f /etc/u-boot-initial-env > ``` > > and it should be able to run against a identical path generated by > different u-boot recipes. > > Signed-off-by: Ming Liu > --- > meta/recipes-bsp/u-boot/u-boot.inc | 32 +++++++++++++++++------------- > 1 file changed, 18 insertions(+), 14 deletions(-) > > diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc > index 718435f13f..e408549424 100644 > --- a/meta/recipes-bsp/u-boot/u-boot.inc > +++ b/meta/recipes-bsp/u-boot/u-boot.inc > @@ -60,6 +60,10 @@ UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}" > UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" > UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" > > +# Default name of u-boot initial env, but enable individual recipes to change > +# this value. > +UBOOT_INITIAL_ENV ?= "${PN}-initial-env" > + > # U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf > # to find EXTLINUX conf file. > UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux" > @@ -155,10 +159,10 @@ do_install () { > 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}/${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} > - ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE}-${type} > - ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${type} > - ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env > + install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} > + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type} > + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type} > + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} > fi > done > unset j > @@ -169,9 +173,9 @@ do_install () { > ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY} > > # Install the uboot-initial-env > - install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE}-${PV}-${PR} > - ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE} > - ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env > + install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} > + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE} > + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} > fi > > if [ -n "${UBOOT_ELF}" ] > @@ -243,7 +247,7 @@ PACKAGE_BEFORE_PN += "${PN}-env" > > RPROVIDES_${PN}-env += "u-boot-default-env" > FILES_${PN}-env = " \ > - ${sysconfdir}/${PN}-initial-env* \ > + ${sysconfdir}/${UBOOT_INITIAL_ENV}* \ > ${sysconfdir}/fw_env.config \ > " > > @@ -267,10 +271,10 @@ do_deploy () { > ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} > > # Deploy the uboot-initial-env > - install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} > + install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} > cd ${DEPLOYDIR} > - ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${PN}-initial-env-${MACHINE}-${type} > - ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${PN}-initial-env-${type} > + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type} > + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${type} > fi > done > unset j > @@ -285,10 +289,10 @@ do_deploy () { > ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY} > > # Deploy the uboot-initial-env > - install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${PN}-initial-env-${MACHINE}-${PV}-${PR} > + install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} > cd ${DEPLOYDIR} > - ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${PN}-initial-env-${MACHINE} > - ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${PN}-initial-env > + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE} > + ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV} > fi > > if [ -e ${WORKDIR}/fw_env.config ] ; then > -- > 2.26.2 > >