If a recipe sets a custom pre/postinst function for kernel-image, this function gets discarded, which means there is no possibility to set a custom pre/postinst function.
We check if there is a custom pre/postinst function and only set the default function if nothing is set. Signed-off-by: Oliver Stäbler <oliver.staeb...@bytesatwork.ch> --- meta/classes/kernel.bbclass | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 2a765547ac..e553460566 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -66,11 +66,13 @@ python __anonymous () { d.setVar('ALLOW_EMPTY_kernel-image-' + typelower, '1') priority = d.getVar('KERNEL_PRIORITY') - postinst = '#!/bin/sh\n' + 'update-alternatives --install /' + imagedest + '/' + type + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} ' + priority + ' || true' + '\n' - d.setVar('pkg_postinst_kernel-image-' + typelower, postinst) + if not d.getVar('pkg_postinst_kernel-image-' + typelower): + postinst = '#!/bin/sh\n' + 'update-alternatives --install /' + imagedest + '/' + type + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} ' + priority + ' || true' + '\n' + d.setVar('pkg_postinst_kernel-image-' + typelower, postinst) - postrm = '#!/bin/sh\n' + 'update-alternatives --remove' + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} || true' + '\n' - d.setVar('pkg_postrm_kernel-image-' + typelower, postrm) + if not d.getVar('pkg_postrm_kernel-image-' + typelower): + postrm = '#!/bin/sh\n' + 'update-alternatives --remove' + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} || true' + '\n' + d.setVar('pkg_postrm_kernel-image-' + typelower, postrm) image = d.getVar('INITRAMFS_IMAGE') if image: -- 2.13.5 -- _______________________________________________ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto