From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by mail.openembedded.org (Postfix) with ESMTP id 573BE74053 for ; Thu, 21 May 2015 10:00:55 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.14.9/8.14.9) with ESMTP id t4LA0rAf029649 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 21 May 2015 03:00:54 -0700 (PDT) Received: from [128.224.162.243] (128.224.162.243) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.224.2; Thu, 21 May 2015 03:00:53 -0700 Message-ID: <555DACC2.7090900@windriver.com> Date: Thu, 21 May 2015 18:00:34 +0800 From: "Zhou, Li" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Martin Jansa References: <1432085475-24806-1-git-send-email-li.zhou@windriver.com> In-Reply-To: Cc: Patches and discussions about the oe-core layer Subject: Re: [PATCH] opkg-utils: Change alternatives lib path from /usr/lib/opkg to /var/lib/opkg 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: Thu, 21 May 2015 10:00:58 -0000 Content-Type: multipart/alternative; boundary="------------060207020302060009040404" --------------060207020302060009040404 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Hi, Martin: I have tried to use , but opkg-utils is built for both native and target. localstatedir will get different value in the two cases. It causes that update-alternative for native can't get the right path. I can't find a proper variable to do this by now. Do you have any suggestion? Also, it's not a good way. But in poky/meta/recipes-devtools/installer/adt-installer/scripts/data_define, we could also see like this: OPKG_LIBDIR="/var/lib" You mention , and could you give me an example for it? I'm not quite clear about the history you mentioned, and could you give an detail about this? Does this issue still exist on current version? As my git log say: the old version oe-core get the directory as /var/lib/opkg, while the new version get the directory as /usr/lib/opkg. This cause issues in the users' place. That is why I do this change. Thank you. Zhou Li On 05/20/2015 02:07 PM, Martin Jansa wrote: > Please use the same variable with weak assignment like opkg recipes > (so that it can be easily changed from distro config). > > This also breaks all upgrade paths, is it acceptable? In oe-classic > days I've created postinst script which were migrating existing > update-alternatives in the rootfs when update-alternatives-cworth was > upgraded with different path. > > On Wed, May 20, 2015 at 3:31 AM, Li Zhou > wrote: > > When update-alternatives is moved from opkg to opkg-utils, a line in > the file is changed > from > to . > But opkglibdir doesn't equal to "/usr/lib" here, but equal to > "/var/lib" > in oe-core build by configuring --with-opkglibdir. > opkg-utils can't get the var value in opkg, so here define > opkglibdir to > set the path. > > Signed-off-by: Li Zhou > > --- > meta/recipes-devtools/opkg-utils/opkg-utils_git.bb > | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb > > b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb > > index 2800a5d..fc12d91 100644 > --- a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb > > +++ b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb > > @@ -22,8 +22,11 @@ PYTHONRDEPS_class-native = "" > PACKAGECONFIG = "python" > PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}" > > +opkglibdir = "/var/lib" > + > do_install() { > oe_runmake PREFIX=${prefix} DESTDIR=${D} install > + sed -i s:/usr/lib/opkg:${opkglibdir}/opkg: > ${D}${bindir}/update-alternatives > } > > PACKAGES =+ "update-alternatives-opkg" > -- > 1.7.9.5 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > > http://lists.openembedded.org/mailman/listinfo/openembedded-core > > -- Best Regards! Zhou Li Phone number: 86-10-84778511 --------------060207020302060009040404 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 8bit Hi, Martin:
        I have tried to use <opkglibdir = "${localstatedir}/lib">, but opkg-utils is built for both native and target. localstatedir will get different value in the two cases. It causes that update-alternative for native can't get the right path. I can't find a proper variable to do this by now. Do you have any suggestion?
        Also, it's not a good way. But in poky/meta/recipes-devtools/installer/adt-installer/scripts/data_define, we could also see like this: OPKG_LIBDIR="/var/lib"

        You mention <This also breaks all upgrade paths>, and could you give me an example for it?
        I'm not quite clear about the history you mentioned, and could you give an detail about this? Does this issue still exist on current version?
        As my git log say: the old version oe-core get the directory as /var/lib/opkg, while the new version get the directory as /usr/lib/opkg. This cause issues in the users' place. That is why I do this change.
        Thank you.

Zhou Li

On 05/20/2015 02:07 PM, Martin Jansa wrote:
Please use the same variable with weak assignment like opkg recipes (so that it can be easily changed from distro config).

This also breaks all upgrade paths, is it acceptable? In oe-classic days I've created postinst script which were migrating existing update-alternatives in the rootfs when update-alternatives-cworth was upgraded with different path.

On Wed, May 20, 2015 at 3:31 AM, Li Zhou <li.zhou@windriver.com> wrote:
When update-alternatives is moved from opkg to opkg-utils, a line in
the file is changed
from <ad="$OPKG_OFFLINE_ROOT@opkglibdir@/opkg/alternatives">
to <ad="$OPKG_OFFLINE_ROOT/usr/lib/opkg/alternatives">.
But opkglibdir doesn't equal to "/usr/lib" here, but equal to "/var/lib"
 in oe-core build by configuring --with-opkglibdir.
opkg-utils can't get the var value in opkg, so here define opkglibdir to
set the path.

Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
index 2800a5d..fc12d91 100644
--- a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
@@ -22,8 +22,11 @@ PYTHONRDEPS_class-native = ""
 PACKAGECONFIG = "python"
 PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"

+opkglibdir = "/var/lib"
+
 do_install() {
        oe_runmake PREFIX=${prefix} DESTDIR=${D} install
+       sed -i s:/usr/lib/opkg:${opkglibdir}/opkg: ${D}${bindir}/update-alternatives
 }

 PACKAGES =+ "update-alternatives-opkg"
--
1.7.9.5

--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


-- 
Best Regards!
Zhou Li
Phone number: 86-10-84778511
--------------060207020302060009040404--