@@ -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)
}
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(-)