public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/3] eclass/kernel-{build,install}.eclass: link to config,Sys.map in moddir
@ 2024-07-24  9:52 Andrew Ammerlaan
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Ammerlaan @ 2024-07-24  9:52 UTC (permalink / raw
  To: gentoo-dev; +Cc: Andrew Ammerlaan

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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-24  9:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-24  9:52 [gentoo-dev] [PATCH 1/3] eclass/kernel-{build,install}.eclass: link to config,Sys.map in moddir Andrew Ammerlaan
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox