commit:     11b5c48af37beba23c803f6fba78a85879b2c794
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 23 09:49:10 2024 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Wed Jul 24 17:17:41 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11b5c48a

eclass/kernel-{build,install}.eclass: link to config,Sys.map in moddir

The kernels 'make rpm-pkg' and 'make deb-pkg' install the config
and System.map into the modules directory for easy access. Let's
do the same here so our gpkg's are more symetric to rpm's and
deb's and tools that look for these files there can find it.

This also provides an easy location for the user to access the
config. Considering that /boot/config-x.y.z does not always
exist (the config instalation via /sbin/installkernel depends
on layout and +/-systemd configuration).

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/37684
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 eclass/kernel-build.eclass   | 2 ++
 eclass/kernel-install.eclass | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index be0256c21102..29719609b912 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -448,6 +448,8 @@ kernel-build_src_install() {
        # fix source tree and build dir symlinks
        dosym "../../../${kernel_dir}" "/lib/modules/${KV_FULL}/build"
        dosym "../../../${kernel_dir}" "/lib/modules/${KV_FULL}/source"
+       dosym "../../../${kernel_dir}/.config" "/lib/modules/${KV_FULL}/config"
+       dosym "../../../${kernel_dir}/System.map" 
"/lib/modules/${KV_FULL}/System.map"
        if [[ "${image_path}" == *vmlinux* ]]; then
                dosym "../../../${kernel_dir}/${image_path}" 
"/lib/modules/${KV_FULL}/vmlinux"
        else

diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index e6f0b404dcaa..0a85bfb8629d 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -623,6 +623,13 @@ kernel-install_pkg_preinst() {
                rm "${ED}/lib/modules/${KV_FULL}"/{build,source} || die
                dosym "../../../src/linux-${KV_FULL}" 
"/usr/lib/modules/${KV_FULL}/build"
                dosym "../../../src/linux-${KV_FULL}" 
"/usr/lib/modules/${KV_FULL}/source"
+               local file
+               for file in .config System.map; do
+                       if [[ -L "${ED}/lib/modules/${KV_FULL}/${file#.}" ]]; 
then
+                               rm "${ED}/lib/modules/${KV_FULL}/${file#.}" || 
die
+                               dosym "../../../src/linux-${KV_FULL}/${file}" 
"/usr/lib/modules/${KV_FULL}/${file#.}"
+                       fi
+               done
                for file in vmlinux vmlinuz; do
                        if [[ -L "${ED}/lib/modules/${KV_FULL}/${file}" ]]; then
                                rm "${ED}/lib/modules/${KV_FULL}/${file}" || die

Reply via email to