[RFC PATCH 2/3] kbuild: Make sure to generate config file

From: Tiezhu Yang

Date: Tue Jan 20 2026 - 07:37:46 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.

Then it can not generate the config file in most cases, just copy it to
the installation path. Otherwise there may be an error when testing bpf,
for example.

$ ./test_verifier
gzopen /boot/config-6.19.0-rc6: No such file or directory

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 05d62ac513ee..ecf354d8f4f1 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -34,6 +34,12 @@ do
continue
fi

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