Skip to contentSkip to conversation

kernel.bbclass: slightly fix wording, case, and spaces in version check

PATCH In review Enrico Jörns 2 participants 13 messages Feb 27, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 kernel.bbclass: slightly fix wording, case, and spaces in version check

* Version -> version
* match of kernel -> match the kernel
* Add missing spaces around "=" sign

---
 meta/classes-recipe/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel.bbclass +1 -1
index 31e4a683d1..837064cef7 100644
@@ -509,7 +509,7 @@ do_kernel_version_sanity_check() {
 	reg="${reg}${EXTRAVERSION}"
 
 	if [ -z `echo ${PV} | grep -E "${reg}"` ]; then
-		bbfatal "Package Version (${PV}) does not match of kernel being built (${vers}). Please update the PV variable to match the kernel source or set KERNEL_VERSION_SANITY_SKIP=\"1\" in your recipe."
+		bbfatal "Package version (${PV}) does not match the kernel being built (${vers}). Please update the PV variable to match the kernel source or set KERNEL_VERSION_SANITY_SKIP = \"1\" in your recipe."
 	fi
 	exit 0
 }
Signature · 1 line
2.39.2
#1 lore raw

PATCH 2/3 kernel-yocto.bblass: run kernel_version_sanity_check after do_patch

The kernel patches may modify the kernel version, thus wait for do_patch before running the version check.

---
 meta/classes-recipe/kernel-yocto.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel-yocto.bbclass +1 -1
index 108b7e6752..854e4681d5 100644
@@ -729,6 +729,6 @@ python () {
 }
 
 # extra tasks
-addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before do_compile
+addtask kernel_version_sanity_check after do_patch before do_compile
 addtask validate_branches before do_patch after do_kernel_checkout
 addtask kernel_configcheck after do_configure before do_compile
Signature · 1 line
2.39.2
#2 lore raw

Re: [PATCH 2/3] kernel-yocto.bblass: run kernel_version_sanity_check after do_patch

Quoted 3 lines · Enrico Jörns

The kernel patches may modify the kernel version, thus wait for do_patch before running the version check.

While that may be true for kernel's in general, I sincerely hope that no one is patching in a new kernel version to linux-yocto.

I don't have any great concerns with the patch, I just don't think it is necessary :)

Bruce

Quoted 21 lines
---
 meta/classes-recipe/kernel-yocto.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel-yocto.bbclass +1 -2
index 108b7e6752..854e4681d5 100644
@@ -729,6 +729,6 @@ python () {
 }
 
 # extra tasks
-addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before do_compile
+addtask kernel_version_sanity_check after do_patch before do_compile
 addtask validate_branches before do_patch after do_kernel_checkout
 addtask kernel_configcheck after do_configure before do_compile
--

2.39.2

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#3 lore raw

Re: [PATCH 2/3] kernel-yocto.bblass: run kernel_version_sanity_check after do_patch

Am Dienstag, dem 27.02.2024 um 12:36 -0500 schrieb Bruce Ashfield:

Quoted 10 lines · Enrico Jörns
Quoted 3 lines

The kernel patches may modify the kernel version, thus wait for do_patch before running the version check.

While that may be true for kernel's in general, I sincerely hope that no one is patching in a new kernel version to linux-yocto.

I don't have any great concerns with the patch, I just don't think it is necessary :)

Yes, the use case is actually not linux-yocto itself.
Thus it might be most relevant in combination with moving the version check to kernel.bbclass.

How I actually came across this check is that (in some projects) we use the linux-yocto.bbclass for non-linux-yocto kernels since some functionality (especially fragment handling) seems useful in general.

I am still unsure if I should try to move (or duplicate) the required features in the generic kernel.bbclass or if using linux-yocto.bbclass for 'mainline' kernel is an appropriate use case..?

Regards, Enrico

Quoted 26 lines

Bruce

Quoted 22 lines

---
 meta/classes-recipe/kernel-yocto.bbclass | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel-yocto.bbclass +0 -1
index 108b7e6752..854e4681d5 100644
@@ -729,6 +729,6 @@ python () {
  }
 
  # extra tasks
-addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before

do_compile
+addtask kernel_version_sanity_check after do_patch before do_compile addtask validate_branches before do_patch after do_kernel_checkout addtask kernel_configcheck after do_configure before do_compile --
2.39.2

Signature · 4 lines
Pengutronix e.K.                           | Enrico Jörns                |
Embedded Linux Consulting & Support        | https://www.pengutronix.de/ |
Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  |
31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |
#4 lore raw

Re: [PATCH 2/3] kernel-yocto.bblass: run kernel_version_sanity_check after do_patch

Quoted 16 lines · Enrico Jörns

Am Dienstag, dem 27.02.2024 um 12:36 -0500 schrieb Bruce Ashfield:

Quoted 10 lines · Enrico Jörns
Quoted 3 lines

The kernel patches may modify the kernel version, thus wait for do_patch before running the version check.

While that may be true for kernel's in general, I sincerely hope that no one is patching in a new kernel version to linux-yocto.

I don't have any great concerns with the patch, I just don't think it is necessary :)

Yes, the use case is actually not linux-yocto itself.
Thus it might be most relevant in combination with moving the version check to kernel.bbclass.

Quoted 7 lines

How I actually came across this check is that (in some projects) we use the linux-yocto.bbclass for non-linux-yocto kernels since some functionality (especially fragment handling) seems useful in general.

I am still unsure if I should try to move (or duplicate) the required features in the generic kernel.bbclass or if using linux-yocto.bbclass for 'mainline' kernel is an appropriate use case..?

There's no need to use the linux-yocto repository when using kernel-yocto bbclass, so
definitely, it is an acceptable use case. In fact meta-mainline, and linux-yocto themselves
are both using kernel-yocto bbclass to build mainline/-stable kernels.

I'd rather not move the kernel-yocto bits into kernel.bbclass, since if that was something
easily done .. I would have done it a long time ago.

Keeping the split in the functionality allows those that don't care about linux-yocto to
keep their recipes and workflow the same, and those that want to opt into the kernel-yocto
functionality can just inherit the class.

Bruce

Quoted 35 lines

Regards, Enrico

Quoted 15 lines

Bruce

Quoted 13 lines
---
 meta/classes-recipe/kernel-yocto.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel-yocto.bbclass +0 -0
index 108b7e6752..854e4681d5 100644
@@ -729,6 +729,6 @@ python () {
 }
 
Quoted 11 lines
Quoted 9 lines
meta/classes-recipe/kernel-yocto.bbclass +0 -1
 # extra tasks
-addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before

do_compile
+addtask kernel_version_sanity_check after do_patch before do_compile
addtask validate_branches before do_patch after do_kernel_checkout addtask kernel_configcheck after do_configure before do_compile
--
2.39.2

--

Pengutronix e.K.                           | Enrico Jörns                |
Embedded Linux Consulting & Support        | https://www.pengutronix.de/ |
Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  |
31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#5 lore raw

Re: [PATCH 2/3] kernel-yocto.bblass: run kernel_version_sanity_check after do_patch

Am Dienstag, dem 27.02.2024 um 14:13 -0500 schrieb Bruce Ashfield:

Quoted 37 lines · Enrico Jörns
Quoted 16 lines

Am Dienstag, dem 27.02.2024 um 12:36 -0500 schrieb Bruce Ashfield:

Quoted 10 lines · Enrico Jörns
Quoted 3 lines

The kernel patches may modify the kernel version, thus wait for do_patch before running the version check.

While that may be true for kernel's in general, I sincerely hope that no one is patching in a new kernel version to linux-yocto.

I don't have any great concerns with the patch, I just don't think it is necessary :)

Yes, the use case is actually not linux-yocto itself.
Thus it might be most relevant in combination with moving the version check to kernel.bbclass.

Quoted 9 lines

How I actually came across this check is that (in some projects) we use the linux-yocto.bbclass for
non-linux-yocto kernels since some functionality (especially fragment handling) seems useful in general.

I am still unsure if I should try to move (or duplicate) the required features in the generic kernel.bbclass or if using linux-yocto.bbclass for 'mainline' kernel is an appropriate use case..?

There's no need to use the linux-yocto repository when using kernel-yocto bbclass, so
definitely, it is an acceptable use case. In fact meta-mainline, and linux-yocto themselves
are both using kernel-yocto bbclass to build mainline/-stable kernels.

I'd rather not move the kernel-yocto bits into kernel.bbclass, since if that was something
easily done .. I would have done it a long time ago.

Quoted 5 lines

Keeping the split in the functionality allows those that don't care about linux-yocto to
keep their recipes and workflow the same, and those that want to opt into the kernel-yocto
functionality can just inherit the class.

Yes, I wouldn't move the meta data handling and its tricky pieces, since this is actually something I see in kernel-yocto.bbclass, too.

But.. do you have an opinion on adding simple config fragment handling in kernel.bbclass (like we have in busybox or u-boot)? So mainly calling merge_config.sh somewhere around do_configure. (It would however need to be compatible with (or replaced by) the more advanced handling in kernel- yocto.bbclass.)

Enrico

Quoted 41 lines

Bruce

Quoted 36 lines

Regards, Enrico

Quoted 16 lines

Bruce

Quoted 14 lines

---
 meta/classes-recipe/kernel-yocto.bbclass | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel- renamed from meta/classes-recipe/kernel-yocto.bbclass +0 -0

yocto.bbclass
index 108b7e6752..854e4681d5 100644

meta/classes-recipe/kernel-yocto.bbclass +0 -0
@@ -729,6 +729,6 @@ python () {
  }
 
Quoted 11 lines
Quoted 9 lines
meta/classes-recipe/kernel-yocto.bbclass +0 -1
  # extra tasks
-addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before

do_compile
+addtask kernel_version_sanity_check after do_patch before do_compile addtask validate_branches before do_patch after do_kernel_checkout addtask kernel_configcheck after do_configure before do_compile --
2.39.2

--
Pengutronix e.K.                           | Enrico Jörns                | Embedded Linux Consulting & Support        | https://www.pengutronix.de/ | Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  | 31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |

Signature · 4 lines
Pengutronix e.K.                           | Enrico Jörns                |
Embedded Linux Consulting & Support        | https://www.pengutronix.de/ |
Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  |
31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |
#6 lore raw

Re: [PATCH 2/3] kernel-yocto.bblass: run kernel_version_sanity_check after do_patch

Quoted 45 lines · Enrico Jörns

Am Dienstag, dem 27.02.2024 um 14:13 -0500 schrieb Bruce Ashfield:

Quoted 37 lines · Enrico Jörns
Quoted 16 lines

Am Dienstag, dem 27.02.2024 um 12:36 -0500 schrieb Bruce Ashfield:

Quoted 10 lines · Enrico Jörns
Quoted 3 lines

The kernel patches may modify the kernel version, thus wait for do_patch before running the version check.

While that may be true for kernel's in general, I sincerely hope that no one is patching in a new kernel version to linux-yocto.

I don't have any great concerns with the patch, I just don't think it is necessary :)

Yes, the use case is actually not linux-yocto itself.
Thus it might be most relevant in combination with moving the version check to kernel.bbclass.

Quoted 9 lines

How I actually came across this check is that (in some projects) we use the linux-yocto.bbclass for
non-linux-yocto kernels since some functionality (especially fragment handling) seems useful in general.

I am still unsure if I should try to move (or duplicate) the required features in the generic kernel.bbclass or if using linux-yocto.bbclass for 'mainline' kernel is an appropriate use case..?

There's no need to use the linux-yocto repository when using kernel-yocto bbclass, so
definitely, it is an acceptable use case. In fact meta-mainline, and linux-yocto themselves
are both using kernel-yocto bbclass to build mainline/-stable kernels.

I'd rather not move the kernel-yocto bits into kernel.bbclass, since if that was something
easily done .. I would have done it a long time ago.

Quoted 5 lines

Keeping the split in the functionality allows those that don't care about linux-yocto to
keep their recipes and workflow the same, and those that want to opt into the kernel-yocto
functionality can just inherit the class.

