* [PATCH] opkg/package/rootfs_ipk: allow overwriting OPKGLIBDIR
@ 2019-07-16 21:55 Adrian Ratiu
2019-07-17 11:12 ` Martin Jansa
0 siblings, 1 reply; 7+ messages in thread
From: Adrian Ratiu @ 2019-07-16 21:55 UTC (permalink / raw)
To: openembedded-core
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.
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
---
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(-)
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index d1b317b42b..9f9da2f91d 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -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')
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index aabc370cfc..e73d2bfdae 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = ""
OPKG_POSTPROCESS_COMMANDS = ""
-OPKGLIBDIR = "${localstatedir}/lib"
+OPKGLIBDIR ??= "${localstatedir}/lib"
MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"
diff --git a/meta/recipes-devtools/opkg/opkg_0.4.1.bb b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
index 8c48d3097c..c663eff13b 100644
--- a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
+++ b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
@@ -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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] opkg/package/rootfs_ipk: allow overwriting OPKGLIBDIR
2019-07-16 21:55 [PATCH] opkg/package/rootfs_ipk: allow overwriting OPKGLIBDIR Adrian Ratiu
@ 2019-07-17 11:12 ` Martin Jansa
2019-07-17 11:52 ` Adrian Ratiu
0 siblings, 1 reply; 7+ messages in thread
From: Martin Jansa @ 2019-07-17 11:12 UTC (permalink / raw)
To: Adrian Ratiu; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 2950 bytes --]
Why don't you overwrite it with an override? We're doing that for years
without any issues.
On Wed, Jul 17, 2019 at 12:01 AM Adrian Ratiu <adrian.ratiu@collabora.com>
wrote:
> 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.
>
> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
> ---
> 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(-)
>
> diff --git a/meta/classes/package_ipk.bbclass
> b/meta/classes/package_ipk.bbclass
> index d1b317b42b..9f9da2f91d 100644
> --- a/meta/classes/package_ipk.bbclass
> +++ b/meta/classes/package_ipk.bbclass
> @@ -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')
> diff --git a/meta/classes/rootfs_ipk.bbclass
> b/meta/classes/rootfs_ipk.bbclass
> index aabc370cfc..e73d2bfdae 100644
> --- a/meta/classes/rootfs_ipk.bbclass
> +++ b/meta/classes/rootfs_ipk.bbclass
> @@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = ""
>
> OPKG_POSTPROCESS_COMMANDS = ""
>
> -OPKGLIBDIR = "${localstatedir}/lib"
> +OPKGLIBDIR ??= "${localstatedir}/lib"
>
> MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"
>
> diff --git a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> index 8c48d3097c..c663eff13b 100644
> --- a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> +++ b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> @@ -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
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
[-- Attachment #2: Type: text/html, Size: 4263 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] opkg/package/rootfs_ipk: allow overwriting OPKGLIBDIR
2019-07-17 11:12 ` Martin Jansa
@ 2019-07-17 11:52 ` Adrian Ratiu
2019-07-17 12:17 ` Martin Jansa
0 siblings, 1 reply; 7+ messages in thread
From: Adrian Ratiu @ 2019-07-17 11:52 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
Hi
On Wed, 17 Jul 2019, Martin Jansa <martin.jansa@gmail.com> wrote:
> 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?
>
> On Wed, Jul 17, 2019 at 12:01 AM Adrian Ratiu <adrian.ratiu@collabora.com>
> wrote:
>
>> 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.
>>
>> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
>> ---
>> 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(-)
>>
>> diff --git a/meta/classes/package_ipk.bbclass
>> b/meta/classes/package_ipk.bbclass
>> index d1b317b42b..9f9da2f91d 100644
>> --- a/meta/classes/package_ipk.bbclass
>> +++ b/meta/classes/package_ipk.bbclass
>> @@ -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')
>> diff --git a/meta/classes/rootfs_ipk.bbclass
>> b/meta/classes/rootfs_ipk.bbclass
>> index aabc370cfc..e73d2bfdae 100644
>> --- a/meta/classes/rootfs_ipk.bbclass
>> +++ b/meta/classes/rootfs_ipk.bbclass
>> @@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = ""
>>
>> OPKG_POSTPROCESS_COMMANDS = ""
>>
>> -OPKGLIBDIR = "${localstatedir}/lib"
>> +OPKGLIBDIR ??= "${localstatedir}/lib"
>>
>> MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"
>>
>> diff --git a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
>> b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
>> index 8c48d3097c..c663eff13b 100644
>> --- a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
>> +++ b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
>> @@ -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
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] opkg/package/rootfs_ipk: allow overwriting OPKGLIBDIR
2019-07-17 11:52 ` Adrian Ratiu
@ 2019-07-17 12:17 ` Martin Jansa
2019-07-17 14:17 ` Adrian Ratiu
0 siblings, 1 reply; 7+ messages in thread
From: Martin Jansa @ 2019-07-17 12:17 UTC (permalink / raw)
To: Adrian Ratiu; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 3602 bytes --]
On Wed, Jul 17, 2019 at 02:52:21PM +0300, Adrian Ratiu wrote:
> Hi
>
> On Wed, 17 Jul 2019, Martin Jansa <martin.jansa@gmail.com> wrote:
> > 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
> Can you please point to an example?
https://github.com/webosose/meta-webosose/blob/master/meta-webos/conf/distro/include/webos.inc#L256
> > On Wed, Jul 17, 2019 at 12:01 AM Adrian Ratiu <adrian.ratiu@collabora.com>
> > wrote:
> >
> >> 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.
> >>
> >> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
> >> ---
> >> 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(-)
> >>
> >> diff --git a/meta/classes/package_ipk.bbclass
> >> b/meta/classes/package_ipk.bbclass
> >> index d1b317b42b..9f9da2f91d 100644
> >> --- a/meta/classes/package_ipk.bbclass
> >> +++ b/meta/classes/package_ipk.bbclass
> >> @@ -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')
> >> diff --git a/meta/classes/rootfs_ipk.bbclass
> >> b/meta/classes/rootfs_ipk.bbclass
> >> index aabc370cfc..e73d2bfdae 100644
> >> --- a/meta/classes/rootfs_ipk.bbclass
> >> +++ b/meta/classes/rootfs_ipk.bbclass
> >> @@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = ""
> >>
> >> OPKG_POSTPROCESS_COMMANDS = ""
> >>
> >> -OPKGLIBDIR = "${localstatedir}/lib"
> >> +OPKGLIBDIR ??= "${localstatedir}/lib"
> >>
> >> MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"
> >>
> >> diff --git a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> >> b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> >> index 8c48d3097c..c663eff13b 100644
> >> --- a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> >> +++ b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> >> @@ -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
> >> Openembedded-core@lists.openembedded.org
> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >>
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] opkg/package/rootfs_ipk: allow overwriting OPKGLIBDIR
2019-07-17 12:17 ` Martin Jansa
@ 2019-07-17 14:17 ` Adrian Ratiu
2019-07-17 14:41 ` Martin Jansa
0 siblings, 1 reply; 7+ messages in thread
From: Adrian Ratiu @ 2019-07-17 14:17 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
On Wed, 17 Jul 2019, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Wed, Jul 17, 2019 at 02:52:21PM +0300, Adrian Ratiu wrote:
>> Hi On Wed, 17 Jul 2019, Martin Jansa <martin.jansa@gmail.com>
>> wrote:
>> > 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
>
>> 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...
>
>> > On Wed, Jul 17, 2019 at 12:01 AM Adrian Ratiu <adrian.ratiu@collabora.com>
>> > wrote:
>> >
>> >> 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.
>> >>
>> >> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
>> >> ---
>> >> 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(-)
>> >>
>> >> diff --git a/meta/classes/package_ipk.bbclass
>> >> b/meta/classes/package_ipk.bbclass
>> >> index d1b317b42b..9f9da2f91d 100644
>> >> --- a/meta/classes/package_ipk.bbclass
>> >> +++ b/meta/classes/package_ipk.bbclass
>> >> @@ -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')
>> >> diff --git a/meta/classes/rootfs_ipk.bbclass
>> >> b/meta/classes/rootfs_ipk.bbclass
>> >> index aabc370cfc..e73d2bfdae 100644
>> >> --- a/meta/classes/rootfs_ipk.bbclass
>> >> +++ b/meta/classes/rootfs_ipk.bbclass
>> >> @@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = ""
>> >>
>> >> OPKG_POSTPROCESS_COMMANDS = ""
>> >>
>> >> -OPKGLIBDIR = "${localstatedir}/lib"
>> >> +OPKGLIBDIR ??= "${localstatedir}/lib"
>> >>
>> >> MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"
>> >>
>> >> diff --git a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
>> >> b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
>> >> index 8c48d3097c..c663eff13b 100644
>> >> --- a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
>> >> +++ b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
>> >> @@ -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
>> >> Openembedded-core@lists.openembedded.org
>> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>> >>
>
> --
> Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] opkg/package/rootfs_ipk: allow overwriting OPKGLIBDIR
2019-07-17 14:17 ` Adrian Ratiu
@ 2019-07-17 14:41 ` Martin Jansa
2019-07-17 14:43 ` Martin Jansa
0 siblings, 1 reply; 7+ messages in thread
From: Martin Jansa @ 2019-07-17 14:41 UTC (permalink / raw)
To: Adrian Ratiu; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 5039 bytes --]
On Wed, Jul 17, 2019 at 05:17:30PM +0300, Adrian Ratiu wrote:
> On Wed, 17 Jul 2019, Martin Jansa <martin.jansa@gmail.com> wrote:
> > On Wed, Jul 17, 2019 at 02:52:21PM +0300, Adrian Ratiu wrote:
> >> Hi On Wed, 17 Jul 2019, Martin Jansa <martin.jansa@gmail.com>
> >> wrote:
> >> > 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
> >
> >> 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...
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.
https://github.com/openwebos/meta-webos/commit/8c79f89fac09364e5ce494ee5fab133e7734583f#diff-e2b7938279c801074fb285c60acf2228
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,
> >
> >> > On Wed, Jul 17, 2019 at 12:01 AM Adrian Ratiu <adrian.ratiu@collabora.com>
> >> > wrote:
> >> >
> >> >> 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.
> >> >>
> >> >> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
> >> >> ---
> >> >> 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(-)
> >> >>
> >> >> diff --git a/meta/classes/package_ipk.bbclass
> >> >> b/meta/classes/package_ipk.bbclass
> >> >> index d1b317b42b..9f9da2f91d 100644
> >> >> --- a/meta/classes/package_ipk.bbclass
> >> >> +++ b/meta/classes/package_ipk.bbclass
> >> >> @@ -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')
> >> >> diff --git a/meta/classes/rootfs_ipk.bbclass
> >> >> b/meta/classes/rootfs_ipk.bbclass
> >> >> index aabc370cfc..e73d2bfdae 100644
> >> >> --- a/meta/classes/rootfs_ipk.bbclass
> >> >> +++ b/meta/classes/rootfs_ipk.bbclass
> >> >> @@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = ""
> >> >>
> >> >> OPKG_POSTPROCESS_COMMANDS = ""
> >> >>
> >> >> -OPKGLIBDIR = "${localstatedir}/lib"
> >> >> +OPKGLIBDIR ??= "${localstatedir}/lib"
> >> >>
> >> >> MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"
> >> >>
> >> >> diff --git a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> >> >> b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> >> >> index 8c48d3097c..c663eff13b 100644
> >> >> --- a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> >> >> +++ b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> >> >> @@ -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
> >> >> Openembedded-core@lists.openembedded.org
> >> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >> >>
> >
> > --
> > Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] opkg/package/rootfs_ipk: allow overwriting OPKGLIBDIR
2019-07-17 14:41 ` Martin Jansa
@ 2019-07-17 14:43 ` Martin Jansa
0 siblings, 0 replies; 7+ messages in thread
From: Martin Jansa @ 2019-07-17 14:43 UTC (permalink / raw)
To: Adrian Ratiu; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 5666 bytes --]
On Wed, Jul 17, 2019 at 04:41:01PM +0200, Martin Jansa wrote:
> On Wed, Jul 17, 2019 at 05:17:30PM +0300, Adrian Ratiu wrote:
> > On Wed, 17 Jul 2019, Martin Jansa <martin.jansa@gmail.com> wrote:
> > > On Wed, Jul 17, 2019 at 02:52:21PM +0300, Adrian Ratiu wrote:
> > >> Hi On Wed, 17 Jul 2019, Martin Jansa <martin.jansa@gmail.com>
> > >> wrote:
> > >> > 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
> > >
> > >> 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...
>
> 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.
>
> https://github.com/openwebos/meta-webos/commit/8c79f89fac09364e5ce494ee5fab133e7734583f#diff-e2b7938279c801074fb285c60acf2228
>
> 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.
> Cheers,
>
> > >
> > >> > On Wed, Jul 17, 2019 at 12:01 AM Adrian Ratiu <adrian.ratiu@collabora.com>
> > >> > wrote:
> > >> >
> > >> >> 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.
> > >> >>
> > >> >> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
> > >> >> ---
> > >> >> 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(-)
> > >> >>
> > >> >> diff --git a/meta/classes/package_ipk.bbclass
> > >> >> b/meta/classes/package_ipk.bbclass
> > >> >> index d1b317b42b..9f9da2f91d 100644
> > >> >> --- a/meta/classes/package_ipk.bbclass
> > >> >> +++ b/meta/classes/package_ipk.bbclass
> > >> >> @@ -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')
> > >> >> diff --git a/meta/classes/rootfs_ipk.bbclass
> > >> >> b/meta/classes/rootfs_ipk.bbclass
> > >> >> index aabc370cfc..e73d2bfdae 100644
> > >> >> --- a/meta/classes/rootfs_ipk.bbclass
> > >> >> +++ b/meta/classes/rootfs_ipk.bbclass
> > >> >> @@ -21,7 +21,7 @@ OPKG_PREPROCESS_COMMANDS = ""
> > >> >>
> > >> >> OPKG_POSTPROCESS_COMMANDS = ""
> > >> >>
> > >> >> -OPKGLIBDIR = "${localstatedir}/lib"
> > >> >> +OPKGLIBDIR ??= "${localstatedir}/lib"
> > >> >>
> > >> >> MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"
> > >> >>
> > >> >> diff --git a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> > >> >> b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> > >> >> index 8c48d3097c..c663eff13b 100644
> > >> >> --- a/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> > >> >> +++ b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
> > >> >> @@ -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
> > >> >> Openembedded-core@lists.openembedded.org
> > >> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> > >> >>
> > >
> > > --
> > > Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
>
> --
> Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-07-17 14:43 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-16 21:55 [PATCH] opkg/package/rootfs_ipk: allow overwriting OPKGLIBDIR Adrian Ratiu
2019-07-17 11:12 ` Martin Jansa
2019-07-17 11:52 ` Adrian Ratiu
2019-07-17 12:17 ` Martin Jansa
2019-07-17 14:17 ` Adrian Ratiu
2019-07-17 14:41 ` Martin Jansa
2019-07-17 14:43 ` Martin Jansa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox