commit:     7f907ce3d78a95139ebad835ae9a3d9ae123d9c6
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  6 01:20:03 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Sep  6 15:41:41 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f907ce3

kernel-install.eclass: pkg_preinst: fix symlinks for merged-usr

Closes: https://bugs.gentoo.org/843821
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 eclass/kernel-install.eclass | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 08f631b5e865..8acf1ad1bc05 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -418,6 +418,12 @@ kernel-install_pkg_preinst() {
                eerror "Please verify that you are applying the correct 
patches."
                die "Kernel release mismatch (${release} instead of ${PV}*)"
        fi
+       if [[ -L ${EROOT}/lib && ${EROOT}/lib -ef ${EROOT}/usr/lib ]]; then
+               # Adjust symlinks for merged-usr.
+               rm "${ED}/lib/modules/${ver}"/{build,source} || die
+               dosym "../../../src/linux-${ver}" 
"/usr/lib/modules/${ver}/build"
+               dosym "../../../src/linux-${ver}" 
"/usr/lib/modules/${ver}/source"
+       fi
 }
 
 # @FUNCTION: kernel-install_install_all

Reply via email to