Quoted 7 lines

Yes, I wouldn't move the meta data handling and its tricky pieces, since this is actually something I see in kernel-yocto.bbclass, too.

But.. do you have an opinion on adding simple config fragment handling in kernel.bbclass (like we have in busybox or u-boot)? So mainly calling merge_config.sh somewhere around do_configure. (It would however need to be compatible with (or replaced by) the more advanced handling in kernel- yocto.bbclass.)

I do have a very strong opinion.

If we were going to do that, I also would have done it many years ago.

Having some, but not all of the meta-data and merging split between the classes would be a disaster.

If there's something that the meta-data handling is doing in kernel-yocto bbclass that isn't working or isn't appropriate, we can fix it there.

Other layers and classes in those layers are of course free to do whatever they want, but we need to be consistent in core.

In fact, I've had a bug and a prototype patch for many years now that does move some of the configuration merging to kernel.bbclass, but it only increases complexity and doesn't offer any benefits .. again, since if there's something wrong with the fragment gathering and merging in the kernel-yocto bbclass that makes it not broadly applicable, we need to fix it there, not make things more complex and confusing by arbitrarily splitting it into something unmaintainable.

Bruce

Quoted 51 lines

Enrico

Quoted 41 lines

Bruce

Quoted 36 lines

Regards, Enrico

Quoted 16 lines

Bruce

Quoted 14 lines
---
 meta/classes-recipe/kernel-yocto.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel- renamed from meta/classes-recipe/kernel-yocto.bbclass +0 -0

yocto.bbclass
index 108b7e6752..854e4681d5 100644

meta/classes-recipe/kernel-yocto.bbclass +0 -0
@@ -729,6 +729,6 @@ python () {
 }
 
Quoted 11 lines
Quoted 9 lines
meta/classes-recipe/kernel-yocto.bbclass +0 -1
 # extra tasks
-addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before

do_compile
+addtask kernel_version_sanity_check after do_patch before do_compile
addtask validate_branches before do_patch after do_kernel_checkout addtask kernel_configcheck after do_configure before do_compile
--
2.39.2

--

Pengutronix e.K.                           | Enrico Jörns                |
Embedded Linux Consulting & Support        | https://www.pengutronix.de/ |
Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  |
31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |

--

Pengutronix e.K.                           | Enrico Jörns                |
Embedded Linux Consulting & Support        | https://www.pengutronix.de/ |
Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  |
31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#7 lore raw

Re: [PATCH 2/3] kernel-yocto.bblass: run kernel_version_sanity_check after do_patch

Am Dienstag, dem 27.02.2024 um 14:46 -0500 schrieb Bruce Ashfield:

Quoted 61 lines · Enrico Jörns
Quoted 53 lines

Am Dienstag, dem 27.02.2024 um 14:13 -0500 schrieb Bruce Ashfield:

Quoted 41 lines · Enrico Jörns
Quoted 24 lines

Am Dienstag, dem 27.02.2024 um 12:36 -0500 schrieb Bruce Ashfield:

Quoted 10 lines · Enrico Jörns
Quoted 3 lines

The kernel patches may modify the kernel version, thus wait for do_patch before running the version check.

While that may be true for kernel's in general, I sincerely hope that no one is patching in a new kernel version to linux-yocto.

I don't have any great concerns with the patch, I just don't think it is necessary :)

Yes, the use case is actually not linux-yocto itself.
Thus it might be most relevant in combination with moving the version check to kernel.bbclass.

How I actually came across this check is that (in some projects) we use the linux- yocto.bbclass
for
non-linux-yocto kernels since some functionality (especially fragment handling) seems useful in
general.

Quoted 5 lines

I am still unsure if I should try to move (or duplicate) the required features in the generic
kernel.bbclass or if using linux-yocto.bbclass for 'mainline' kernel is an appropriate use case..?

There's no need to use the linux-yocto repository when using kernel-yocto bbclass, so
definitely, it is an acceptable use case. In fact meta-mainline, and linux-yocto themselves
are both using kernel-yocto bbclass to build mainline/-stable kernels.

I'd rather not move the kernel-yocto bits into kernel.bbclass, since if that was something
easily done .. I would have done it a long time ago.

Quoted 5 lines

Keeping the split in the functionality allows those that don't care about linux-yocto to
keep their recipes and workflow the same, and those that want to opt into the kernel-yocto
functionality can just inherit the class.

Yes, I wouldn't move the meta data handling and its tricky pieces, since this is actually something
I see in kernel-yocto.bbclass, too.

Quoted 6 lines

But.. do you have an opinion on adding simple config fragment handling in kernel.bbclass (like we
have in busybox or u-boot)? So mainly calling merge_config.sh somewhere around do_configure. (It would however need to be compatible with (or replaced by) the more advanced handling in kernel-
yocto.bbclass.)

Quoted 6 lines

I do have a very strong opinion.

If we were going to do that, I also would have done it many years ago.

Having some, but not all of the meta-data and merging split between the classes would be a disaster.

I would not call config fragments 'meta-data' and was thinking more about something that is replaced by kernel-yocto.bbclass. That a split of meta-data handling would be a disaster is something I would agree on.

Quoted 2 lines

If there's something that the meta-data handling is doing in kernel-yocto bbclass that isn't working or isn't appropriate, we can fix it there.

Ok, if the opinion is that strong, than this is the way to go for me first of all. (However, I do not have any meta-data in mind in our use case anyway.)

Quoted 2 lines

Other layers and classes in those layers are of course free to do whatever they want, but we need to be consistent in core.

Clear.

Quoted 7 lines

In fact, I've had a bug and a prototype patch for many years now that does move some of the configuration merging to kernel.bbclass, but it only increases complexity and doesn't offer any benefits .. again, since if there's something wrong with the fragment gathering and merging in the kernel-yocto bbclass that makes it not broadly applicable, we need to fix it there, not make things more complex and confusing by arbitrarily splitting it into something unmaintainable.

Keeping it maintainable should be the primary goal, indeed!
I would not call it 'arbitrarily splitting' but at a well-defined point (*no* meta-data vs. meta- data), but if you have already tried to do a proper split I'd keep this as a good hint first of all that the topic is quite tricky.

Thanks for sharing your opinions on that 🙂

Enrico

Quoted 56 lines

Bruce

Quoted 51 lines

Enrico

Quoted 41 lines

Bruce

Quoted 36 lines

Regards, Enrico

Quoted 16 lines

Bruce

Quoted 14 lines

---
 meta/classes-recipe/kernel-yocto.bbclass | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel- renamed from meta/classes-recipe/kernel-yocto.bbclass +0 -0

yocto.bbclass
index 108b7e6752..854e4681d5 100644

meta/classes-recipe/kernel-yocto.bbclass +0 -0
@@ -729,6 +729,6 @@ python () {
  }
 
Quoted 11 lines
Quoted 9 lines
meta/classes-recipe/kernel-yocto.bbclass +0 -1
  # extra tasks
-addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before

do_compile
+addtask kernel_version_sanity_check after do_patch before do_compile addtask validate_branches before do_patch after do_kernel_checkout addtask kernel_configcheck after do_configure before do_compile --
2.39.2

--
Pengutronix e.K.                           | Enrico Jörns                | Embedded Linux Consulting & Support        | https://www.pengutronix.de/ | Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  | 31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |

--
Pengutronix e.K.                           | Enrico Jörns                | Embedded Linux Consulting & Support        | https://www.pengutronix.de/ | Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  | 31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |

Signature · 4 lines
Pengutronix e.K.                           | Enrico Jörns                |
Embedded Linux Consulting & Support        | https://www.pengutronix.de/ |
Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  |
31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |
#8 lore raw

Re: [PATCH 2/3] kernel-yocto.bblass: run kernel_version_sanity_check after do_patch

Quoted 65 lines · Enrico Jörns

Am Dienstag, dem 27.02.2024 um 14:46 -0500 schrieb Bruce Ashfield:

Quoted 63 lines · Enrico Jörns
Quoted 53 lines

Am Dienstag, dem 27.02.2024 um 14:13 -0500 schrieb Bruce Ashfield:

Quoted 41 lines · Enrico Jörns
Quoted 24 lines

Am Dienstag, dem 27.02.2024 um 12:36 -0500 schrieb Bruce Ashfield:

Quoted 10 lines · Enrico Jörns
Quoted 3 lines

The kernel patches may modify the kernel version, thus wait for do_patch before running the version check.

While that may be true for kernel's in general, I sincerely hope that no one is patching in a new kernel version to linux-yocto.

I don't have any great concerns with the patch, I just don't think it is necessary :)

Yes, the use case is actually not linux-yocto itself.
Thus it might be most relevant in combination with moving the version check to kernel.bbclass.

How I actually came across this check is that (in some projects) we use the linux- yocto.bbclass
for
non-linux-yocto kernels since some functionality (especially fragment handling) seems useful in
general.

Quoted 5 lines

I am still unsure if I should try to move (or duplicate) the required features in the generic
kernel.bbclass or if using linux-yocto.bbclass for 'mainline' kernel is an appropriate use case..?

There's no need to use the linux-yocto repository when using kernel-yocto bbclass, so
definitely, it is an acceptable use case. In fact meta-mainline, and linux-yocto themselves
are both using kernel-yocto bbclass to build mainline/-stable kernels.

I'd rather not move the kernel-yocto bits into kernel.bbclass, since if that was something
easily done .. I would have done it a long time ago.

Quoted 5 lines

Keeping the split in the functionality allows those that don't care about linux-yocto to
keep their recipes and workflow the same, and those that want to opt into the kernel-yocto
functionality can just inherit the class.

Yes, I wouldn't move the meta data handling and its tricky pieces, since this is actually something
I see in kernel-yocto.bbclass, too.

Quoted 6 lines

But.. do you have an opinion on adding simple config fragment handling in kernel.bbclass (like we
have in busybox or u-boot)? So mainly calling merge_config.sh somewhere around do_configure. (It would however need to be compatible with (or replaced by) the more advanced handling in kernel-
yocto.bbclass.)

I do have a very strong opinion.

Quoted 8 lines
Quoted 4 lines

If we were going to do that, I also would have done it many years ago.

Having some, but not all of the meta-data and merging split between the classes would be a disaster.

I would not call config fragments 'meta-data' and was thinking more about something that is replaced by kernel-yocto.bbclass. That a split of meta-data handling would be a disaster is something I would agree on.

That is what we've always called them, because it isn't just the fragments that are the important part, it is the common nature of the fragments (the actual merge_config upstreamining is something that grew out of what we have, and I participated in the effort).

The fragments abstract and describe the feature and carry information about how they should be applied (and in theory, are used along with the patches), hence the "meta" information they carry.

By keeping the official support in kernel-yocto, and leveraging the kernel-cache as the common location for the fragments, we've been gathering / consolidating for 10 years now. If fragments end up sprayed everywhere (which they still can, even with the kernel-yocto centre of mass), then really we haven't done much else besides whacking some text files into a larger text file.

Quoted 20 lines
Quoted 3 lines

If there's something that the meta-data handling is doing in kernel-yocto bbclass that isn't working or isn't appropriate, we can fix it there.

Ok, if the opinion is that strong, than this is the way to go for me first of all. (However, I do not have any meta-data in mind in our use case anyway.)

Quoted 2 lines

Other layers and classes in those layers are of course free to do whatever they want, but we need to be consistent in core.

Clear.

Quoted 7 lines

In fact, I've had a bug and a prototype patch for many years now that does move some of the configuration merging to kernel.bbclass, but it only increases complexity and doesn't offer any benefits .. again, since if there's something wrong with the fragment gathering and merging in the kernel-yocto bbclass that makes it not broadly applicable, we need to fix it there, not make things more complex and confusing by arbitrarily splitting it into something unmaintainable.

Quoted 4 lines

Keeping it maintainable should be the primary goal, indeed!
I would not call it 'arbitrarily splitting' but at a well-defined point (*no* meta-data vs. meta- data), but if you have already tried to do a proper split I'd keep this as a good hint first of all that the topic is quite tricky.

If the merging happens in one place, the fragments coming from another and the audit of the results living in a 3rd, then we are definitely splitting things and making it more complex than it already is.

If there really is something causing issues in the kernel-yocto implementation, then that's where I'm interested in seeing what the issues are, and how we can fix it.

Bruce

Quoted 67 lines

Thanks for sharing your opinions on that 🙂

Enrico

Quoted 56 lines

Bruce

Quoted 51 lines

Enrico

Quoted 41 lines

Bruce

Quoted 36 lines

Regards, Enrico

Quoted 16 lines

Bruce

Quoted 14 lines
---
 meta/classes-recipe/kernel-yocto.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel- renamed from meta/classes-recipe/kernel-yocto.bbclass +0 -0

yocto.bbclass
index 108b7e6752..854e4681d5 100644

meta/classes-recipe/kernel-yocto.bbclass +0 -0
@@ -729,6 +729,6 @@ python () {
 }
 
Quoted 11 lines
Quoted 9 lines
meta/classes-recipe/kernel-yocto.bbclass +0 -1
 # extra tasks
-addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before

do_compile
+addtask kernel_version_sanity_check after do_patch before do_compile
addtask validate_branches before do_patch after do_kernel_checkout addtask kernel_configcheck after do_configure before do_compile
--
2.39.2

--

Pengutronix e.K.                           | Enrico Jörns                |
Embedded Linux Consulting & Support        | https://www.pengutronix.de/ |
Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  |
31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |

--

Pengutronix e.K.                           | Enrico Jörns                |
Embedded Linux Consulting & Support        | https://www.pengutronix.de/ |
Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  |
31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |

--

Pengutronix e.K.                           | Enrico Jörns                |
Embedded Linux Consulting & Support        | https://www.pengutronix.de/ |
Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  |
31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#9 lore raw

PATCH 3/3 kernel.bbclass: use kernel_version_sanity_check where defined

In reply to Enrico Jörns

The task 'do_kernel_version_sanity_check' was defined in kernel.bbclass but used in kernel-yocto.bbclass only.

Since the task does not depend on any kernel-yocto-specific task (anymore), move it to the kernel.bbclass so the check can run for all kernels.

If it turns out that this causes too many noise for people that are not interested in a consistency between ${PV} and the kernel version, an option could be to let KERNEL_VERSION_SANITY_SKIP weakly default to "1" in kernel.bbclass or alternatively move the entire code to kernel-yocto.bbclass.

---
 meta/classes-recipe/kernel-yocto.bbclass | 1 -
 meta/classes-recipe/kernel.bbclass       | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
meta/classes-recipe/kernel-yocto.bbclass +0 -1
index 854e4681d5..b7d74b7ab8 100644
@@ -729,6 +729,5 @@ python () {
 }
 
 # extra tasks
-addtask kernel_version_sanity_check after do_patch before do_compile
 addtask validate_branches before do_patch after do_kernel_checkout
 addtask kernel_configcheck after do_configure before do_compile
meta/classes-recipe/kernel.bbclass +2 -0
index 837064cef7..3c805fd96f 100644
@@ -514,6 +514,8 @@ do_kernel_version_sanity_check() {
 	exit 0
 }
 
+addtask kernel_version_sanity_check after do_patch before do_compile
+
 addtask shared_workdir after do_compile before do_compile_kernelmodules
 addtask shared_workdir_setscene
 
Signature · 1 line
2.39.2
#10 lore raw

Re: [PATCH 3/3] kernel.bbclass: use kernel_version_sanity_check where defined

Quoted 8 lines · Enrico Jörns

The task 'do_kernel_version_sanity_check' was defined in kernel.bbclass but used in kernel-yocto.bbclass only.

Since the task does not depend on any kernel-yocto-specific task (anymore), move it to the kernel.bbclass so the check can run for all kernels.

Quoted 5 lines

If it turns out that this causes too many noise for people that are not interested in a consistency between ${PV} and the kernel version, an option could be to let KERNEL_VERSION_SANITY_SKIP weakly default to "1" in kernel.bbclass or alternatively move the entire code to kernel-yocto.bbclass.

The check is actually quite annoying / noisy when working on updating a kernel.

So we may get complaints :)

Again, I don't have a strong opinion, since the functionality is unchanged for linux-yocto

Bruce

Quoted 34 lines
---
 meta/classes-recipe/kernel-yocto.bbclass | 1 -
 meta/classes-recipe/kernel.bbclass       | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
meta/classes-recipe/kernel-yocto.bbclass +0 -1
index 854e4681d5..b7d74b7ab8 100644
@@ -729,6 +729,5 @@ python () {
 }
 
 # extra tasks
-addtask kernel_version_sanity_check after do_patch before do_compile
 addtask validate_branches before do_patch after do_kernel_checkout
 addtask kernel_configcheck after do_configure before do_compile
meta/classes-recipe/kernel.bbclass +2 -1
index 837064cef7..3c805fd96f 100644
@@ -514,6 +514,8 @@ do_kernel_version_sanity_check() {
        exit 0
 }
 
+addtask kernel_version_sanity_check after do_patch before do_compile
+
 addtask shared_workdir after do_compile before do_compile_kernelmodules
 addtask shared_workdir_setscene
 
--

2.39.2

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#11 lore raw
In reply to Enrico Jörns
Quoted 4 lines · Enrico Jörns

* Version -> version
* match of kernel -> match the kernel
* Add missing spaces around "=" sign

There's nothing technically wrong with the missing spaces. Putting the assignment in a recipe with or without the spaces should work.

Bruce

Quoted 22 lines
---
 meta/classes-recipe/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel.bbclass +1 -2
index 31e4a683d1..837064cef7 100644
@@ -509,7 +509,7 @@ do_kernel_version_sanity_check() {
        reg="${reg}${EXTRAVERSION}"
 
        if [ -z `echo ${PV} | grep -E "${reg}"` ]; then
-               bbfatal "Package Version (${PV}) does not match of kernel being built (${vers}). Please update the PV variable to match the kernel source or set KERNEL_VERSION_SANITY_SKIP=\"1\" in your recipe."
+               bbfatal "Package version (${PV}) does not match the kernel being built (${vers}). Please update the PV variable to match the kernel source or set KERNEL_VERSION_SANITY_SKIP = \"1\" in your recipe."
        fi
        exit 0
 }
--

2.39.2

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#12 lore raw

Am Dienstag, dem 27.02.2024 um 12:37 -0500 schrieb Bruce Ashfield:

Quoted 8 lines · Enrico Jörns
Quoted 4 lines

* Version -> version
* match of kernel -> match the kernel
* Add missing spaces around "=" sign

There's nothing technically wrong with the missing spaces. Putting the assignment in a recipe with or without the spaces should work.

Right, it's more about being consistent with the oe 'coding style' of assigning variables 😉

Enrico

Quoted 30 lines

Bruce

Quoted 26 lines

---
 meta/classes-recipe/kernel.bbclass | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel.bbclass +0 -0
index 31e4a683d1..837064cef7 100644
@@ -509,7 +509,7 @@ do_kernel_version_sanity_check() {

        reg="${reg}${EXTRAVERSION}"

        if [ -z echo ${PV} | grep -E "${reg}" ]; then
-               bbfatal "Package Version (${PV}) does not match of kernel being built (${vers}). Please update the PV variable to match the kernel source or set KERNEL_VERSION_SANITY_SKIP=\"1\" in your recipe."
+               bbfatal "Package version (${PV}) does not match the kernel being built (${vers}). Please update the PV variable to match the kernel source or set KERNEL_VERSION_SANITY_SKIP = \"1\" in your recipe."
        fi
        exit 0
 }
--
2.39.2

Signature · 4 lines
Pengutronix e.K.                           | Enrico Jörns                |
Embedded Linux Consulting & Support        | https://www.pengutronix.de/ |
Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  |
31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |