From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0AD37159C96 for ; Wed, 24 Jul 2024 09:52:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B5A7FE2AA5; Wed, 24 Jul 2024 09:52:45 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 69BBBE2A9D for ; Wed, 24 Jul 2024 09:52:45 +0000 (UTC) From: Andrew Ammerlaan To: gentoo-dev@lists.gentoo.org Cc: Andrew Ammerlaan 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 Message-ID: <20240724095234.310603-1-andrewammerlaan@gentoo.org> X-Mailer: git-send-email 2.45.2 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 980c5c34-785f-414c-8931-9ec1bf6c1953 X-Archives-Hash: 50a8b1b3f5cc80c32b93079c5674e430 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 Closes: https://github.com/gentoo/gentoo/pull/37684 Signed-off-by: Andrew Ammerlaan --- 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