Skip to contentSkip to conversation

opkg-utils: Change alternatives lib path from /usr/lib/opkg to /var/lib/opkg

PATCH Superseded Li Zhou 5 participants 7 messages May 20, 2015 – Jul 31, 2015

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Li Zhou

author
#0 lore raw

PATCH 1/1 opkg-utils: Change alternatives lib path from /usr/lib/opkg to /var/lib/opkg

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.

---
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |    3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +3 -0
index 2800a5d..fc12d91 100644
@@ -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"
Signature · 1 line
1.7.9.5
#1 lore raw

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.

Quoted 41 lines · Li Zhou

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.

---
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |    3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +3 -0
index 2800a5d..fc12d91 100644
@@ -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
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

author
#2 lore raw

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

Quoted 57 lines · Martin Jansa

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 <[email protected] <mailto:[email protected]>> 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 <[email protected]
    <mailto:[email protected]>>
    ---
     meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
    <http://opkg-utils_git.bb> |    3 +++
     1 file changed, 3 insertions(+)

    diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
    <http://opkg-utils_git.bb>
    b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
    <http://opkg-utils_git.bb>
    index 2800a5d..fc12d91 100644
    --- a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
    <http://opkg-utils_git.bb>
    +++ b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
    <http://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
    [email protected]
    <mailto:[email protected]>
    http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 3 lines
Best Regards!
Zhou Li
Phone number: 86-10-84778511
#3 lore raw
In reply to Li Zhou
Quoted 9 lines · Li Zhou

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.

Quoted 4 lines
---
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |    3 +++
 1 file changed, 3 insertions(+)

https://autobuilder.yoctoproject.org/main/builders/nightly-multilib/builds/387/steps/BuildImages_3/logs/stdio

Seems related to this :/

Cheers,

Richard

#4 lore raw
Quoted 10 lines · Richard Purdie
Quoted 9 lines · Li Zhou

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.

Quoted 8 lines
Quoted 4 lines
---
  meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |    3 +++
  1 file changed, 3 insertions(+)

https://autobuilder.yoctoproject.org/main/builders/nightly-multilib/builds/387/steps/BuildImages_3/logs/stdio

Seems related to this :/

I can not reproduce it,

do you see this error in yocto autobuilder recently? I see this patch still is in master-next2

-Roy

Quoted 5 lines

Cheers,

Richard

Signature · 2 lines
Best Reagrds,
Roy | RongQing Li
#5 lore raw
Quoted 21 lines · Rongqing Li
Quoted 18 lines · Richard Purdie
Quoted 9 lines · Li Zhou

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.

Quoted 4 lines
---
  meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |    3 +++
  1 file changed, 3 insertions(+)

https://autobuilder.yoctoproject.org/main/builders/nightly-multilib/builds/387/steps/BuildImages_3/logs/stdio

Quoted 10 lines
Quoted 1 line

Seems related to this :/

I can not reproduce it,

do you see this error in yocto autobuilder recently? I see this patch still is in master-next2

-Roy

Did you enable multilib?

Regards,
Chen Qi

Quoted 8 lines
Quoted 7 lines

Cheers,

Richard

#6 lore raw
Quoted 36 lines · ChenQi
Quoted 23 lines · Rongqing Li
Quoted 20 lines · Richard Purdie
Quoted 11 lines · Li Zhou

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.

Quoted 4 lines
---
  meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |    3 +++
  1 file changed, 3 insertions(+)

https://autobuilder.yoctoproject.org/main/builders/nightly-multilib/builds/387/steps/BuildImages_3/logs/stdio

Quoted 11 lines
Quoted 1 line

Seems related to this :/

I can not reproduce it,

do you see this error in yocto autobuilder recently? I see this patch still is in master-next2

-Roy

Quoted 5 lines

Did you enable multilib?

Regards,
Chen Qi

Yes

-Roy

Quoted 11 lines
Quoted 8 lines
Quoted 7 lines

Cheers,

Richard

Signature · 2 lines
Best Reagrds,
Roy | RongQing Li