[RFC PATCH 3/3] kbuild: Make sure to generate System.map file

From: Tiezhu Yang

Date: Tue Jan 20 2026 - 07:37:42 EST


After commit 75cffd392bfa ("LoongArch: Using generic scripts/install.sh
in `make install`"), arch/loongarch/boot/install.sh is usually not used,
either /root/bin/installkernel or /sbin/installkernel is used if found.

It should generate System.map when using the script installkernel on x86
and LoongArch Fedora Linux system according to the man pages but it does
not in practice, just copy it to the installation path.

Signed-off-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
---
scripts/install.sh | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/scripts/install.sh b/scripts/install.sh
index ecf354d8f4f1..93714ef65967 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -40,6 +40,12 @@ do
fi
cp .config ${INSTALL_PATH}/config-${KERNELRELEASE}

+ # Install system map file
+ if [ -f ${INSTALL_PATH}/System.map-${KERNELRELEASE} ]; then
+ mv ${INSTALL_PATH}/System.map-${KERNELRELEASE} ${INSTALL_PATH}/System.map-${KERNELRELEASE}.old
+ fi
+ cp System.map ${INSTALL_PATH}/System.map-${KERNELRELEASE}
+
# installkernel(8) says the parameters are like follows:
#
# installkernel version zImage System.map [directory]
--
2.42.0