All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] ipk/deb/rpm: add kernel version to its dependencies
@ 2016-06-08 16:08 Ovidiu-Adrian Vancea
  2016-06-08 16:08 ` [PATCH v2 1/3] package_ipk.bbclass: " Ovidiu-Adrian Vancea
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Ovidiu-Adrian Vancea @ 2016-06-08 16:08 UTC (permalink / raw)
  To: openembedded-core

Updating the kernel (for all package managers) does not update the dependencies
(eg. modules) because there is no possibility to do version enforcement in the
OE recipe. Upon rebooting, the older version modules do not load and can leave
hardware in a non-functioning state (if their drivers are not built into the
kernel).

Use the Version field from the kernel package on its rdepends, rrecommends, and
rsuggests fields’ version. This makes the packages on which the kernel depends
to be the same version as the kernel. Version field contains package build
number (including git hash) and package revision, thus restricting the kernel
and modules to always be built together.

The current and default behavior will not change unless the variable 
"VERSION_KERNEL_MODULES = 1" is defined in the kernel recipe.

Ovidiu-Adrian Vancea (3):
  package_ipk.bbclass: add kernel version to its dependencies
  package_deb.bbclass: add kernel version to its dependencies
  package_rpm.bbclass: add kernel version to its dependencies

 meta/classes/package_deb.bbclass | 10 ++++++++++
 meta/classes/package_ipk.bbclass |  9 +++++++++
 meta/classes/package_rpm.bbclass | 21 +++++++++++++++++++++
 3 files changed, 40 insertions(+)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/3] package_ipk.bbclass: add kernel version to its dependencies
  2016-06-08 16:08 [PATCH v2 0/3] ipk/deb/rpm: add kernel version to its dependencies Ovidiu-Adrian Vancea
@ 2016-06-08 16:08 ` Ovidiu-Adrian Vancea
  2016-06-08 16:08 ` [PATCH v2 2/3] package_deb.bbclass: " Ovidiu-Adrian Vancea
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Ovidiu-Adrian Vancea @ 2016-06-08 16:08 UTC (permalink / raw)
  To: openembedded-core

Use the kernel package Version field for its rdepends, rrecommends, and
rsuggests fields’ values. This makes the packages on which the kernel
depends be the same version as the kernel.

Signed-off-by: Ovidiu-Adrian Vancea <ovidiu.vancea@ni.com>
---
 meta/classes/package_ipk.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 08f7020..0a07f61 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -196,6 +196,15 @@ python do_package_ipk () {
         rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
         debian_cmp_remap(rconflicts)
 
+        if (pkgname == "kernel") and (localdata.getVar("VERSION_KERNEL_MODULES", False) == "1"):
+            suffix = "="+localdata.getVar('PKGV', True)+"-"+localdata.getVar('PKGR', True)
+            for key in rdepends:
+                rdepends[key]    = suffix
+            for key in rrecommends:
+                rrecommends[key] = suffix
+            for key in rsuggests:
+                rsuggests[key]   = suffix
+
         if rdepends:
             ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends))
         if rsuggests:
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] package_deb.bbclass: add kernel version to its dependencies
  2016-06-08 16:08 [PATCH v2 0/3] ipk/deb/rpm: add kernel version to its dependencies Ovidiu-Adrian Vancea
  2016-06-08 16:08 ` [PATCH v2 1/3] package_ipk.bbclass: " Ovidiu-Adrian Vancea
@ 2016-06-08 16:08 ` Ovidiu-Adrian Vancea
  2016-06-08 16:08 ` [PATCH v2 3/3] package_rpm.bbclass: " Ovidiu-Adrian Vancea
  2016-06-08 16:59 ` [PATCH v2 0/3] ipk/deb/rpm: " Richard Purdie
  3 siblings, 0 replies; 7+ messages in thread
From: Ovidiu-Adrian Vancea @ 2016-06-08 16:08 UTC (permalink / raw)
  To: openembedded-core

Use the kernel package Version field for its rdepends, rrecommends, and
rsuggests fields’ values. This makes the packages on which the kernel
depends be the same version as the kernel.

The .deb pkgs behaviour is very similar to .ipk's, and the implementation
is identical for this change.

Signed-off-by: Ovidiu-Adrian Vancea <ovidiu.vancea@ni.com>
---
 meta/classes/package_deb.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index e35f427..b8053db 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -250,6 +250,16 @@ python do_package_deb () {
         debian_cmp_remap(rreplaces)
         rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
         debian_cmp_remap(rconflicts)
+
+        if (pkgname == "kernel") and (localdata.getVar("VERSION_KERNEL_MODULES", False) == "1"):
+            suffix = "="+localdata.getVar('PKGV', True)+"-"+localdata.getVar('PKGR', True)
+            for key in rdepends:
+                rdepends[key]    = suffix
+            for key in rrecommends:
+                rrecommends[key] = suffix
+            for key in rsuggests:
+                rsuggests[key]   = suffix
+
         if rdepends:
             ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends))
         if rsuggests:
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/3] package_rpm.bbclass: add kernel version to its dependencies
  2016-06-08 16:08 [PATCH v2 0/3] ipk/deb/rpm: add kernel version to its dependencies Ovidiu-Adrian Vancea
  2016-06-08 16:08 ` [PATCH v2 1/3] package_ipk.bbclass: " Ovidiu-Adrian Vancea
  2016-06-08 16:08 ` [PATCH v2 2/3] package_deb.bbclass: " Ovidiu-Adrian Vancea
@ 2016-06-08 16:08 ` Ovidiu-Adrian Vancea
  2016-06-08 16:59 ` [PATCH v2 0/3] ipk/deb/rpm: " Richard Purdie
  3 siblings, 0 replies; 7+ messages in thread
From: Ovidiu-Adrian Vancea @ 2016-06-08 16:08 UTC (permalink / raw)
  To: openembedded-core

Use the kernel package Version field for its rdepends, rrecommends, and
rsuggests fields’ values. This makes the packages on which the kernel
depends be the same version as the kernel.

The idea is the same as for .deb and .ipk pkgs but the implementation is
slightly different because there are no dictionaries used, instead
package_rmp.bbclass stores rdepends values in strings.

Signed-off-by: Ovidiu-Adrian Vancea <ovidiu.vancea@ni.com>
---
 meta/classes/package_rpm.bbclass | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index f9398a9..ee3d54e 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -371,6 +371,27 @@ python write_specfile () {
         splitrconflicts  = strip_multilib_deps(localdata.getVar('RCONFLICTS', True), d)
         splitrobsoletes  = []
 
+        if (pkgname == "kernel") and (localdata.getVar("VERSION_KERNEL_MODULES", False) == "1"):
+            suffix = " (= "+localdata.getVar('PKGV', True)+"-"+localdata.getVar('PKGR', True) + ")"
+
+            versioneddeps = []
+            for pkg_dep in splitrdepends.split(','):
+                pkg_dep += suffix
+                versioneddeps += [pkg_dep]
+            splitrdepends = ",".join(versioneddeps)
+
+            versionedrecommends = []
+            for pkg_dep in splitrrecommends.split(','):
+                pkg_dep += suffix
+                versionedrecommends += [pkg_dep]
+            splitrrecommends = ",".join(versionedrecommends)
+
+            versionedsuggests = []
+            for pkg_dep in splitrsuggests.split(','):
+                pkg_dep += suffix
+                versionedsuggests += [pkg_dep]
+            splitrsuggests = ",".join(versionedsuggests)
+
         splitrpreinst  = localdata.getVar('pkg_preinst', True)
         splitrpostinst = localdata.getVar('pkg_postinst', True)
         splitrprerm    = localdata.getVar('pkg_prerm', True)
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/3] ipk/deb/rpm: add kernel version to its dependencies
  2016-06-08 16:08 [PATCH v2 0/3] ipk/deb/rpm: add kernel version to its dependencies Ovidiu-Adrian Vancea
                   ` (2 preceding siblings ...)
  2016-06-08 16:08 ` [PATCH v2 3/3] package_rpm.bbclass: " Ovidiu-Adrian Vancea
@ 2016-06-08 16:59 ` Richard Purdie
  2016-06-09 14:47   ` Ovidiu-Adrian Vancea
  3 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2016-06-08 16:59 UTC (permalink / raw)
  To: Ovidiu-Adrian Vancea, openembedded-core

On Wed, 2016-06-08 at 19:08 +0300, Ovidiu-Adrian Vancea wrote:
> Updating the kernel (for all package managers) does not update the
> dependencies
> (eg. modules) because there is no possibility to do version
> enforcement in the
> OE recipe. Upon rebooting, the older version modules do not load and
> can leave
> hardware in a non-functioning state (if their drivers are not built
> into the
> kernel).
> 
> Use the Version field from the kernel package on its rdepends,
> rrecommends, and
> rsuggests fields’ version. This makes the packages on which the
> kernel depends
> to be the same version as the kernel. Version field contains package
> build
> number (including git hash) and package revision, thus restricting
> the kernel
> and modules to always be built together.
> 
> The current and default behavior will not change unless the variable 
> "VERSION_KERNEL_MODULES = 1" is defined in the kernel recipe.
> 
> Ovidiu-Adrian Vancea (3):
>   package_ipk.bbclass: add kernel version to its dependencies
>   package_deb.bbclass: add kernel version to its dependencies
>   package_rpm.bbclass: add kernel version to its dependencies

Why are you doing this at package_write_XXX? These tasks are there
specifically to write out the packages. With your changes the data
written to the packages would be different to that written out to
packagedata for example. We shouldn't encourage different package
metadata in different places.

I think this needs to happen somewhere at do_package time, probably
from a hook in module.bbclass?

Sorry if I wasn't clear about this last time.

Cheers,

Richard






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/3] ipk/deb/rpm: add kernel version to its dependencies
  2016-06-08 16:59 ` [PATCH v2 0/3] ipk/deb/rpm: " Richard Purdie
@ 2016-06-09 14:47   ` Ovidiu-Adrian Vancea
  2016-06-09 15:23     ` Richard Purdie
  0 siblings, 1 reply; 7+ messages in thread
From: Ovidiu-Adrian Vancea @ 2016-06-09 14:47 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

On Wed, 2016-06-08 at 17:59 +0100, Richard Purdie wrote:
> On Wed, 2016-06-08 at 19:08 +0300, Ovidiu-Adrian Vancea wrote:
> > 
> > Updating the kernel (for all package managers) does not update the
> > dependencies
> > (eg. modules) because there is no possibility to do version
> > enforcement in the
> > OE recipe. Upon rebooting, the older version modules do not load
> > and
> > can leave
> > hardware in a non-functioning state (if their drivers are not built
> > into the
> > kernel).
> > 
> > Use the Version field from the kernel package on its rdepends,
> > rrecommends, and
> > rsuggests fields’ version. This makes the packages on which the
> > kernel depends
> > to be the same version as the kernel. Version field contains
> > package
> > build
> > number (including git hash) and package revision, thus restricting
> > the kernel
> > and modules to always be built together.
> > 
> > The current and default behavior will not change unless the
> > variable 
> > "VERSION_KERNEL_MODULES = 1" is defined in the kernel recipe.
> > 
> > Ovidiu-Adrian Vancea (3):
> >   package_ipk.bbclass: add kernel version to its dependencies
> >   package_deb.bbclass: add kernel version to its dependencies
> >   package_rpm.bbclass: add kernel version to its dependencies
> Why are you doing this at package_write_XXX? These tasks are there
> specifically to write out the packages. With your changes the data
> written to the packages would be different to that written out to
> packagedata for example. We shouldn't encourage different package
> metadata in different places.
> 
> I think this needs to happen somewhere at do_package time, probably
> from a hook in module.bbclass?
> 
> Sorry if I wasn't clear about this last time.
> 
> Cheers,
> 
> Richard
> 
> 

At do_package time I can't modify the variables RDEPENDS, RRECOMMENDS
and RSUGGESTS as stated in the following email:
http://lists.openembedded.org/pipermail/bitbake-devel/2013-April/003416
.html
I've tried the smallest changes to these 3 fields but without success,
confirming what was said in the email.
I do manage to get the auto pr data (Version=4.1+git168+a7e53ecc27-
r0.73 - notice r0.73) that I need to version the dependencies.

At variable loading time I could globally change RDEPENDS, RRECOMMENDS
and RSUGGESTS but I can't get the auto pr data. Since I have no auto pr
data, I can go as far as getting Version=4.1+gitAUTOINC+a7e53ecc27-r0
(notice r0, not r0.73) which is incomplete.

The only place I've actually managed to insert the data was at package
creation time (ipk, deb, rpm), which I agree is ugly but I've not found
another to get me where I need.

Thanks for the feedback,
Ovidiu


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/3] ipk/deb/rpm: add kernel version to its dependencies
  2016-06-09 14:47   ` Ovidiu-Adrian Vancea
@ 2016-06-09 15:23     ` Richard Purdie
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2016-06-09 15:23 UTC (permalink / raw)
  To: Ovidiu-Adrian Vancea, openembedded-core

On Thu, 2016-06-09 at 17:47 +0300, Ovidiu-Adrian Vancea wrote:
> At do_package time I can't modify the variables RDEPENDS, RRECOMMENDS
> and RSUGGESTS as stated in the following email:
> http://lists.openembedded.org/pipermail/bitbake-devel/2013-April/0034
> 16
> .html

In general that email is correct, changes to the variables won't
propergate between tasks.

There is an exception in the do_package -> do_package_write_xxx
process. These use emit_pkgdata() to save the data and
read_subpackage_metadata() to read the data back in.

Not all variables are covered, but the ones you mention above are. As
long as you modify them somewhere during do_package such as adding a
function to PACKAGESPLITFUNCS, the changes will persist in the
packaging.

> I've tried the smallest changes to these 3 fields but without
> success,
> confirming what was said in the email.
> I do manage to get the auto pr data (Version=4.1+git168+a7e53ecc27-
> r0.73 - notice r0.73) that I need to version the dependencies.
> 
> At variable loading time I could globally change RDEPENDS,
> RRECOMMENDS
> and RSUGGESTS but I can't get the auto pr data. Since I have no auto
> pr
> data, I can go as far as getting Version=4.1+gitAUTOINC+a7e53ecc27-r0
> (notice r0, not r0.73) which is incomplete.
> 
> The only place I've actually managed to insert the data was at
> package
> creation time (ipk, deb, rpm), which I agree is ugly but I've not
> found
> another to get me where I need.

See above, I believe you can change these values and other recipes do
this as long as its somewhere within the do_package task.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-09 15:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-08 16:08 [PATCH v2 0/3] ipk/deb/rpm: add kernel version to its dependencies Ovidiu-Adrian Vancea
2016-06-08 16:08 ` [PATCH v2 1/3] package_ipk.bbclass: " Ovidiu-Adrian Vancea
2016-06-08 16:08 ` [PATCH v2 2/3] package_deb.bbclass: " Ovidiu-Adrian Vancea
2016-06-08 16:08 ` [PATCH v2 3/3] package_rpm.bbclass: " Ovidiu-Adrian Vancea
2016-06-08 16:59 ` [PATCH v2 0/3] ipk/deb/rpm: " Richard Purdie
2016-06-09 14:47   ` Ovidiu-Adrian Vancea
2016-06-09 15:23     ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.