Skip to contentSkip to conversation

module-base.bbclass: keep PR if MACHINE_KERNEL_PR is not set

PATCH In review Eric Benard 4 participants 13 messages May 3, 2010 – May 17, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 module-base.bbclass: keep PR if MACHINE_KERNEL_PR is not set

---
 classes/module-base.bbclass |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
classes/module-base.bbclass +6 -1
index bc53e1b..9aaaa4e 100644
@@ -7,7 +7,12 @@ export CROSS_COMPILE = "${TARGET_PREFIX}"
 
 # A machine.conf or local.conf can increase MACHINE_KERNEL_PR to force
 # rebuilds for kernel and external modules
-PR = "${MACHINE_KERNEL_PR}"
+python __anonymous () {
+    machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True)
+
+    if machine_kernel_pr:
+       bb.data.setVar('PR', machine_kernel_pr, d)
+}
 
 export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}"
 export KERNEL_SOURCE = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-source')}"
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 13 lines · Eric Benard
---
  classes/module-base.bbclass |    7 ++++++-
  1 files changed, 6 insertions(+), 1 deletions(-)
classes/module-base.bbclass +0 -0
index bc53e1b..9aaaa4e 100644
@@ -7,7 +7,12 @@ export CROSS_COMPILE = "${TARGET_PREFIX}"
 
  # A machine.conf or local.conf can increase MACHINE_KERNEL_PR to force
  # rebuilds for kernel and external modules

classes/module-base.bbclass export CROSS_COMPILE = "${TARGET_PREFIX}" · line 18

Quoted 10 lines
classes/module-base.bbclass +6 -1
-PR = "${MACHINE_KERNEL_PR}"
+python __anonymous () {
+    machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True)
+
+    if machine_kernel_pr:
+       bb.data.setVar('PR', machine_kernel_pr, d)
+}
 
  export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}"
  export KERNEL_SOURCE = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-source')}"

Actually, we loose PR if MACHINE_KERNEL_PR is not set.

Is this patch fine to solve this problem or is there another prefered way ?

Thanks,
Eric

#2 lore raw

RFC PATCH 1/1 module-base.bbclass: keep PR if MACHINE_KERNEL_PR is not set

In reply to Eric Benard

Hi Koen,

I was told you are the person to contact about MACHINE_KERNEL_PR so may you please have a look to the patch below - also available here : http://patchwork.openembedded.org/patch/2012/

Actually, when compiling modules (out of tree), we loose PR if MACHINE_KERNEL_PR is not set.

Is this patch fine to solve this problem or is there another prefered way ?

The same problem was already solved in kernel.bbclass by the following comit
http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=35e7b34d3b5b96ed11bc7ed6b2a5d08e6183d8a3

Thanks,
Eric

---
  classes/module-base.bbclass |    7 ++++++-
  1 files changed, 6 insertions(+), 1 deletions(-)
classes/module-base.bbclass +6 -1
index bc53e1b..9aaaa4e 100644
@@ -7,7 +7,12 @@ export CROSS_COMPILE = "${TARGET_PREFIX}"
 
  # A machine.conf or local.conf can increase MACHINE_KERNEL_PR to force
  # rebuilds for kernel and external modules
-PR = "${MACHINE_KERNEL_PR}"
+python __anonymous () {
+    machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True)
+
+    if machine_kernel_pr:
+       bb.data.setVar('PR', machine_kernel_pr, d)
+}
 
  export KERNEL_VERSION = 

"${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}"
export KERNEL_SOURCE =
"${@base_read_file('${STAGING_KERNEL_DIR}/kernel-source')}"

#3 lore raw

Op 14 mei 2010, om 17:10 heeft Eric Bénard het volgende geschreven:

Quoted 5 lines

Hi Koen,

I was told you are the person to contact about MACHINE_KERNEL_PR so may you please have a look to the patch below - also available here : http://patchwork.openembedded.org/patch/2012/

Actually, when compiling modules (out of tree), we loose PR if MACHINE_KERNEL_PR is not set.

I don't believe that when MACHINE_KERNEL_PR isn't set people care about PR.

regards,

Koen

#4 lore raw
Quoted 7 lines · Koen Kooi

Op 14 mei 2010, om 17:10 heeft Eric Bénard het volgende geschreven:

Quoted 3 lines

I was told you are the person to contact about MACHINE_KERNEL_PR so may you please have a look to the patch below - also available here : http://patchwork.openembedded.org/patch/2012/

Actually, when compiling modules (out of tree), we loose PR if MACHINE_KERNEL_PR is not set.

I don't believe that when MACHINE_KERNEL_PR isn't set people care about PR.

Does that mean that policy is that MACHINE_KERNEL_PR should be set for every machine ? If yes, maybe this should be added in the doc.

Actually only 7 files (4 machines + 3 include) in conf/machine have this set and conf/bitbake set it to "" as a default so what aboutdoing ?= "r0" in bitbake.conf in order to have a default value as for PR ?

Eric

#5 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 9 lines · Eric Bénard
Quoted 8 lines · Koen Kooi

Op 14 mei 2010, om 17:10 heeft Eric Bénard het volgende geschreven:

Quoted 6 lines

I was told you are the person to contact about MACHINE_KERNEL_PR so may you please have a look to the patch below - also available here :
http://patchwork.openembedded.org/patch/2012/

Actually, when compiling modules (out of tree), we loose PR if MACHINE_KERNEL_PR is not set.

Quoted 6 lines
Quoted 3 lines

I don't believe that when MACHINE_KERNEL_PR isn't set people care about PR.

Does that mean that policy is that MACHINE_KERNEL_PR should be set for every machine ?
If yes, maybe this should be added in the doc.

IMO yes, but some people were against it. Either their kernel never changes or they don't care about out-of-tree modules breaking on kernel changes.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFL7YmVMkyGM64RGpERAsf2AJ45yUaAIVL0HCm7jCfxwkmq9C5gnACfcV8w vGcI7BJka3fCXJJ+RL3Y+Yc=
=RLGB
-----END PGP SIGNATURE-----

#6 lore raw
Quoted 13 lines · Koen Kooi
Quoted 12 lines · Eric Bénard
Quoted 11 lines · Koen Kooi

Op 14 mei 2010, om 17:10 heeft Eric Bénard het volgende geschreven:

Quoted 6 lines

I was told you are the person to contact about MACHINE_KERNEL_PR so may you please have a look to the patch below - also available here :
http://patchwork.openembedded.org/patch/2012/

Actually, when compiling modules (out of tree), we loose PR if MACHINE_KERNEL_PR is not set.

I don't believe that when MACHINE_KERNEL_PR isn't set people care about PR.

Quoted 8 lines
Quoted 3 lines

Does that mean that policy is that MACHINE_KERNEL_PR should be set for every machine ?
If yes, maybe this should be added in the doc.

IMO yes, but some people were against it. Either their kernel never changes or they don't care about out-of-tree modules breaking on kernel changes.

so why not setting r0 as a default in bitbake.conf as a compromise ?

Eric

#7 lore raw
Quoted 1 line · Eric Bénard

so why not setting r0 as a default in bitbake.conf as a compromise ?

A default MACHINE_KERNEL_PR, you mean? That would cause PR to suddenly go backwards for a whole bunch of machines, which would definitely not be a good thing. See the mailing list archive; there was quite a lot of discussion of these kinds of issues at the time that the M_K_PR change was originally landed.

p.

#8 lore raw
Quoted 9 lines · Phil Blundell
Quoted 1 line · Eric Bénard

so why not setting r0 as a default in bitbake.conf as a compromise ?

A default MACHINE_KERNEL_PR, you mean? That would cause PR to suddenly go backwards for a whole bunch of machines, which would definitely not be a good thing. See the mailing list archive; there was quite a lot of discussion of these kinds of issues at the time that the M_K_PR change was originally landed.

yes, in this case MACHINE_KERNEL_PR would overide kernel's PR which is not what we want.

So actually the fix I propose is needed as while MACHINE_KERNEL_PR is not required by policy, module-base.bbclass is broken for machines without MACHINE_KERNEL_PR.

Eric

#9 lore raw
Quoted 3 lines · Eric Bénard

So actually the fix I propose is needed as while MACHINE_KERNEL_PR is not required by policy, module-base.bbclass is broken for machines without MACHINE_KERNEL_PR.

Yes, agreed. I think your fix is the right thing.

p.

#10 lore raw
Quoted 7 lines · Phil Blundell
Quoted 3 lines · Eric Bénard

So actually the fix I propose is needed as while MACHINE_KERNEL_PR is not required by policy, module-base.bbclass is broken for machines without MACHINE_KERNEL_PR.

Yes, agreed. I think your fix is the right thing.

Is this an ack so can I push it ?

Eric

#11 lore raw
Quoted 9 lines · Eric Bénard
Quoted 7 lines · Phil Blundell
Quoted 3 lines · Eric Bénard

So actually the fix I propose is needed as while MACHINE_KERNEL_PR is not required by policy, module-base.bbclass is broken for machines without MACHINE_KERNEL_PR.

Yes, agreed. I think your fix is the right thing.

Is this an ack so can I push it ?

Yes, please go ahead.

p.

#12 lore raw
In reply to Eric Bénard

classes/module-base.bbclass export CROSS_COMPILE = "${TARGET_PREFIX}" · line 15

Quoted 7 lines · Eric Bénard
classes/module-base.bbclass +6 -1
-PR = "${MACHINE_KERNEL_PR}"
+python __anonymous () {
+    machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True)
+
+    if machine_kernel_pr:
+       bb.data.setVar('PR', machine_kernel_pr, d)
+}

Looks reasonable to me. It seems a little bit sad to have this code duplicated in both kernel.bbclass and module-base.bbclass but I guess that is not a very big deal.

p.