public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Subject: [gentoo-dev] [PATCH 1/3] eclass/kernel-{build,install}.eclass: link to config,Sys.map in moddir
Date: Wed, 24 Jul 2024 11:52:32 +0200	[thread overview]
Message-ID: <20240724095234.310603-1-andrewammerlaan@gentoo.org> (raw)

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@gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/37684
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@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
-- 
2.45.2



             reply	other threads:[~2024-07-24  9:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24  9:52 Andrew Ammerlaan [this message]
2024-07-24  9:52 ` [gentoo-dev] [PATCH 2/3] kernel-build.eclass: fix determining kernel release with MODULES=n Andrew Ammerlaan
2024-07-24  9:52 ` [gentoo-dev] [PATCH 3/3] kernel-build.eclass: set toolchain variables more comprehensibly Andrew Ammerlaan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240724095234.310603-1-andrewammerlaan@gentoo.org \
    --to=andrewammerlaan@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox