Update symlink before actually installing the kernel.  This primarily
ensures that module rebuilds triggered by the upgrade will work
correctly even if postinst fails.  Besides, pkg_config() retries
installing the kernel but does not update the symlink.

Signed-off-by: Michał Górny <[email protected]>
---
 eclass/kernel-install.eclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index b1d48b6b3b5a..33ff69fc2528 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -367,12 +367,11 @@ kernel-install_pkg_postinst() {
        debug-print-function ${FUNCNAME} "${@}"
 
        local ver="${PV}${KV_LOCALVERSION}"
+       kernel-install_update_symlink "${EROOT}/usr/src/linux" "${ver}"
 
        if [[ -z ${ROOT} ]]; then
                kernel-install_install_all "${ver}"
        fi
-
-       kernel-install_update_symlink "${EROOT}/usr/src/linux" "${ver}"
 }
 
 # @FUNCTION: kernel-install_pkg_prerm
-- 
2.30.0


Reply via email to