Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 843821

Summary: dist-kernel eclasses install broken symlink on merged /usr systems
Product: Gentoo Linux Reporter: Georgy Yakovlev <gyakovlev>
Component: EclassesAssignee: Distribution Kernel Project <dist-kernel>
Status: RESOLVED FIXED    
Severity: normal CC: alexander, gentoo, sam
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/27157
https://github.com/gentoo/gentoo/pull/27160
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 690294    

Description Georgy Yakovlev archtester gentoo-dev 2022-05-11 21:12:44 UTC
on merged usr system /lib/modules/<kernel>/{build,source} symlinks installed by gentoo-kernel, gentoo-kernel-bin and vanilla-kernel packages are broken.

pwd
/lib/modules/5.15.35-talos64
# ( canonicalize missing )
realpath -m source  
/usr/usr/src/linux-5.15.35-talos64

cd /usr/lib/modules/5.15.35-talos64/
realpath -m source 
/usr/usr/src/linux-5.15.35-talos64


so the relative symlink is broken from both /usr/lib/modules and /lib/modules locations.


Probably best solution is to introduce USE=split-usr and change the symlinks based on that.
Comment 1 Georgy Yakovlev archtester gentoo-dev 2022-05-15 11:22:12 UTC
so I identified 2 places where it goes wrong.

1st - source builds.

kernel-build.eclass does that in kernel-build_src_install()

>    # fix source tree and build dir symlinks
>    dosym ../../../usr/src/linux-${ver} /lib/modules/${ver}/build
>    dosym ../../../usr/src/linux-${ver} /lib/modules/${ver}/source


so it will need to add extra ../ based on condition for merged-usr systems.


second situation is binpkgs.

xpak files always contains /lib/modules/${ver}

but after being installed to usrmerged system it effectively becomes /usr/lib/modules/${ver}


so we need to handle binpkgs as well, so not in kernel-build only.
Comment 2 Larry the Git Cow gentoo-dev 2022-09-06 15:43:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f907ce3d78a95139ebad835ae9a3d9ae123d9c6

commit 7f907ce3d78a95139ebad835ae9a3d9ae123d9c6
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-09-06 01:20:03 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-09-06 15:41:41 +0000

    kernel-install.eclass: pkg_preinst: fix symlinks for merged-usr
    
    Closes: https://bugs.gentoo.org/843821
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

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