Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] kernel-grub.bbclass: use KERNEL_PACKAGE_NAME for the image packages
@ 2026-10-29  6:09 Prasanth R
  2026-10-29 13:11 ` Bruce Ashfield
  2026-11-12 13:15 ` [OE-core] " Richard Purdie
  0 siblings, 2 replies; 5+ messages in thread
From: Prasanth R @ 2026-10-29  6:09 UTC (permalink / raw)
  To: openembedded-core; +Cc: bruce.ashfield, Prasanth R

kernel-grub adds its scriptlets to kernel-image-<type>, but kernel.bbclass
names these packages ${KERNEL_PACKAGE_NAME}-image-<type>. With another
KERNEL_PACKAGE_NAME the scriptlets go to a package that does not exist,
so they never run and the GRUB menu is not updated on a kernel upgrade.

Use KERNEL_PACKAGE_NAME, as kernel.bbclass and linux-dummy.bbclass do.

AI-Generated: Uses Claude
Signed-off-by: Prasanth R <prasanth.r@lineo.co.jp>
---

Notes:
    Checked with bitbake -e: with KERNEL_PACKAGE_NAME set, the GRUB
    scriptlets were set on kernel-image-<type>, which is not in PACKAGES. With this
    patch they are on <KERNEL_PACKAGE_NAME>-image-<type>; the default is unchanged.

 meta/classes-recipe/kernel-grub.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes-recipe/kernel-grub.bbclass b/meta/classes-recipe/kernel-grub.bbclass
index 2325e635e1..7c6abc5b4f 100644
--- a/meta/classes-recipe/kernel-grub.bbclass
+++ b/meta/classes-recipe/kernel-grub.bbclass
@@ -98,6 +98,7 @@ python __anonymous () {
 	fi
 '''
 
+    kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
     imagetypes = d.getVar('KERNEL_IMAGETYPES')
     imagetypes = re.sub(r'\.gz$', '', imagetypes)
 
@@ -105,7 +106,7 @@ python __anonymous () {
         typelower = type.lower()
         preinst_append = preinst.replace('KERNEL_IMAGETYPE', type)
         postinst_prepend = postinst.replace('KERNEL_IMAGETYPE', type)
-        d.setVar('pkg_preinst:kernel-image-' + typelower + ':append', preinst_append)
-        d.setVar('pkg_postinst:kernel-image-' + typelower + ':prepend', postinst_prepend)
+        d.setVar('pkg_preinst:%s-image-%s:append' % (kname, typelower), preinst_append)
+        d.setVar('pkg_postinst:%s-image-%s:prepend' % (kname, typelower), postinst_prepend)
 }
 
-- 
2.34.1


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

* Re: [PATCH] kernel-grub.bbclass: use KERNEL_PACKAGE_NAME for the image packages
  2026-10-29  6:09 [PATCH] kernel-grub.bbclass: use KERNEL_PACKAGE_NAME for the image packages Prasanth R
@ 2026-10-29 13:11 ` Bruce Ashfield
  2026-11-04  0:27   ` Prasanth Ramesh
  2026-11-12 13:15 ` [OE-core] " Richard Purdie
  1 sibling, 1 reply; 5+ messages in thread
From: Bruce Ashfield @ 2026-10-29 13:11 UTC (permalink / raw)
  To: Prasanth R; +Cc: openembedded-core, prasanth.r

On Thu, Oct 29, 2026 at 2:09 AM Prasanth R <ragaprasanth@gmail.com> wrote:
>
> kernel-grub adds its scriptlets to kernel-image-<type>, but kernel.bbclass
> names these packages ${KERNEL_PACKAGE_NAME}-image-<type>. With another
> KERNEL_PACKAGE_NAME the scriptlets go to a package that does not exist,
> so they never run and the GRUB menu is not updated on a kernel upgrade.
>
> Use KERNEL_PACKAGE_NAME, as kernel.bbclass and linux-dummy.bbclass do.
>
[...]
>
> +    kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"

Minor: the 'or "kernel"' isn't needed, since kernel.bbclass already
defaults KERNEL_PACKAGE_NAME with ??=. It's harmless though, so I'm
fine with it as-is.

Acked-by: Bruce Ashfield <bruce.ashfield@gmail.com>

Bruce

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

* Re: [PATCH] kernel-grub.bbclass: use KERNEL_PACKAGE_NAME for the image packages
  2026-10-29 13:11 ` Bruce Ashfield
@ 2026-11-04  0:27   ` Prasanth Ramesh
  2026-11-04 15:15     ` Mathieu Dubois-Briand
  0 siblings, 1 reply; 5+ messages in thread
From: Prasanth Ramesh @ 2026-11-04  0:27 UTC (permalink / raw)
  To: mathieu.dubois-briand; +Cc: Bruce Ashfield, openembedded-core, prasanth.r

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]

Hi Mathieu,

I see the kernel.bbclass v2 and kernel-grub patches are both marked
“Changes Requested” in patchwork.
Bruce acked both. Are there any issues to look into?

Thanks,
Prasanth R


On Thu, Oct 29, 2026 at 10:11 PM Bruce Ashfield <bruce.ashfield@gmail.com>
wrote:

> On Thu, Oct 29, 2026 at 2:09 AM Prasanth R <ragaprasanth@gmail.com> wrote:
> >
> > kernel-grub adds its scriptlets to kernel-image-<type>, but
> kernel.bbclass
> > names these packages ${KERNEL_PACKAGE_NAME}-image-<type>. With another
> > KERNEL_PACKAGE_NAME the scriptlets go to a package that does not exist,
> > so they never run and the GRUB menu is not updated on a kernel upgrade.
> >
> > Use KERNEL_PACKAGE_NAME, as kernel.bbclass and linux-dummy.bbclass do.
> >
> [...]
> >
> > +    kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
>
> Minor: the 'or "kernel"' isn't needed, since kernel.bbclass already
> defaults KERNEL_PACKAGE_NAME with ??=. It's harmless though, so I'm
> fine with it as-is.
>
> Acked-by: Bruce Ashfield <bruce.ashfield@gmail.com>
>
> Bruce
>

[-- Attachment #2: Type: text/html, Size: 1866 bytes --]

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

* Re: [PATCH] kernel-grub.bbclass: use KERNEL_PACKAGE_NAME for the image packages
  2026-11-04  0:27   ` Prasanth Ramesh
@ 2026-11-04 15:15     ` Mathieu Dubois-Briand
  0 siblings, 0 replies; 5+ messages in thread
From: Mathieu Dubois-Briand @ 2026-11-04 15:15 UTC (permalink / raw)
  To: Prasanth Ramesh; +Cc: Bruce Ashfield, openembedded-core, prasanth.r

On Wed Nov 4, 2026 at 1:27 AM CET, Prasanth Ramesh wrote:
> Hi Mathieu,
>
> I see the kernel.bbclass v2 and kernel-grub patches are both marked
> “Changes Requested” in patchwork.
> Bruce acked both. Are there any issues to look into?
>
> Thanks,
> Prasanth R
>

Hi Prasanth,

This commit raised some discussion during Monday review session. You
should be getting some feedback soon.

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

* Re: [OE-core] [PATCH] kernel-grub.bbclass: use KERNEL_PACKAGE_NAME for the image packages
  2026-10-29  6:09 [PATCH] kernel-grub.bbclass: use KERNEL_PACKAGE_NAME for the image packages Prasanth R
  2026-10-29 13:11 ` Bruce Ashfield
@ 2026-11-12 13:15 ` Richard Purdie
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2026-11-12 13:15 UTC (permalink / raw)
  To: ragaprasanth, openembedded-core; +Cc: bruce.ashfield

On Thu, 2026-10-29 at 15:09 +0900, prasanth via lists.openembedded.org wrote:
> kernel-grub adds its scriptlets to kernel-image-<type>, but kernel.bbclass
> names these packages ${KERNEL_PACKAGE_NAME}-image-<type>. With another
> KERNEL_PACKAGE_NAME the scriptlets go to a package that does not exist,
> so they never run and the GRUB menu is not updated on a kernel upgrade.
> 
> Use KERNEL_PACKAGE_NAME, as kernel.bbclass and linux-dummy.bbclass do.
> 
> AI-Generated: Uses Claude
> Signed-off-by: Prasanth R <prasanth.r@lineo.co.jp>
> ---
> 
> Notes:
>     Checked with bitbake -e: with KERNEL_PACKAGE_NAME set, the GRUB
>     scriptlets were set on kernel-image-<type>, which is not in PACKAGES. With this
>     patch they are on <KERNEL_PACKAGE_NAME>-image-<type>; the default is unchanged.
> 
>  meta/classes-recipe/kernel-grub.bbclass | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes-recipe/kernel-grub.bbclass b/meta/classes-recipe/kernel-grub.bbclass
> index 2325e635e1..7c6abc5b4f 100644
> --- a/meta/classes-recipe/kernel-grub.bbclass
> +++ b/meta/classes-recipe/kernel-grub.bbclass
> @@ -98,6 +98,7 @@ python __anonymous () {
>  	fi
>  '''
>  
> +    kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"


I'm afraid I'm not happy with that fallback default. If something does
change in the code paths later, I really want this to break, not have
inconsistent values. I'd therefore like to see a revised version of
this please.

Thanks,

Richard

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

end of thread, other threads:[~2026-11-12 13:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29  6:09 [PATCH] kernel-grub.bbclass: use KERNEL_PACKAGE_NAME for the image packages Prasanth R
2026-10-29 13:11 ` Bruce Ashfield
2026-11-04  0:27   ` Prasanth Ramesh
2026-11-04 15:15     ` Mathieu Dubois-Briand
2026-11-12 13:15 ` [OE-core] " Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox