opkg/package/rootfs_ipk: allow overwriting OPKGLIBDIR
PATCH 1/1 opkg/package/rootfs_ipk: allow overwriting OPKGLIBDIR
Some distributions for various reasons (like for example mounting a tmpfs over /var at runtime) can't use /var/lib to store the opkg metadata, so a different path is required to have a functioning package manager.
${localstatedir} can't be modified to something other than the hardcoded value in bitbake.conf because other recipes depending on it will fail to install.
So the only recourse, which is also the least invasive, is to allow distros to overwrite the OPKGLIBDIR variable just like they are also allowed to overwrite OPKGBUILDCMD.
--- meta/classes/package_ipk.bbclass | 2 +- meta/classes/rootfs_ipk.bbclass | 2 +- meta/recipes-devtools/opkg/opkg_0.4.1.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
meta/classes/package_ipk.bbclass +1 -1
@@ -14,7 +14,7 @@ OPKG_ARGS += "--force_postinstall --prefer-arch-to-version" OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}" OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "").strip() != ""]}" -OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" python do_package_ipk () { workdir = d.getVar('WORKDIR')
meta/classes/rootfs_ipk.bbclass +1 -1
@@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = "" OPKG_POSTPROCESS_COMMANDS = "" -OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"
meta/recipes-devtools/opkg/opkg_0.4.1.bb +1 -1
@@ -28,7 +28,7 @@ PACKAGES =+ "libopkg" inherit autotools pkgconfig systemd ptest target_localstatedir := "${localstatedir}" -OPKGLIBDIR = "${target_localstatedir}/lib" +OPKGLIBDIR ??= "${target_localstatedir}/lib" PACKAGECONFIG ??= "libsolv"
Signature · 1 line
2.22.0
Why don't you overwrite it with an override? We're doing that for years without any issues.
Quoted 75 lines · Adrian Ratiu
Some distributions for various reasons (like for example mounting a tmpfs over /var at runtime) can't use
/var/libto store the opkg metadata, so a different path is required to have a functioning package manager.${localstatedir} can't be modified to something other than the hardcoded value in bitbake.conf because other recipes depending on it will fail to install.
So the only recourse, which is also the least invasive, is to allow distros to overwrite the OPKGLIBDIR variable just like they are also allowed to overwrite OPKGBUILDCMD.
Signed-off-by Adrian Ratiu <[email protected]>--- meta/classes/package_ipk.bbclass | 2 +- meta/classes/rootfs_ipk.bbclass | 2 +- meta/recipes-devtools/opkg/opkg_0.4.1.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)meta/classes/package_ipk.bbclass +0
-1@@ -14,7 +14,7 @@ OPKG_ARGS += "--force_postinstall --prefer-arch-to-version" OPKG_ARGS += "${@['','--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
OPKG_ARGS+= "${@['', '--add-exclude ' + ' --add-exclude
'.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "").strip() != ""]}"meta/classes/package_ipk.bbclass +1
-1-OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" python do_package_ipk () { workdir = d.getVar('WORKDIR')meta/classes/rootfs_ipk.bbclass +1
-1@@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = "" OPKG_POSTPROCESS_COMMANDS = "" -OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"meta/recipes-devtools/opkg/opkg_0.4.1.bb +1
-2@@ -28,7 +28,7 @@ PACKAGES =+ "libopkg" inherit autotools pkgconfig systemd ptest target_localstatedir := "${localstatedir}" -OPKGLIBDIR = "${target_localstatedir}/lib" +OPKGLIBDIR ??= "${target_localstatedir}/lib" PACKAGECONFIG ??= "libsolv" --2.22.0
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Hi
Quoted 1 line · Martin Jansa
Why don't you overwrite it with an override? We're doing that for years without any issues.
You mean a distro-wide override in a .conf?
Can you please point to an example?
Quoted 79 lines
Quoted 75 lines · Adrian Ratiu
Some distributions for various reasons (like for example mounting a tmpfs over /var at runtime) can't use
/var/libto store the opkg metadata, so a different path is required to have a functioning package manager.${localstatedir} can't be modified to something other than the hardcoded value in bitbake.conf because other recipes depending on it will fail to install.
So the only recourse, which is also the least invasive, is to allow distros to overwrite the OPKGLIBDIR variable just like they are also allowed to overwrite OPKGBUILDCMD.
Signed-off-by Adrian Ratiu <[email protected]>--- meta/classes/package_ipk.bbclass | 2 +- meta/classes/rootfs_ipk.bbclass | 2 +- meta/recipes-devtools/opkg/opkg_0.4.1.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)meta/classes/package_ipk.bbclass +0
-1@@ -14,7 +14,7 @@ OPKG_ARGS += "--force_postinstall --prefer-arch-to-version" OPKG_ARGS += "${@['','--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
OPKG_ARGS+= "${@['', '--add-exclude ' + ' --add-exclude
'.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "").strip() != ""]}"meta/classes/package_ipk.bbclass +1
-1-OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" python do_package_ipk () { workdir = d.getVar('WORKDIR')meta/classes/rootfs_ipk.bbclass +1
-1@@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = "" OPKG_POSTPROCESS_COMMANDS = "" -OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"meta/recipes-devtools/opkg/opkg_0.4.1.bb +1
-2@@ -28,7 +28,7 @@ PACKAGES =+ "libopkg" inherit autotools pkgconfig systemd ptest target_localstatedir := "${localstatedir}" -OPKGLIBDIR = "${target_localstatedir}/lib" +OPKGLIBDIR ??= "${target_localstatedir}/lib" PACKAGECONFIG ??= "libsolv" --2.22.0
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 7 lines · Adrian Ratiu
Hi
Quoted 2 lines · Martin Jansa
Why don't you overwrite it with an override? We're doing that for years without any issues.
You mean a distro-wide override in a .conf?
yes
Quoted 1 line
Can you please point to an example?
https://github.com/webosose/meta-webosose/blob/master/meta-webos/conf/distro/include/webos.inc#L256
Quoted 78 lines
Quoted 78 lines
Quoted 75 lines · Adrian Ratiu
Some distributions for various reasons (like for example mounting a tmpfs over /var at runtime) can't use
/var/libto store the opkg metadata, so a different path is required to have a functioning package manager.${localstatedir} can't be modified to something other than the hardcoded value in bitbake.conf because other recipes depending on it will fail to install.
So the only recourse, which is also the least invasive, is to allow distros to overwrite the OPKGLIBDIR variable just like they are also allowed to overwrite OPKGBUILDCMD.
Signed-off-by Adrian Ratiu <[email protected]>--- meta/classes/package_ipk.bbclass | 2 +- meta/classes/rootfs_ipk.bbclass | 2 +- meta/recipes-devtools/opkg/opkg_0.4.1.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)meta/classes/package_ipk.bbclass +0
-1@@ -14,7 +14,7 @@ OPKG_ARGS += "--force_postinstall --prefer-arch-to-version" OPKG_ARGS += "${@['','--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
OPKG_ARGS+= "${@['', '--add-exclude ' + ' --add-exclude
'.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "").strip() != ""]}"meta/classes/package_ipk.bbclass +1
-1-OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" python do_package_ipk () { workdir = d.getVar('WORKDIR')meta/classes/rootfs_ipk.bbclass +1
-1@@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = "" OPKG_POSTPROCESS_COMMANDS = "" -OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"meta/recipes-devtools/opkg/opkg_0.4.1.bb +1
-2@@ -28,7 +28,7 @@ PACKAGES =+ "libopkg" inherit autotools pkgconfig systemd ptest target_localstatedir := "${localstatedir}" -OPKGLIBDIR = "${target_localstatedir}/lib" +OPKGLIBDIR ??= "${target_localstatedir}/lib" PACKAGECONFIG ??= "libsolv" --2.22.0
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Quoted 10 lines · Martin Jansa
Quoted 3 lines · Adrian Ratiu
Quoted 1 line · Martin Jansa
Why don't you overwrite it with an override? We're doing that for years without any issues.
You mean a distro-wide override in a .conf?
yes
Quoted 1 line
Can you please point to an example?
https://github.com/webosose/meta-webosose/blob/master/meta-webos/conf/distro/include/webos.inc#L256
Thanks, I didn't know about the _forcevariable override.
Is using _forcevariable the preferred method to do this though instead of using ??= ?
The reference manual says it's not recommended and a "worst case" solution...
Quoted 82 lines
Quoted 79 lines
Quoted 79 lines
Quoted 75 lines · Adrian Ratiu
Some distributions for various reasons (like for example mounting a tmpfs over /var at runtime) can't use
/var/libto store the opkg metadata, so a different path is required to have a functioning package manager.${localstatedir} can't be modified to something other than the hardcoded value in bitbake.conf because other recipes depending on it will fail to install.
So the only recourse, which is also the least invasive, is to allow distros to overwrite the OPKGLIBDIR variable just like they are also allowed to overwrite OPKGBUILDCMD.
Signed-off-by Adrian Ratiu <[email protected]>--- meta/classes/package_ipk.bbclass | 2 +- meta/classes/rootfs_ipk.bbclass | 2 +- meta/recipes-devtools/opkg/opkg_0.4.1.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)meta/classes/package_ipk.bbclass +0
-1@@ -14,7 +14,7 @@ OPKG_ARGS += "--force_postinstall --prefer-arch-to-version" OPKG_ARGS += "${@['','--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
OPKG_ARGS+= "${@['', '--add-exclude ' + ' --add-exclude
'.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "").strip() != ""]}"meta/classes/package_ipk.bbclass +1
-1-OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" python do_package_ipk () { workdir = d.getVar('WORKDIR')meta/classes/rootfs_ipk.bbclass +1
-1@@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = "" OPKG_POSTPROCESS_COMMANDS = "" -OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"meta/recipes-devtools/opkg/opkg_0.4.1.bb +1
-2@@ -28,7 +28,7 @@ PACKAGES =+ "libopkg" inherit autotools pkgconfig systemd ptest target_localstatedir := "${localstatedir}" -OPKGLIBDIR = "${target_localstatedir}/lib" +OPKGLIBDIR ??= "${target_localstatedir}/lib" PACKAGECONFIG ??= "libsolv" --2.22.0
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-coreSignature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Quoted 14 lines · Adrian Ratiu
Quoted 5 lines · Martin Jansa
Quoted 4 lines · Adrian Ratiu
Hi On Wed, 17 Jul 2019, Martin Jansa <[email protected]>
Quoted 2 lines · wrote:
Why don't you overwrite it with an override? We're doing that for years without any issues.
Quoted 7 lines
Quoted 1 line
You mean a distro-wide override in a .conf?
yes
Quoted 1 line
Can you please point to an example?
https://github.com/webosose/meta-webosose/blob/master/meta-webos/conf/distro/include/webos.inc#L256
Quoted 7 lines
Thanks, I didn't know about the
_forcevariableoverride.Is using
_forcevariablethe preferred method to do this though instead of using ??= ?The reference manual says it's not recommended and a "worst case" solution...
You can use any other override from OVERRIDES variables which covers all cases you want to cover.
I was using ${DISTRO} before, but switched to forcevariable later, because I needed to cover more DISTROs at the same time.
forcevariable is OK as long as you know what you're doing, if your distro really enforces different OPKGLIBDIR for good reason, then the users probably won't ever need to override it again locally.
Using ??= for every variable, just because someone somewhere might prefer different value doesn't look much better IMHO.
Cheers,
Quoted 82 lines
Quoted 82 lines
Quoted 79 lines
Quoted 79 lines
Quoted 75 lines · Adrian Ratiu
Some distributions for various reasons (like for example mounting a tmpfs over /var at runtime) can't use
/var/libto store the opkg metadata, so a different path is required to have a functioning package manager.${localstatedir} can't be modified to something other than the hardcoded value in bitbake.conf because other recipes depending on it will fail to install.
So the only recourse, which is also the least invasive, is to allow distros to overwrite the OPKGLIBDIR variable just like they are also allowed to overwrite OPKGBUILDCMD.
Signed-off-by Adrian Ratiu <[email protected]>--- meta/classes/package_ipk.bbclass | 2 +- meta/classes/rootfs_ipk.bbclass | 2 +- meta/recipes-devtools/opkg/opkg_0.4.1.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)meta/classes/package_ipk.bbclass +0
-1@@ -14,7 +14,7 @@ OPKG_ARGS += "--force_postinstall --prefer-arch-to-version" OPKG_ARGS += "${@['','--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
OPKG_ARGS+= "${@['', '--add-exclude ' + ' --add-exclude
'.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "").strip() != ""]}"meta/classes/package_ipk.bbclass +1
-1-OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" python do_package_ipk () { workdir = d.getVar('WORKDIR')meta/classes/rootfs_ipk.bbclass +1
-1@@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = "" OPKG_POSTPROCESS_COMMANDS = "" -OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"meta/recipes-devtools/opkg/opkg_0.4.1.bb +1
-2@@ -28,7 +28,7 @@ PACKAGES =+ "libopkg" inherit autotools pkgconfig systemd ptest target_localstatedir := "${localstatedir}" -OPKGLIBDIR = "${target_localstatedir}/lib" +OPKGLIBDIR ??= "${target_localstatedir}/lib" PACKAGECONFIG ??= "libsolv" --2.22.0
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-coreSignature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Quoted 29 lines · Martin Jansa
Quoted 14 lines · Adrian Ratiu
Quoted 5 lines · Martin Jansa
Quoted 4 lines · Adrian Ratiu
Hi On Wed, 17 Jul 2019, Martin Jansa <[email protected]>
Quoted 2 lines · wrote:
Why don't you overwrite it with an override? We're doing that for years without any issues.
Quoted 7 lines
Quoted 1 line
You mean a distro-wide override in a .conf?
yes
Quoted 1 line
Can you please point to an example?
https://github.com/webosose/meta-webosose/blob/master/meta-webos/conf/distro/include/webos.inc#L256
Quoted 7 lines
Thanks, I didn't know about the
_forcevariableoverride.Is using
_forcevariablethe preferred method to do this though instead of using ??= ?The reference manual says it's not recommended and a "worst case" solution...
You can use any other override from OVERRIDES variables which covers all cases you want to cover.
I was using ${DISTRO} before, but switched to forcevariable later, because I needed to cover more DISTROs at the same time.
Quoted 8 lines
forcevariable is OK as long as you know what you're doing, if your distro really enforces different OPKGLIBDIR for good reason, then the users probably won't ever need to override it again locally.
Using ??= for every variable, just because someone somewhere might prefer different value doesn't look much better IMHO.
Also see first bullet point of the commit referenced above:
http://lists.openembedded.org/pipermail/openembedded-core/2013-February/192720.html
so making it easily to change this variable is just allowing more people to break u-a more easily.
Quoted 87 lines
Cheers,
Quoted 82 lines
Quoted 82 lines
Quoted 79 lines
Quoted 79 lines
Quoted 75 lines · Adrian Ratiu
Some distributions for various reasons (like for example mounting a tmpfs over /var at runtime) can't use
/var/libto store the opkg metadata, so a different path is required to have a functioning package manager.${localstatedir} can't be modified to something other than the hardcoded value in bitbake.conf because other recipes depending on it will fail to install.
So the only recourse, which is also the least invasive, is to allow distros to overwrite the OPKGLIBDIR variable just like they are also allowed to overwrite OPKGBUILDCMD.
Signed-off-by Adrian Ratiu <[email protected]>--- meta/classes/package_ipk.bbclass | 2 +- meta/classes/rootfs_ipk.bbclass | 2 +- meta/recipes-devtools/opkg/opkg_0.4.1.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)meta/classes/package_ipk.bbclass +0
-1@@ -14,7 +14,7 @@ OPKG_ARGS += "--force_postinstall --prefer-arch-to-version" OPKG_ARGS += "${@['','--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
OPKG_ARGS+= "${@['', '--add-exclude ' + ' --add-exclude
'.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "").strip() != ""]}"meta/classes/package_ipk.bbclass +1
-1-OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" python do_package_ipk () { workdir = d.getVar('WORKDIR')meta/classes/rootfs_ipk.bbclass +1
-1@@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = "" OPKG_POSTPROCESS_COMMANDS = "" -OPKGLIBDIR = "${localstatedir}/lib" +OPKGLIBDIR ??= "${localstatedir}/lib" MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"meta/recipes-devtools/opkg/opkg_0.4.1.bb +1
-2@@ -28,7 +28,7 @@ PACKAGES =+ "libopkg" inherit autotools pkgconfig systemd ptest target_localstatedir := "${localstatedir}" -OPKGLIBDIR = "${target_localstatedir}/lib" +OPKGLIBDIR ??= "${target_localstatedir}/lib" PACKAGECONFIG ??= "libsolv" --2.22.0
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-coreSignature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]