* [RFC PATCH 0/3] kbuild: Make sure to generate config and System.map
@ 2026-01-20 12:37 Tiezhu Yang
2026-01-20 12:37 ` [RFC PATCH 1/3] MAINTAINERS: Add scripts/install.sh into Kbuild entry Tiezhu Yang
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Tiezhu Yang @ 2026-01-20 12:37 UTC (permalink / raw)
To: Nathan Chancellor, Nicolas Schier; +Cc: linux-kbuild, linux-kernel
This series is based on 6.19-rc6.
Tiezhu Yang (3):
MAINTAINERS: Add scripts/install.sh into Kbuild entry
kbuild: Make sure to generate config file
kbuild: Make sure to generate System.map file
MAINTAINERS | 1 +
scripts/install.sh | 12 ++++++++++++
2 files changed, 13 insertions(+)
--
2.42.0
^ permalink raw reply [flat|nested] 9+ messages in thread* [RFC PATCH 1/3] MAINTAINERS: Add scripts/install.sh into Kbuild entry 2026-01-20 12:37 [RFC PATCH 0/3] kbuild: Make sure to generate config and System.map Tiezhu Yang @ 2026-01-20 12:37 ` Tiezhu Yang 2026-02-04 0:16 ` (subset) " Nathan Chancellor 2026-01-20 12:37 ` [RFC PATCH 2/3] kbuild: Make sure to generate config file Tiezhu Yang 2026-01-20 12:37 ` [RFC PATCH 3/3] kbuild: Make sure to generate System.map file Tiezhu Yang 2 siblings, 1 reply; 9+ messages in thread From: Tiezhu Yang @ 2026-01-20 12:37 UTC (permalink / raw) To: Nathan Chancellor, Nicolas Schier; +Cc: linux-kbuild, linux-kernel The common installation code is in scripts/install.sh, add it into Kbuild entry to reflect the reality. With this updated entry, folks running get_maintainer.pl on patches that touch scripts/install.sh will know to send it to linux-kbuild@ as well. Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index da9dbc1a4019..8effca525b71 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13681,6 +13681,7 @@ F: scripts/include/ F: scripts/mk* F: scripts/mod/ F: scripts/package/ +F: scripts/install.sh F: usr/ KERNEL HARDENING (not covered by other areas) -- 2.42.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: (subset) [RFC PATCH 1/3] MAINTAINERS: Add scripts/install.sh into Kbuild entry 2026-01-20 12:37 ` [RFC PATCH 1/3] MAINTAINERS: Add scripts/install.sh into Kbuild entry Tiezhu Yang @ 2026-02-04 0:16 ` Nathan Chancellor 0 siblings, 0 replies; 9+ messages in thread From: Nathan Chancellor @ 2026-02-04 0:16 UTC (permalink / raw) To: Nathan Chancellor, Nicolas Schier, Tiezhu Yang; +Cc: linux-kbuild, linux-kernel On Tue, 20 Jan 2026 20:37:28 +0800, Tiezhu Yang wrote: > The common installation code is in scripts/install.sh, add it into > Kbuild entry to reflect the reality. > > With this updated entry, folks running get_maintainer.pl on patches > that touch scripts/install.sh will know to send it to linux-kbuild@ > as well. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild-next Thanks! [1/3] MAINTAINERS: Add scripts/install.sh into Kbuild entry https://git.kernel.org/kbuild/c/1f77593d304e7 Please look out for regression or issue reports or other follow up comments, as they may result in the patch/series getting dropped or reverted. Patches applied to an "unstable" branch are accepted pending wider testing in -next and any post-commit review; they will generally be moved to the main branch in a week if no issues are found. Best regards, -- Nathan Chancellor <nathan@kernel.org> ^ permalink raw reply [flat|nested] 9+ messages in thread
* [RFC PATCH 2/3] kbuild: Make sure to generate config file 2026-01-20 12:37 [RFC PATCH 0/3] kbuild: Make sure to generate config and System.map Tiezhu Yang 2026-01-20 12:37 ` [RFC PATCH 1/3] MAINTAINERS: Add scripts/install.sh into Kbuild entry Tiezhu Yang @ 2026-01-20 12:37 ` Tiezhu Yang 2026-01-21 23:47 ` Nathan Chancellor 2026-01-20 12:37 ` [RFC PATCH 3/3] kbuild: Make sure to generate System.map file Tiezhu Yang 2 siblings, 1 reply; 9+ messages in thread From: Tiezhu Yang @ 2026-01-20 12:37 UTC (permalink / raw) To: Nathan Chancellor, Nicolas Schier; +Cc: linux-kbuild, linux-kernel 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@loongson.cn> --- 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 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [RFC PATCH 2/3] kbuild: Make sure to generate config file 2026-01-20 12:37 ` [RFC PATCH 2/3] kbuild: Make sure to generate config file Tiezhu Yang @ 2026-01-21 23:47 ` Nathan Chancellor 2026-01-22 1:14 ` Tiezhu Yang 0 siblings, 1 reply; 9+ messages in thread From: Nathan Chancellor @ 2026-01-21 23:47 UTC (permalink / raw) To: Tiezhu Yang; +Cc: Nicolas Schier, linux-kbuild, linux-kernel Hi Tiezhu, On Tue, Jan 20, 2026 at 08:37:29PM +0800, Tiezhu Yang wrote: > 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 directorg This could also be resolved by enabling CONFIG_IKCONFIG_PROC. > Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> > --- > 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} > + I am a little hesistant to change the generic install logic to handle these files, especially since the map file should be handled by installkernel like you mention in patch 3 (but I am open to other opinions/arguments) and the configuration can be made available via CONFIG_IKCONFIG_PROC as I mention above. If LoongArch wants this behavior as part of its install process, why not just bring back the lines of 75cffd392bfa after $(cmd,install) install: $(call cmd,install) $(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE) $(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE) > # installkernel(8) says the parameters are like follows: > # > # installkernel version zImage System.map [directory] > -- > 2.42.0 > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC PATCH 2/3] kbuild: Make sure to generate config file 2026-01-21 23:47 ` Nathan Chancellor @ 2026-01-22 1:14 ` Tiezhu Yang 2026-01-22 5:15 ` Nathan Chancellor 0 siblings, 1 reply; 9+ messages in thread From: Tiezhu Yang @ 2026-01-22 1:14 UTC (permalink / raw) To: Nathan Chancellor; +Cc: Nicolas Schier, linux-kbuild, linux-kernel On 2026/1/22 上午7:47, Nathan Chancellor wrote: > Hi Tiezhu, > > On Tue, Jan 20, 2026 at 08:37:29PM +0800, Tiezhu Yang wrote: >> 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 directorg > > This could also be resolved by enabling CONFIG_IKCONFIG_PROC. Currently, CONFIG_IKCONFIG_PROC is set by default on LoongArch, the above error still exists, it checks /boot/config-* first, here is the related code: tools/testing/selftests/bpf/unpriv_helpers.c: static gzFile open_config(void) { struct utsname uts; char buf[PATH_MAX]; gzFile config; if (uname(&uts)) { perror("uname"); goto config_gz; } snprintf(buf, sizeof(buf), "/boot/config-%s", uts.release); config = gzopen(buf, "rb"); if (config) return config; fprintf(stderr, "gzopen %s: %s\n", buf, strerror(errno)); config_gz: config = gzopen("/proc/config.gz", "rb"); if (!config) perror("gzopen /proc/config.gz"); return config; } >> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> >> --- >> 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} >> + > > I am a little hesistant to change the generic install logic to handle > these files, especially since the map file should be handled by > installkernel like you mention in patch 3 (but I am open to other > opinions/arguments) and the configuration can be made available via > CONFIG_IKCONFIG_PROC as I mention above. > > If LoongArch wants this behavior as part of its install process, why not > just bring back the lines of 75cffd392bfa after $(cmd,install) > > install: > $(call cmd,install) > $(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE) > $(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE) > >> # installkernel(8) says the parameters are like follows: >> # >> # installkernel version zImage System.map [directory] Yes, this works well for LoongArch. If there is no need to do this for all archs, I will only touch arch/loongarch files. By the way, I do not know why it can not generate System.map by the installkernel in practice, could you please check it? Thanks, Tiezhu ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC PATCH 2/3] kbuild: Make sure to generate config file 2026-01-22 1:14 ` Tiezhu Yang @ 2026-01-22 5:15 ` Nathan Chancellor 2026-01-22 8:58 ` Tiezhu Yang 0 siblings, 1 reply; 9+ messages in thread From: Nathan Chancellor @ 2026-01-22 5:15 UTC (permalink / raw) To: Tiezhu Yang; +Cc: Nicolas Schier, linux-kbuild, linux-kernel On Thu, Jan 22, 2026 at 09:14:07AM +0800, Tiezhu Yang wrote: > Currently, CONFIG_IKCONFIG_PROC is set by default on LoongArch, > the above error still exists, it checks /boot/config-* first, > here is the related code: > > tools/testing/selftests/bpf/unpriv_helpers.c: > static gzFile open_config(void) > { > struct utsname uts; > char buf[PATH_MAX]; > gzFile config; > > if (uname(&uts)) { > perror("uname"); > goto config_gz; > } > > snprintf(buf, sizeof(buf), "/boot/config-%s", uts.release); > config = gzopen(buf, "rb"); > if (config) > return config; > fprintf(stderr, "gzopen %s: %s\n", buf, strerror(errno)); > > config_gz: > config = gzopen("/proc/config.gz", "rb"); > if (!config) > perror("gzopen /proc/config.gz"); > return config; > } Ah but it still falls back to /proc/config.gz though, right? > Yes, this works well for LoongArch. If there is no need to do this for > all archs, I will only touch arch/loongarch files. Until there is a wider insistance on including these as part of the install target, I think it would be best to keep this in arch/loongarch, as that is the only architecture that would notice in this case. > By the way, I do not know why it can not generate System.map by the > installkernel in practice, could you please check it? Is installkernel a part of the kernel source? I am not sure where to begin to investigate that. Could be an inaccurate comment as well if installkernel's implementation has been updated. Cheers, Nathan ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC PATCH 2/3] kbuild: Make sure to generate config file 2026-01-22 5:15 ` Nathan Chancellor @ 2026-01-22 8:58 ` Tiezhu Yang 0 siblings, 0 replies; 9+ messages in thread From: Tiezhu Yang @ 2026-01-22 8:58 UTC (permalink / raw) To: Nathan Chancellor; +Cc: Nicolas Schier, linux-kbuild, linux-kernel On 2026/1/22 下午1:15, Nathan Chancellor wrote: > On Thu, Jan 22, 2026 at 09:14:07AM +0800, Tiezhu Yang wrote: >> Currently, CONFIG_IKCONFIG_PROC is set by default on LoongArch, >> the above error still exists, it checks /boot/config-* first, >> here is the related code: >> >> tools/testing/selftests/bpf/unpriv_helpers.c: >> static gzFile open_config(void) >> { >> struct utsname uts; >> char buf[PATH_MAX]; >> gzFile config; >> >> if (uname(&uts)) { >> perror("uname"); >> goto config_gz; >> } >> >> snprintf(buf, sizeof(buf), "/boot/config-%s", uts.release); >> config = gzopen(buf, "rb"); >> if (config) >> return config; >> fprintf(stderr, "gzopen %s: %s\n", buf, strerror(errno)); >> >> config_gz: >> config = gzopen("/proc/config.gz", "rb"); >> if (!config) >> perror("gzopen /proc/config.gz"); >> return config; >> } > > Ah but it still falls back to /proc/config.gz though, right? Yes, so no /boot/config-* seems not a big deal. >> Yes, this works well for LoongArch. If there is no need to do this for >> all archs, I will only touch arch/loongarch files. > > Until there is a wider insistance on including these as part of the > install target, I think it would be best to keep this in arch/loongarch, > as that is the only architecture that would notice in this case. > >> By the way, I do not know why it can not generate System.map by the >> installkernel in practice, could you please check it? > > Is installkernel a part of the kernel source? I am not sure where to > begin to investigate that. Could be an inaccurate comment as well if > installkernel's implementation has been updated. installkernel is not a part of the kernel source, IIUC it belongs to systemd: https://github.com/systemd/systemd/blob/main/src/kernel-install/kernel-install.c For now, please ignore this series. Thanks, Tiezhu ^ permalink raw reply [flat|nested] 9+ messages in thread
* [RFC PATCH 3/3] kbuild: Make sure to generate System.map file 2026-01-20 12:37 [RFC PATCH 0/3] kbuild: Make sure to generate config and System.map Tiezhu Yang 2026-01-20 12:37 ` [RFC PATCH 1/3] MAINTAINERS: Add scripts/install.sh into Kbuild entry Tiezhu Yang 2026-01-20 12:37 ` [RFC PATCH 2/3] kbuild: Make sure to generate config file Tiezhu Yang @ 2026-01-20 12:37 ` Tiezhu Yang 2 siblings, 0 replies; 9+ messages in thread From: Tiezhu Yang @ 2026-01-20 12:37 UTC (permalink / raw) To: Nathan Chancellor, Nicolas Schier; +Cc: linux-kbuild, linux-kernel 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@loongson.cn> --- 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 ^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-02-04 0:16 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-01-20 12:37 [RFC PATCH 0/3] kbuild: Make sure to generate config and System.map Tiezhu Yang 2026-01-20 12:37 ` [RFC PATCH 1/3] MAINTAINERS: Add scripts/install.sh into Kbuild entry Tiezhu Yang 2026-02-04 0:16 ` (subset) " Nathan Chancellor 2026-01-20 12:37 ` [RFC PATCH 2/3] kbuild: Make sure to generate config file Tiezhu Yang 2026-01-21 23:47 ` Nathan Chancellor 2026-01-22 1:14 ` Tiezhu Yang 2026-01-22 5:15 ` Nathan Chancellor 2026-01-22 8:58 ` Tiezhu Yang 2026-01-20 12:37 ` [RFC PATCH 3/3] kbuild: Make sure to generate System.map file Tiezhu Yang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox